feat(libSceNpGameIntent): implement the AppLauncher lifecycle a title calls at boot #8355

Merged
akkadbakkad89 merged 4 commits from upstream-pr/8355 into main 2026-10-21 06:55:49 +00:00
akkadbakkad89 commented 2026-10-20 10:58:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-20T10:58:11Z.


What

Implements the sceNpAppLauncher* lifecycle that AC Shadows (PPSA20397) imports from libSceNpGameIntent.prx, using the prototypes recovered from the title's own eboot call sites:

  • sceNpAppLauncherInitialize(initParam) — the eboot builds a 0x28-byte param whose first field is size = 0x28; implemented with that size validation, APS5_INVALID_ARG_EX on a wrong size, and lifecycle state tracking. Null param is accepted.
  • sceNpAppLauncherTerminate() — resets the lifecycle state and returns 0.
  • sceNpAppLauncherLaunchApp — the call site passes (user_id = -1, uri struct, context) and checks an int return; still NotImplemented_nid_no_patch because no launcher-service semantics are derivable without the real module — recorded in the library's debt file rather than fabricated.

Tested

Windows 11 host, WSL build. guest_np_game_intent ctest passes, now covering AppLauncher init/terminate, wrong-size rejection, and the honest LaunchApp throw. tools/check_conventions.py --base origin/main clean.

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: PPSA20397 (Assassin's Creed Shadows) AppLauncher imports
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4934738000 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8355). Originally posted by [akkadbakkad89](https://github.com/akkadbakkad89) on 2026-10-20T10:58:11Z. --- ### What Implements the `sceNpAppLauncher*` lifecycle that AC Shadows (PPSA20397) imports from `libSceNpGameIntent.prx`, using the prototypes recovered from the title's own eboot call sites: - `sceNpAppLauncherInitialize(initParam)` — the eboot builds a 0x28-byte param whose first field is `size = 0x28`; implemented with that size validation, `APS5_INVALID_ARG_EX` on a wrong size, and lifecycle state tracking. Null param is accepted. - `sceNpAppLauncherTerminate()` — resets the lifecycle state and returns 0. - `sceNpAppLauncherLaunchApp` — the call site passes `(user_id = -1, uri struct, context)` and checks an int return; still `NotImplemented_nid_no_patch` because no launcher-service semantics are derivable without the real module — recorded in the library's debt file rather than fabricated. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. --> Windows 11 host, WSL build. `guest_np_game_intent` ctest passes, now covering AppLauncher init/terminate, wrong-size rejection, and the honest `LaunchApp` throw. `tools/check_conventions.py --base origin/main` clean. ### 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: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> PPSA20397 (Assassin's Creed Shadows) AppLauncher imports - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes
github-actions[bot] commented 2026-10-20 10:58:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T10:58:57Z.


Progress report (7ce3b1d → 2f72bd8)

📈 System libraries: 53.25% (+0.03%, +2 implemented functions)

✅ 2 implemented
Library Name
libSceNpGameIntent sceNpAppLauncherInitialize
libSceNpGameIntent sceNpAppLauncherTerminate
⚪ 2 behaviourally empty (constant return or throw)
Library Name
libSceNpGameIntent sceNpAppLauncherInitialize
libSceNpGameIntent sceNpAppLauncherTerminate
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6289339932 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8355#issuecomment-6289339932). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-20T10:58:57Z. --- <!-- progress-report --> ### Progress report (7ce3b1d → 2f72bd8) 📈 **System libraries**: 53.25% (+0.03%, +2 implemented functions) <details> <summary>✅ 2 implemented</summary> | Library | Name | | - | - | | libSceNpGameIntent | `sceNpAppLauncherInitialize` | | libSceNpGameIntent | `sceNpAppLauncherTerminate` | </details> <details> <summary>⚪ 2 behaviourally empty (constant return or throw)</summary> | Library | Name | | - | - | | libSceNpGameIntent | `sceNpAppLauncherInitialize` | | libSceNpGameIntent | `sceNpAppLauncherTerminate` | </details>
xXPBSXx commented 2026-10-21 03:52:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T03:52:06Z.


Independent Windows run of this PR (data only).

Environment: Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, BUILD_TESTING=ON. Merge-tree of the PR head against main is clean. I built only guest_np_game_intent_tests; ctest -N -R guest_np_game_intent lists exactly one test.

Results (3 runs each):

  • PR head: guest_np_game_intent passes 3/3.
  • Baseline: I kept the PR's test and replaced only core/libs/prx/libSceNpGameIntent/Export.cpp with the version from the PR's merge base (891d567515), then rebuilt. The test fails 3/3 (exit 0xc0000409). I restored the PR's files afterwards.

Not run: other platforms, the other tests in the same family, the full repository CTest, and any title or console run.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6307602338 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8355#issuecomment-6307602338). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-21T03:52:06Z. --- Independent Windows run of this PR (data only). **Environment:** Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, BUILD_TESTING=ON. Merge-tree of the PR head against `main` is clean. I built only `guest_np_game_intent_tests`; `ctest -N -R guest_np_game_intent` lists exactly one test. **Results (3 runs each):** - PR head: `guest_np_game_intent` passes 3/3. - Baseline: I kept the PR's test and replaced only `core/libs/prx/libSceNpGameIntent/Export.cpp` with the version from the PR's merge base (`891d567515`), then rebuilt. The test fails 3/3 (exit 0xc0000409). I restored the PR's files afterwards. **Not run:** other platforms, the other tests in the same family, the full repository CTest, and any title or console run. AI-assisted (Claude Code).
oneandonlydean commented 2026-10-21 05:18:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T05:18:57Z.


@akkadbakkad89 thanks, this does unblock the title. On our Linux run of PPSA28183 on main 8727ddb2, the title aborts after 2 s with "sceNpAppLauncherInitialize not implemented"; with this PR it runs for 206 s and reaches a later, unrelated recompiler stop.

Since sceNpAppLauncherInitialize and sceNpAppLauncherTerminate only return 0 (nothing reads g_appLauncherReady), they're silent stubs, which CONTRIBUTING allows when they unblock a title. Three small changes before merge:

  1. List both functions under Silent stubs in the library's debt file, naming the title ID as the reason.
  2. Drop the unused g_appLauncherReady flag.
  3. Drop the size check, or cite where it comes from (a firmware read or a console result). The title's call sites give the prototypes but not what the library validates.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6308678432 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8355#issuecomment-6308678432). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-21T05:18:57Z. --- @akkadbakkad89 thanks, this does unblock the title. On our Linux run of PPSA28183 on `main` 8727ddb2, the title aborts after 2 s with "sceNpAppLauncherInitialize not implemented"; with this PR it runs for 206 s and reaches a later, unrelated recompiler stop. Since `sceNpAppLauncherInitialize` and `sceNpAppLauncherTerminate` only return 0 (nothing reads `g_appLauncherReady`), they're silent stubs, which CONTRIBUTING allows when they unblock a title. Three small changes before merge: 1. List both functions under Silent stubs in the library's debt file, naming the title ID as the reason. 2. Drop the unused `g_appLauncherReady` flag. 3. Drop the size check, or cite where it comes from (a firmware read or a console result). The title's call sites give the prototypes but not what the library validates.
akkadbakkad89 commented 2026-10-21 05:30:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-21T05:30:08Z.


All three applied in 9833ab42:

  1. Both functions now sit under Silent stubs in docs/dev/debt/libSceNpGameIntent.md, naming PPSA20397 as the reason — and were moved out of the unknown-info entry, which also described the (now removed) validation.
  2. g_appLauncherReady is gone, along with the <atomic> include — nothing read it.
  3. The size check is dropped. It was inferred from the eboot call site passing a 0x28 block with size = 0x28 as its first field — that tells us what the title passes, not what the library validates, and we have no firmware read to cite. sceNpAppLauncherInitialize now just takes the pointer and returns 0, matching the sceNpGameIntentInitialize precedent.

Compile-checked with GCC 15.2.0 (-fsyntax-only); no callers or tests read the removed flag.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6308822690 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8355#issuecomment-6308822690). Originally posted by [akkadbakkad89](https://github.com/akkadbakkad89) on 2026-10-21T05:30:08Z. --- All three applied in `9833ab42`: 1. Both functions now sit under **Silent stubs** in `docs/dev/debt/libSceNpGameIntent.md`, naming PPSA20397 as the reason — and were moved out of the unknown-info entry, which also described the (now removed) validation. 2. `g_appLauncherReady` is gone, along with the `<atomic>` include — nothing read it. 3. The size check is dropped. It was inferred from the eboot call site passing a 0x28 block with `size = 0x28` as its first field — that tells us what the title *passes*, not what the library *validates*, and we have no firmware read to cite. `sceNpAppLauncherInitialize` now just takes the pointer and returns 0, matching the `sceNpGameIntentInitialize` precedent. Compile-checked with GCC 15.2.0 (`-fsyntax-only`); no callers or tests read the removed flag.
oneandonlydean commented 2026-10-21 05:31:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T05:31:47Z.


@akkadbakkad89 thanks, all three are in. One thing left: the test still expects the size check you removed. core/libs/tests/GuestNpGameIntent.cpp:74-76 sets the size field to 0x10 and requires sceNpAppLauncherInitialize to throw std::invalid_argument. It now returns 0, so guest_np_game_intent fails on 9833ab42. Please drop those three lines, or change them to Require(sceNpAppLauncherInitialize(appLauncherParam) == 0, ...) so the test pins that any init parameter is accepted.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6308844034 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8355#issuecomment-6308844034). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-21T05:31:47Z. --- @akkadbakkad89 thanks, all three are in. One thing left: the test still expects the size check you removed. `core/libs/tests/GuestNpGameIntent.cpp:74-76` sets the size field to 0x10 and requires `sceNpAppLauncherInitialize` to throw `std::invalid_argument`. It now returns 0, so `guest_np_game_intent` fails on `9833ab42`. Please drop those three lines, or change them to `Require(sceNpAppLauncherInitialize(appLauncherParam) == 0, ...)` so the test pins that any init parameter is accepted.
akkadbakkad89 commented 2026-10-21 05:44:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-21T05:44:01Z.


Fixed in ed63b609 — went with the second option so the test pins the documented contract:

*reinterpret_cast<std::uint64_t*>(appLauncherParam) = 0x10;
Require(sceNpAppLauncherInitialize(appLauncherParam) == 0,
        "app launcher init must accept any init parameter");

Good catch — I'd compile-checked the lib but didn't rebuild the test target. guest_np_game_intent should pass again on ed63b609.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6309002351 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8355#issuecomment-6309002351). Originally posted by [akkadbakkad89](https://github.com/akkadbakkad89) on 2026-10-21T05:44:01Z. --- Fixed in `ed63b609` — went with the second option so the test pins the documented contract: ```cpp *reinterpret_cast<std::uint64_t*>(appLauncherParam) = 0x10; Require(sceNpAppLauncherInitialize(appLauncherParam) == 0, "app launcher init must accept any init parameter"); ``` Good catch — I'd compile-checked the lib but didn't rebuild the test target. `guest_np_game_intent` should pass again on `ed63b609`.
oneandonlydean commented 2026-10-21 05:55:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T05:55:47Z.


@akkadbakkad89 thanks, that matches. Full CI on ed63b609 is next.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6309156779 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8355#issuecomment-6309156779). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-21T05:55:47Z. --- @akkadbakkad89 thanks, that matches. Full CI on `ed63b609` is next.
oneandonlydean commented 2026-10-21 06:30:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T06:30:23Z.


@akkadbakkad89 thanks, the init check is right and CI is green on this head. One small docs change before merge, please: our technical-debt files don't name titles or title IDs. The two lines this PR adds to docs/dev/debt/libSceNpGameIntent.md each name one, the Silent stubs entry at "calls it early in boot" and the throwing entry at "eboot call sites give a partial prototype". Could you describe what was observed without the title, for example "a title calls it early in boot, and returning success lets it continue" and "call sites in a title's executable give a partial prototype"? Everything else can stay as it is.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6309642137 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8355#issuecomment-6309642137). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-21T06:30:23Z. --- @akkadbakkad89 thanks, the init check is right and CI is green on this head. One small docs change before merge, please: our technical-debt files don't name titles or title IDs. The two lines this PR adds to `docs/dev/debt/libSceNpGameIntent.md` each name one, the Silent stubs entry at "calls it early in boot" and the throwing entry at "eboot call sites give a partial prototype". Could you describe what was observed without the title, for example "a title calls it early in boot, and returning success lets it continue" and "call sites in a title's executable give a partial prototype"? Everything else can stay as it is.
akkadbakkad89 commented 2026-10-21 06:44:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-21T06:44:19Z.


Done in 2f72bd87 — both lines now describe the observation without naming the title:

  • Silent stubs: "a title calls it early in boot, and returning success lets it continue"
  • Unknown info: "Call sites in a title's executable give a partial prototype:"

Everything else unchanged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6309845748 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8355#issuecomment-6309845748). Originally posted by [akkadbakkad89](https://github.com/akkadbakkad89) on 2026-10-21T06:44:19Z. --- Done in `2f72bd87` — both lines now describe the observation without naming the title: - Silent stubs: "a title calls it early in boot, and returning success lets it continue" - Unknown info: "Call sites in a title's executable give a partial prototype:" Everything else unchanged.
oneandonlydean commented 2026-10-21 06:49:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T06:49:09Z.


@akkadbakkad89 thanks, the docs lines read well now, and this is ready to merge. One last small thing: could you retitle the PR so it doesn't name the game, for example feat(libSceNpGameIntent): implement the AppLauncher lifecycle a title calls at boot? The PR title goes into the merge commit on main, and we keep titles out of the project history. I will merge as soon as it's renamed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6309917613 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8355#issuecomment-6309917613). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-21T06:49:09Z. --- @akkadbakkad89 thanks, the docs lines read well now, and this is ready to merge. One last small thing: could you retitle the PR so it doesn't name the game, for example `feat(libSceNpGameIntent): implement the AppLauncher lifecycle a title calls at boot`? The PR title goes into the merge commit on `main`, and we keep titles out of the project history. I will merge as soon as it's renamed.
akkadbakkad89 commented 2026-10-21 06:51:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-21T06:51:57Z.


Renamed the title, thanks for the quick review

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6309962112 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8355#issuecomment-6309962112). Originally posted by [akkadbakkad89](https://github.com/akkadbakkad89) on 2026-10-21T06:51:57Z. --- Renamed the title, thanks for the quick review
oneandonlydean commented 2026-10-21 06:56:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T06:56:18Z.


@akkadbakkad89 merged, thanks for the quick fixes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6310028451 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8355#issuecomment-6310028451). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-21T06:56:18Z. --- @akkadbakkad89 merged, thanks for the quick fixes.
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!8355
No description provided.