feat(npwebapi2): implement sceNpWebApi2SetRequestTimeout #2853

Merged
alfalfa-star merged 3 commits from upstream-pr/2853 into main 2026-10-14 10:49:49 +00:00
alfalfa-star commented 2026-10-10 16:37:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alfalfa-star on 2026-10-10T16:37:03Z.


Why

Pinball FX (PPSA08755) stops on main 7a0c838 while its main menu appears (log from @leorossi2005):

terminate called after throwing an instance of 'std::runtime_error'
  what():  sceNpWebApi2SetRequestTimeout not implemented

What

Implements sceNpWebApi2SetRequestTimeout(request id, timeout), which still called NotImplemented_nid_no_patch.

Like the other request calls in this library, it succeeds without checking the request id. shadPS4 returns LIB_CONTEXT_NOT_FOUND, USER_CONTEXT_NOT_FOUND or REQUEST_NOT_FOUND for unknown ids, but this library keeps no request table (CreateRequest hands out counter values; AbortRequest, AddHttpRequestHeader and DeleteRequest accept any id), so those checks wait for request tracking across all of them. No request reaches a service (sceNpWebApi2SendRequest fails with UNAVAILABLE at once), so no timeout can expire. The signature follows shadPS4.

  • docs/dev/debt/libSceNpWebApi2.md lists it under Silent stubs with that reason.
  • NpWebApi2 is removed from the TechnicalDebt list of PPSA14632 exports declared without parameters. The only other export there still declared without parameters, sceNpWebApi2AddWebTraceTag, came with PPSA33016.

guest_np_web_api2 creates a request, sets its timeout and deletes it; it aborts with main's Export.cpp.

Tested

Linux (Arch, GCC 15), Release build of this branch rebased onto main e2cd21314:

  • Full ctest: 1099 of 1100 pass. agc_driver_tessellation segfaults on plain main on this machine as well.
  • tools/check_conventions.py --base upstream/main passes.
  • I don't have Pinball FX, so the title run is not mine; @leorossi2005, a run of this head would confirm it gets past the menu.

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
  • Unblocks: Pinball FX (PPSA08755)
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4812782427 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2853). Originally posted by [alfalfa-star](https://github.com/alfalfa-star) on 2026-10-10T16:37:03Z. --- ### Why Pinball FX (PPSA08755) stops on `main` 7a0c838 while its main menu appears ([log from @leorossi2005](https://github.com/boykopovar/AnyPS5/pull/2853#issuecomment-6157906888)): ```text terminate called after throwing an instance of 'std::runtime_error' what(): sceNpWebApi2SetRequestTimeout not implemented ``` ### What Implements `sceNpWebApi2SetRequestTimeout(request id, timeout)`, which still called `NotImplemented_nid_no_patch`. Like the other request calls in this library, it succeeds without checking the request id. shadPS4 returns `LIB_CONTEXT_NOT_FOUND`, `USER_CONTEXT_NOT_FOUND` or `REQUEST_NOT_FOUND` for unknown ids, but this library keeps no request table (`CreateRequest` hands out counter values; `AbortRequest`, `AddHttpRequestHeader` and `DeleteRequest` accept any id), so those checks wait for request tracking across all of them. No request reaches a service (`sceNpWebApi2SendRequest` fails with `UNAVAILABLE` at once), so no timeout can expire. The signature follows [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/np/np_web_api2/np_web_api2.cpp). - `docs/dev/debt/libSceNpWebApi2.md` lists it under Silent stubs with that reason. - NpWebApi2 is removed from the TechnicalDebt list of PPSA14632 exports declared without parameters. The only other export there still declared without parameters, `sceNpWebApi2AddWebTraceTag`, came with PPSA33016. `guest_np_web_api2` creates a request, sets its timeout and deletes it; it aborts with `main`'s `Export.cpp`. ### Tested Linux (Arch, GCC 15), Release build of this branch rebased onto `main` e2cd21314: - Full `ctest`: 1099 of 1100 pass. `agc_driver_tessellation` segfaults on plain `main` on this machine as well. - `tools/check_conventions.py --base upstream/main` passes. - I don't have Pinball FX, so the title run is not mine; @leorossi2005, a run of this head would confirm it gets past the menu. ### Checklist - [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 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] Unblocks: Pinball FX (PPSA08755) - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-10 16:38:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T16:38:42Z.


Progress report (e46c695 → 70389c0)

📈 System libraries: 88.25% (+0.03%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceNpWebApi2 sceNpWebApi2SetRequestTimeout
⚪ 1 behaviourally empty (constant return or throw)
Library Name
libSceNpWebApi2 sceNpWebApi2SetRequestTimeout
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6099787129 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2853#issuecomment-6099787129). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T16:38:42Z. --- <!-- progress-report --> ### Progress report (e46c695 → 70389c0) 📈 **System libraries**: 88.25% (+0.03%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceNpWebApi2 | `sceNpWebApi2SetRequestTimeout` | </details> <details> <summary>⚪ 1 behaviourally empty (constant return or throw)</summary> | Library | Name | | - | - | | libSceNpWebApi2 | `sceNpWebApi2SetRequestTimeout` | </details>
oneandonlydean commented 2026-10-10 19:18:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T19:18:07Z.


Same as #2852: which title stops at sceNpWebApi2SetRequestTimeout on main? A success stub needs a title it unblocks.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6101236734 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2853#issuecomment-6101236734). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T19:18:07Z. --- Same as #2852: which title stops at `sceNpWebApi2SetRequestTimeout` on main? A success stub needs a title it unblocks.
screamm commented 2026-10-10 22:29:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-10T22:29:28Z.


Windows validation of the current head 23aeebfc merged onto main 262c0316.

Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON, full build including the libs target.

  • ctest -j8 -E "^agc_|^video_out_flip": 391/392. The one failure is guest_pthread_start hitting its 60 s Windows timeout under -j8 load; it passes 2/2 in 2.5 s when run alone and does not touch this change (it also ran 39 s under the same load on unchanged main here).
  • The change has no test; the build and the existing guest_http2 and guest_np_* tests pass.

Validation run with Claude Code assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102863815 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2853#issuecomment-6102863815). Originally posted by [screamm](https://github.com/screamm) on 2026-10-10T22:29:28Z. --- Windows validation of the current head `23aeebfc` merged onto `main` `262c0316`. Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, `BUILD_TESTING=ON`, full build including the `libs` target. - `ctest -j8 -E "^agc_|^video_out_flip"`: 391/392. The one failure is `guest_pthread_start` hitting its 60 s Windows timeout under `-j8` load; it passes 2/2 in 2.5 s when run alone and does not touch this change (it also ran 39 s under the same load on unchanged `main` here). - The change has no test; the build and the existing `guest_http2` and `guest_np_*` tests pass. Validation run with Claude Code assistance.
adriadam10 commented 2026-10-11 00:10:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T00:10:04Z.

Review: DISMISSED


Thanks for the Windows run and the TechnicalDebt entry. Before this can go in:

  • No title is named. @oneandonlydean asked which title stops at sceNpWebApi2SetRequestTimeout on main and it is still unanswered. Please add the title ID and the not implemented log line where it stops; the import alone isn't enough.
  • core/libs/prx/libSceNpWebApi2/Export.cpp:156: it succeeds for any request id. shadPS4 routes the call through setRequestTimeout(request_id, timeout) (np_web_api2.cpp:413), so please check what it validates and either follow it or say in the TechnicalDebt line why not.

Happy to look again once a title that reaches it is shown.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5481283886 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2853#pullrequestreview-5481283886). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T00:10:04Z. **Review:** DISMISSED --- Thanks for the Windows run and the TechnicalDebt entry. Before this can go in: - No title is named. @oneandonlydean asked which title stops at `sceNpWebApi2SetRequestTimeout` on `main` and it is still unanswered. Please add the title ID and the `not implemented` log line where it stops; the import alone isn't enough. - `core/libs/prx/libSceNpWebApi2/Export.cpp:156`: it succeeds for any request id. shadPS4 routes the call through `setRequestTimeout(request_id, timeout)` (`np_web_api2.cpp:413`), so please check what it validates and either follow it or say in the TechnicalDebt line why not. Happy to look again once a title that reaches it is shown.
alfalfa-star commented 2026-10-11 09:45:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alfalfa-star on 2026-10-11T09:45:22Z.


No title I can run reaches sceNpWebApi2SetRequestTimeout on current main (90c152e8):

  • LEGO Horizon Adventures (PPSA14632) aborts after about 35 s at color views of several array slices are unsupported (#2102). My local test branch gets past that and other stops; there it played 385 s with scripted input, through New Game and a save, without calling sceNpWebApi2SetRequestTimeout.
  • Kena: Bridge of Spirits (PPSA01802) crashes in game code after about 60 s, with no not implemented line before it.

I'm converting this to a draft until a title stops at it. Then I'll post the title ID and the log line and mark it ready.

Changed (rebased onto main):

  • shadPS4 looks the request up through its library and user contexts and returns LIB_CONTEXT_NOT_FOUND, USER_CONTEXT_NOT_FOUND or REQUEST_NOT_FOUND. This library keeps no request table: CreateRequest hands out counter values, and AbortRequest, AddHttpRequestHeader and DeleteRequest accept any id. So following shadPS4 means tracking ids across all of them, which is a separate change. The TechnicalDebt line now says this, under Silent stubs, where main's conventions check now wants it.
  • guest_np_web_api2 now creates a request, sets its timeout and deletes it. It aborts with main's Export.cpp.

Tested: Linux, GCC, Release, RX 9070 XT (RADV): full ctest 813/813 (4 video_out_flip_* skipped) on main 90c152e8 merged with this branch, #2848 and #2851; tools/check_conventions.py passes.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6107714452 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2853#issuecomment-6107714452). Originally posted by [alfalfa-star](https://github.com/alfalfa-star) on 2026-10-11T09:45:22Z. --- No title I can run reaches `sceNpWebApi2SetRequestTimeout` on current `main` (90c152e8): - LEGO Horizon Adventures (PPSA14632) aborts after about 35 s at `color views of several array slices are unsupported` (#2102). My local test branch gets past that and other stops; there it played 385 s with scripted input, through New Game and a save, without calling `sceNpWebApi2SetRequestTimeout`. - Kena: Bridge of Spirits (PPSA01802) crashes in game code after about 60 s, with no `not implemented` line before it. I'm converting this to a draft until a title stops at it. Then I'll post the title ID and the log line and mark it ready. **Changed** (rebased onto `main`): - shadPS4 looks the request up through its library and user contexts and returns `LIB_CONTEXT_NOT_FOUND`, `USER_CONTEXT_NOT_FOUND` or `REQUEST_NOT_FOUND`. This library keeps no request table: `CreateRequest` hands out counter values, and `AbortRequest`, `AddHttpRequestHeader` and `DeleteRequest` accept any id. So following shadPS4 means tracking ids across all of them, which is a separate change. The TechnicalDebt line now says this, under Silent stubs, where `main`'s conventions check now wants it. - `guest_np_web_api2` now creates a request, sets its timeout and deletes it. It aborts with `main`'s `Export.cpp`. **Tested:** Linux, GCC, Release, RX 9070 XT (RADV): full `ctest` 813/813 (4 `video_out_flip_*` skipped) on `main` 90c152e8 merged with this branch, #2848 and #2851; `tools/check_conventions.py` passes. AI-assisted: yes (Claude Code)
adriadam10 commented 2026-10-11 09:46:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T09:46:34Z.

Review: DISMISSED


Thanks for the answer. Keeping this as a draft until a title actually stops at sceNpWebApi2SetRequestTimeout is right: please post the title ID and the not implemented log line when you have it, then mark it ready.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5482803443 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2853#pullrequestreview-5482803443). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T09:46:34Z. **Review:** DISMISSED --- Thanks for the answer. Keeping this as a draft until a title actually stops at `sceNpWebApi2SetRequestTimeout` is right: please post the title ID and the `not implemented` log line when you have it, then mark it ready.
leorossi2005 commented 2026-10-14 00:11:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by leorossi2005 on 2026-10-14T00:11:36Z.


@alfalfa-star @adriadam10 Hi, i've got a title that stops with "sceNpWebApi2SetRequestTimeout not implemented" if it's useful to merge this PR, this happens on main 7a0c838

Nvidia GPU, AMD CPU

It's Pinball FX (PPSA08755), it loads and the main menu i think starts to appear but it stops after some frames and output this

...
[src/Texture.cpp:630 Texture] Texture address=0x20f8ad0000 540x456 mips=1 viewed from storage image (vk=9)
[src/Texture.cpp:904 StorageTexture] StorageTexture address=0x20f8a50000 540x456 mips=1 mip=0 layers=0 base=0 dim=1 tile=0 format=1 vk=9
[src/Texture.cpp:630 Texture] Texture address=0x20f8a50000 540x456 mips=1 viewed from storage image (vk=9)
[src/Texture.cpp:904 StorageTexture] StorageTexture address=0x20f8b50000 540x456 mips=1 mip=0 layers=0 base=0 dim=1 tile=0 format=1 vk=9
[src/Texture.cpp:630 Texture] Texture address=0x20f8b50000 540x456 mips=1 viewed from storage image (vk=9)
[libc] unhandled exception 'St13runtime_error' thrown from 00007ffb620c73f6
terminate called after throwing an instance of 'std::runtime_error'
  what():  sceNpWebApi2SetRequestTimeout not implemented
FATAL: abort() (SIGABRT) on thread 25436
    #0 0x00007ffb6203b4b8 libc.prx+0xb4b8
    #1 0x00007ffb620e05f1 libc.prx+0xb05f1
    #2 0x000000000bcfee90
  stack return address candidates:
    [rsp+0x8] 0x00007ffbead02139 ucrtbase.dll+0xc2139
    [rsp+0x68] 0x00007ffb620c73f6 libc.prx+0x973f6
...
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6157906888 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2853#issuecomment-6157906888). Originally posted by [leorossi2005](https://github.com/leorossi2005) on 2026-10-14T00:11:36Z. --- @alfalfa-star @adriadam10 Hi, i've got a title that stops with "sceNpWebApi2SetRequestTimeout not implemented" if it's useful to merge this PR, this happens on main `7a0c838` Nvidia GPU, AMD CPU It's Pinball FX (PPSA08755), it loads and the main menu i think starts to appear but it stops after some frames and output this ```text ... [src/Texture.cpp:630 Texture] Texture address=0x20f8ad0000 540x456 mips=1 viewed from storage image (vk=9) [src/Texture.cpp:904 StorageTexture] StorageTexture address=0x20f8a50000 540x456 mips=1 mip=0 layers=0 base=0 dim=1 tile=0 format=1 vk=9 [src/Texture.cpp:630 Texture] Texture address=0x20f8a50000 540x456 mips=1 viewed from storage image (vk=9) [src/Texture.cpp:904 StorageTexture] StorageTexture address=0x20f8b50000 540x456 mips=1 mip=0 layers=0 base=0 dim=1 tile=0 format=1 vk=9 [src/Texture.cpp:630 Texture] Texture address=0x20f8b50000 540x456 mips=1 viewed from storage image (vk=9) [libc] unhandled exception 'St13runtime_error' thrown from 00007ffb620c73f6 terminate called after throwing an instance of 'std::runtime_error' what(): sceNpWebApi2SetRequestTimeout not implemented FATAL: abort() (SIGABRT) on thread 25436 #0 0x00007ffb6203b4b8 libc.prx+0xb4b8 #1 0x00007ffb620e05f1 libc.prx+0xb05f1 #2 0x000000000bcfee90 stack return address candidates: [rsp+0x8] 0x00007ffbead02139 ucrtbase.dll+0xc2139 [rsp+0x68] 0x00007ffb620c73f6 libc.prx+0x973f6 ... ```
oneandonlydean commented 2026-10-14 01:24:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T01:24:25Z.


@alfalfa-star Pinball FX (PPSA08755) stops here on main, see leorossi2005's log above. Please rebase and mark it ready.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6158784861 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2853#issuecomment-6158784861). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T01:24:25Z. --- @alfalfa-star Pinball FX (PPSA08755) stops here on main, see leorossi2005's log above. Please rebase and mark it ready.
alfalfa-star commented 2026-10-14 05:27:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alfalfa-star on 2026-10-14T05:27:26Z.


@oneandonlydean rebased onto main e2cd21314 and marked ready. The description now names Pinball FX (PPSA08755) and its log line. Main moved the debt entries into per-library files, so the entry is now under Silent stubs in docs/dev/debt/libSceNpWebApi2.md. Full ctest passes apart from agc_driver_tessellation, which segfaults on plain main here too.

@adriadam10, the earlier change requests were about not having a title; Pinball FX is that title now.

Thanks @leorossi2005 for the log.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6161589057 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2853#issuecomment-6161589057). Originally posted by [alfalfa-star](https://github.com/alfalfa-star) on 2026-10-14T05:27:26Z. --- @oneandonlydean rebased onto `main` e2cd21314 and marked ready. The description now names Pinball FX (PPSA08755) and its log line. Main moved the debt entries into per-library files, so the entry is now under Silent stubs in `docs/dev/debt/libSceNpWebApi2.md`. Full `ctest` passes apart from `agc_driver_tessellation`, which segfaults on plain `main` here too. @adriadam10, the earlier change requests were about not having a title; Pinball FX is that title now. Thanks @leorossi2005 for the log.
oneandonlydean commented 2026-10-14 06:23:48 +00:00 (Migrated from github.com)

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


Thanks for the rebase and the title. The full build is green on this head; before it goes in it needs one run by someone other than the author: Pinball FX (PPSA08755) on current main with and without this PR, showing it gets past sceNpWebApi2SetRequestTimeout. Could someone who has the title post one?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6162289804 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2853#issuecomment-6162289804). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T06:23:48Z. --- Thanks for the rebase and the title. The full build is green on this head; before it goes in it needs one run by someone other than the author: Pinball FX (PPSA08755) on current `main` with and without this PR, showing it gets past `sceNpWebApi2SetRequestTimeout`. Could someone who has the title post one?
adriadam10 commented 2026-10-14 10:42:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T10:42:29Z.


Checked: guest_np_web_api2 aborts without the change (the NotImplemented_nid_no_patch throw) and passes with it; scoped build and ctest (33 tests) are green on this head merged onto main. The stub matches the other request calls of this library and the debt entry says why. Pinball FX getting past the menu is not verified by us; merging since the stop in the log is exactly this call.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6166523662 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2853#issuecomment-6166523662). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T10:42:29Z. --- Checked: `guest_np_web_api2` aborts without the change (the `NotImplemented_nid_no_patch` throw) and passes with it; scoped build and ctest (33 tests) are green on this head merged onto main. The stub matches the other request calls of this library and the debt entry says why. Pinball FX getting past the menu is not verified by us; merging since the stop in the log is exactly this call.
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!2853
No description provided.