feat(libSceNpWebApi): add the user-id context, pool stats and extended push event exports #9920

Merged
ntamas94 merged 8 commits from upstream-pr/9920 into main 2026-11-09 13:20:31 +00:00
ntamas94 commented 2026-10-22 21:51:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ntamas94 on 2026-10-22T21:51:15Z.


What

Builds on #9797 (user contexts, requests and push event callbacks) and adds the six exports that remain missing and that the measured PS4 titles import: sceNpWebApiCreateContextA (CUSA04865, CUSA12435), sceNpWebApiGetMemoryPoolStats, sceNpWebApiCreateExtdPushEventFilter, sceNpWebApiDeleteExtdPushEventFilter, sceNpWebApiRegisterExtdPushEventCallbackA and sceNpWebApiUnregisterExtdPushEventCallback (CUSA04865). The return values follow a PS4 Pro on firmware 10.71 with no PSN sign-in: sceNpWebApiCreateContextA gives 0x80552902 for a negative user, 0x80552903 for an unknown library context, 0x80960105 for a user that is not signed in, the same libCtxId << 16 | n id as sceNpWebApiCreateContext for the initial user (the two share the user context, so the second call gives 0x8055290A); sceNpWebApiGetMemoryPoolStats reports the pool size; an extended filter needs a signed-in user (0x80552910), so the register, unregister and delete calls answer 0x8055291C or 0x8055291D. The user-context creation of #9797 moves into a shared helper so both entry points use it. The in-use pool bytes the console reports, the unmeasured orderings and the guessed error names are recorded in docs/dev/debt/libSceNpWebApi.md. The guest test gains a section for the six exports.

Tested

Windows 11: guest_np_web_api passed on the final head (02dc3f2). The values were measured on a PS4 Pro (firmware 10.71, offline, no request sent) with a homebrew probe; the same probe compiled against this branch on the host gives the same return values on the 24 rows that cover these exports and sceNpWebApiDeleteContext from #9797. Not run with a title.

Refresh — 2026-11-03 (Codex, AI-assisted): Merged main 086c0686c8, retaining both the new response tests/constants and this PR's console-measured exports and tests. MinGW-w64 GCC 15.2 syntax-only compilation passes for Export.cpp and GuestNpWebApi.cpp; conventions and whitespace checks pass. No new linked runtime/public_headers run on this merged head.

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 (#9797 is merged)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4974603878 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9920). Originally posted by [ntamas94](https://github.com/ntamas94) on 2026-10-22T21:51:15Z. --- ### What Builds on #9797 (user contexts, requests and push event callbacks) and adds the six exports that remain missing and that the measured PS4 titles import: `sceNpWebApiCreateContextA` (CUSA04865, CUSA12435), `sceNpWebApiGetMemoryPoolStats`, `sceNpWebApiCreateExtdPushEventFilter`, `sceNpWebApiDeleteExtdPushEventFilter`, `sceNpWebApiRegisterExtdPushEventCallbackA` and `sceNpWebApiUnregisterExtdPushEventCallback` (CUSA04865). The return values follow a PS4 Pro on firmware 10.71 with no PSN sign-in: `sceNpWebApiCreateContextA` gives 0x80552902 for a negative user, 0x80552903 for an unknown library context, 0x80960105 for a user that is not signed in, the same `libCtxId << 16 | n` id as `sceNpWebApiCreateContext` for the initial user (the two share the user context, so the second call gives 0x8055290A); `sceNpWebApiGetMemoryPoolStats` reports the pool size; an extended filter needs a signed-in user (0x80552910), so the register, unregister and delete calls answer 0x8055291C or 0x8055291D. The user-context creation of #9797 moves into a shared helper so both entry points use it. The in-use pool bytes the console reports, the unmeasured orderings and the guessed error names are recorded in `docs/dev/debt/libSceNpWebApi.md`. The guest test gains a section for the six exports. ### Tested Windows 11: `guest_np_web_api` passed on the final head (02dc3f2). The values were measured on a PS4 Pro (firmware 10.71, offline, no request sent) with a homebrew probe; the same probe compiled against this branch on the host gives the same return values on the 24 rows that cover these exports and `sceNpWebApiDeleteContext` from #9797. Not run with a title. **Refresh — 2026-11-03 (Codex, AI-assisted):** Merged main 086c0686c8, retaining both the new response tests/constants and this PR's console-measured exports and tests. MinGW-w64 GCC 15.2 syntax-only compilation passes for Export.cpp and GuestNpWebApi.cpp; conventions and whitespace checks pass. No new linked runtime/public_headers run on this merged head. ### 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 (#9797 is merged) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-23 05:49:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T05:49:01Z.

Review: APPROVED


Reviewed exact head 02dc3f2fd4f1b79cd5b66844a0e12092c31cb6ba as the declared stack on #9797. The six added exports and the shared context helper are covered by guest_np_web_api; the PS4 Pro firmware 10.71 probe values are reported separately from host comparison and no PS5/title result is claimed. Unmeasured pool usage, ordering and guessed error names are documented in debt. Current-main whitespace and conventions pass; the branch merges cleanly, with no intervening main commits touching the changed paths. Hosted product jobs are skipped; I did not rerun C++ tests locally. The open #9797 dependency remains required before merge, as declared.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5624424375 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9920#pullrequestreview-5624424375). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T05:49:01Z. **Review:** APPROVED --- Reviewed exact head `02dc3f2fd4f1b79cd5b66844a0e12092c31cb6ba` as the declared stack on #9797. The six added exports and the shared context helper are covered by `guest_np_web_api`; the PS4 Pro firmware 10.71 probe values are reported separately from host comparison and no PS5/title result is claimed. Unmeasured pool usage, ordering and guessed error names are documented in debt. Current-main whitespace and conventions pass; the branch merges cleanly, with no intervening main commits touching the changed paths. Hosted product jobs are skipped; I did not rerun C++ tests locally. The open #9797 dependency remains required before merge, as declared.
XairRrR commented 2026-10-29 10:54:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T10:54:06Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The six exports build and guest_np_web_api passes, but the merged tree fails the public_headers test because Export.cpp redeclares sceNpWebApiCreateServicePushEventFilter.

What I ran

  • PR head: bdf05fc6015b0b60466f1f763b8d112e390f79f0
  • main: d2b15d8802f7fff387c523910355387b300d3911
  • Tree: main merged with the PR head (--no-ff) in a clean worktree. The merge had no conflicts.
  • Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, Release, Ninja.
git fetch -q origin main pull/9920/head:refs/review/9920
git checkout -q --detach origin/main
git merge -q --no-ff --no-edit refs/review/9920
git diff --check origin/main...refs/review/9920
python3 tools/check_conventions.py --base origin/main
cmake -S . -B build
cmake --build build -j10 --target guest_np_web_api_tests libSceNpWebApi
ctest --test-dir build -R '^(guest_np_web_api|public_headers)$' --output-on-failure
# same public_headers run on origin/main
git checkout -q --detach origin/main
ctest --test-dir build -R '^public_headers$' --output-on-failure
# negative control
git checkout origin/main -- core/libs/prx/libSceNpWebApi/Export.cpp core/libs/prx/libSceNpWebApi/include/Api.hpp
cmake --build build -j10 --target guest_np_web_api_tests
# fix check: delete the forward declaration at Export.cpp:148, rebuild, rerun both tests

Results

Check Result
Merge with main Clean
git diff --check Pass
tools/check_conventions.py --base origin/main Pass (All conventions checks passed.)
Build libSceNpWebApi, guest_np_web_api_tests Pass, no warnings in the changed files
guest_np_web_api Pass (0.00 s)
public_headers (merged tree) Fail
public_headers (main) Pass
guest_np_web_api + public_headers with only Export.cpp:148 deleted Both pass
public_headers on the merged tree
1/2 Test  #325: public_headers ...................***Failed    5.92 sec
Traceback (most recent call last):
  File ".../core/libs/tests/test_public_headers.py", line 237, in <module>
    main()
  File ".../core/libs/tests/test_public_headers.py", line 226, in main
    umbrellas, headers, count = audit()
  File ".../core/libs/tests/test_public_headers.py", line 152, in audit
    raise RuntimeError("\n".join(errors))
RuntimeError: sceNpWebApiCreateServicePushEventFilter: expected exactly one header declaration; found 2: core/libs/prx/libSceNpWebApi/Export.cpp:148, core/libs/prx/libSceNpWebApi/include/Api.hpp:28

2/2 Test #2197: guest_np_web_api .................   Passed    0.00 sec

Negative control

I restored Export.cpp and include/Api.hpp from main and kept the new test. guest_np_web_api_tests then fails to compile: NpWebApiMemoryPoolStats, sceNpWebApiGetMemoryPoolStats, sceNpWebApiCreateContextA, sceNpWebApiCreateExtdPushEventFilter, sceNpWebApiRegisterExtdPushEventCallbackA and sceNpWebApiUnregisterExtdPushEventCallback are undeclared. So the new section depends on the production change. Because the test cannot be built against main, this control cannot check individual return values.

Findings

Blocking

  • public_headers fails because of a duplicate declaration. core/libs/prx/libSceNpWebApi/Export.cpp:148 forward-declares sceNpWebApiCreateServicePushEventFilter, which is already declared in include/Api.hpp:28. Since #10706, public_headers requires each export to be declared exactly once, in the library's public header, and it rejects this. This is the rule oneandonlydean pointed to earlier in this thread. The merge commit moved the six new declarations into Api.hpp but left this one in Export.cpp. Fix: delete line 148. Export.cpp already sees the declaration through Api.hpp. I checked that with that one line removed, the target builds and both guest_np_web_api and public_headers pass. The author's comment reports guest_np_web_api and check_conventions.py passing on this head, but neither runs this audit.

Non-blocking

  • Null-callback check in sceNpWebApiRegisterExtdPushEventCallbackA. Export.cpp:284-292 ignores callback, and the debt entry says "a null callback is not checked". BunnyFl reported in this thread that the PS5 13.42 module returns 0x80552902 (INVALID_ARGUMENT) for a null callback before it looks at the user context or the filter. That data point has no reply yet. Either check !callback first and add a test row, or note the PS5 result in the debt entry so the open question is not lost. I did not verify their measurement.
  • sceNpWebApiCreateContextA returns INVALID_LIB_CONTEXT_ID for every unknown library context, but only -1 was measured. For a positive unknown id, the rest of the library returns LIB_CONTEXT_NOT_FOUND. The debt entry records this, so it is not blocking. The test row with 0x7fff + 1 pins an unmeasured value, though. A comment-free way to keep the test honest is to test only -1 there.

Not verified

  • The PS4 Pro firmware 10.71 return values and the probe comparison in the description. I have no console and no probe output.
  • Windows build and test.
  • Behaviour with a title. I ran none.
  • The full test suite. I ran only guest_np_web_api and public_headers (the audit, not the public_headers_compile_* batches, which depend on the audit fixture).

To get this to a good state

  1. Remove the forward declaration at core/libs/prx/libSceNpWebApi/Export.cpp:148.
  2. Rerun ctest -R '^(guest_np_web_api|public_headers)$' on the new head, and post the result.
  3. Optionally, address BunnyFl's null-callback data point in the code or in the debt entry.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5696553840 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9920#pullrequestreview-5696553840). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-29T10:54:06Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The six exports build and `guest_np_web_api` passes, but the merged tree fails the `public_headers` test because `Export.cpp` redeclares `sceNpWebApiCreateServicePushEventFilter`. ## What I ran - PR head: `bdf05fc6015b0b60466f1f763b8d112e390f79f0` - `main`: `d2b15d8802f7fff387c523910355387b300d3911` - Tree: `main` merged with the PR head (`--no-ff`) in a clean worktree. The merge had no conflicts. - Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, Release, Ninja. ```sh git fetch -q origin main pull/9920/head:refs/review/9920 git checkout -q --detach origin/main git merge -q --no-ff --no-edit refs/review/9920 git diff --check origin/main...refs/review/9920 python3 tools/check_conventions.py --base origin/main cmake -S . -B build cmake --build build -j10 --target guest_np_web_api_tests libSceNpWebApi ctest --test-dir build -R '^(guest_np_web_api|public_headers)$' --output-on-failure # same public_headers run on origin/main git checkout -q --detach origin/main ctest --test-dir build -R '^public_headers$' --output-on-failure # negative control git checkout origin/main -- core/libs/prx/libSceNpWebApi/Export.cpp core/libs/prx/libSceNpWebApi/include/Api.hpp cmake --build build -j10 --target guest_np_web_api_tests # fix check: delete the forward declaration at Export.cpp:148, rebuild, rerun both tests ``` ## Results | Check | Result | | - | - | | Merge with `main` | Clean | | `git diff --check` | Pass | | `tools/check_conventions.py --base origin/main` | Pass (`All conventions checks passed.`) | | Build `libSceNpWebApi`, `guest_np_web_api_tests` | Pass, no warnings in the changed files | | `guest_np_web_api` | Pass (0.00 s) | | `public_headers` (merged tree) | **Fail** | | `public_headers` (`main`) | Pass | | `guest_np_web_api` + `public_headers` with only `Export.cpp:148` deleted | Both pass | <details> <summary><code>public_headers</code> on the merged tree</summary> ``` 1/2 Test #325: public_headers ...................***Failed 5.92 sec Traceback (most recent call last): File ".../core/libs/tests/test_public_headers.py", line 237, in <module> main() File ".../core/libs/tests/test_public_headers.py", line 226, in main umbrellas, headers, count = audit() File ".../core/libs/tests/test_public_headers.py", line 152, in audit raise RuntimeError("\n".join(errors)) RuntimeError: sceNpWebApiCreateServicePushEventFilter: expected exactly one header declaration; found 2: core/libs/prx/libSceNpWebApi/Export.cpp:148, core/libs/prx/libSceNpWebApi/include/Api.hpp:28 2/2 Test #2197: guest_np_web_api ................. Passed 0.00 sec ``` </details> ## Negative control I restored `Export.cpp` and `include/Api.hpp` from `main` and kept the new test. `guest_np_web_api_tests` then fails to compile: `NpWebApiMemoryPoolStats`, `sceNpWebApiGetMemoryPoolStats`, `sceNpWebApiCreateContextA`, `sceNpWebApiCreateExtdPushEventFilter`, `sceNpWebApiRegisterExtdPushEventCallbackA` and `sceNpWebApiUnregisterExtdPushEventCallback` are undeclared. So the new section depends on the production change. Because the test cannot be built against `main`, this control cannot check individual return values. ## Findings ### Blocking - **`public_headers` fails because of a duplicate declaration.** [`core/libs/prx/libSceNpWebApi/Export.cpp:148`](https://github.com/boykopovar/AnyPS5/blob/bdf05fc6015b0b60466f1f763b8d112e390f79f0/core/libs/prx/libSceNpWebApi/Export.cpp#L148-L148) forward-declares `sceNpWebApiCreateServicePushEventFilter`, which is already declared in [`include/Api.hpp:28`](https://github.com/boykopovar/AnyPS5/blob/bdf05fc6015b0b60466f1f763b8d112e390f79f0/core/libs/prx/libSceNpWebApi/include/Api.hpp#L28-L28). Since #10706, `public_headers` requires each export to be declared exactly once, in the library's public header, and it rejects this. This is the rule oneandonlydean pointed to earlier in this thread. The merge commit moved the six new declarations into `Api.hpp` but left this one in `Export.cpp`. Fix: delete line 148. `Export.cpp` already sees the declaration through `Api.hpp`. I checked that with that one line removed, the target builds and both `guest_np_web_api` and `public_headers` pass. The author's comment reports `guest_np_web_api` and `check_conventions.py` passing on this head, but neither runs this audit. ### Non-blocking - **Null-callback check in `sceNpWebApiRegisterExtdPushEventCallbackA`.** [`Export.cpp:284-292`](https://github.com/boykopovar/AnyPS5/blob/bdf05fc6015b0b60466f1f763b8d112e390f79f0/core/libs/prx/libSceNpWebApi/Export.cpp#L284-L292) ignores `callback`, and the debt entry says "a null callback is not checked". BunnyFl reported in this thread that the PS5 13.42 module returns `0x80552902` (`INVALID_ARGUMENT`) for a null callback before it looks at the user context or the filter. That data point has no reply yet. Either check `!callback` first and add a test row, or note the PS5 result in the debt entry so the open question is not lost. I did not verify their measurement. - `sceNpWebApiCreateContextA` returns `INVALID_LIB_CONTEXT_ID` for every unknown library context, but only `-1` was measured. For a positive unknown id, the rest of the library returns `LIB_CONTEXT_NOT_FOUND`. The debt entry records this, so it is not blocking. The test row with `0x7fff + 1` pins an unmeasured value, though. A comment-free way to keep the test honest is to test only `-1` there. ## Not verified - The PS4 Pro firmware 10.71 return values and the probe comparison in the description. I have no console and no probe output. - Windows build and test. - Behaviour with a title. I ran none. - The full test suite. I ran only `guest_np_web_api` and `public_headers` (the audit, not the `public_headers_compile_*` batches, which depend on the audit fixture). ## To get this to a good state 1. Remove the forward declaration at `core/libs/prx/libSceNpWebApi/Export.cpp:148`. 2. Rerun `ctest -R '^(guest_np_web_api|public_headers)$'` on the new head, and post the result. 3. Optionally, address BunnyFl's null-callback data point in the code or in the debt entry.
XairRrR commented 2026-11-03 21:16:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T21:16:37Z.

Review: APPROVED


Re-checked — approved

Commit 30556bb48b removes the duplicate forward declaration of sceNpWebApiCreateServicePushEventFilter, and public_headers now passes on the merged tree. The later merge of main (3c783ecec2) garbled one character in the debt doc; that is non-blocking.

What changed since my last review

  • 30556bb48b deletes the in-file forward declaration in Export.cpp. Export.cpp gets the declaration from include/Api.hpp.
  • 3c783ecec2 merges main at 086c0686c8. Commits f6f6e77287 and 02dc3f2fd4 are unchanged. The six exports, the test section and the debt entry are the same as in the last review, apart from the encoding change below.
  • The description adds a "Refresh" note. The author reports that they did not run the linked runtime or public_headers tests on this merged head. Their earlier comment reports guest_np_web_api, guest_np_web_api_initialize and public_headers passing on 30556bb48b (Windows, MinGW-w64 GCC 15.2).
  • Nobody has replied yet to BunnyFl's null-callback data point.

What I ran

  • PR head: 3c783ecec230fa3a04bec38618b19f05fc6d39c7
  • main: 086c0686c8adff3ee648fdbe34e0b0b647e1d511
  • Merged tree: ed864edb1f9e09d579949b02265fc461896179aa (--no-ff, clean worktree), Release build with GCC 14.2.0 and Ninja, on Debian 13.
git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...3c783ecec230fa3a04bec38618b19f05fc6d39c7
python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511
ctest --test-dir build -j8 --test-load 32 -R "^(guest_np_web_api|guest_np_web_api_initialize|public_headers)$" --output-on-failure
# negative control: in Export.cpp, sceNpWebApiUnregisterExtdPushEventCallback returns 0 instead of 0x8055291D
ninja -C build -j32 -l32 guest_np_web_api_tests
ctest --test-dir build -R "^guest_np_web_api$" --output-on-failure
# restore Export.cpp from ed864edb1f, rebuild, rerun, git status --porcelain (empty)
git show <sha>:docs/dev/debt/libSceNpWebApi.md | grep -o "per 1000.\{0,6\}" | od -An -c   # at 30556bb48b and 3c783ecec2
Check Result
git diff --check Pass
check_conventions.py Pass (All conventions checks passed.)
Build (script) Pass
Selected tests (script, 817) 814 passed, 2 expected skips, 1 known failure on main (unwrap_self_…destination_directory_group), 0 new failures
guest_np_web_api, guest_np_web_api_initialize, public_headers 3/3 pass. public_headers ran about 60 s on this machine, as it is also slow on main.
Negative control guest_np_web_api fails as expected

Previous findings

  • Blocking: duplicate declaration fails public_headers. Resolved. The only remaining mention of sceNpWebApiCreateServicePushEventFilter in Export.cpp is its definition (Export.cpp:217) plus the call at Export.cpp:186, and public_headers passes on the merged tree.
  • Non-blocking: null callback in sceNpWebApiRegisterExtdPushEventCallbackA. Still open. Export.cpp:322-330 still ignores callback. BunnyFl's PS5 13.42 result (0x80552902 for a null callback, returned first) is neither handled in the code nor recorded in the debt entry.
  • Non-blocking: the 0x7fff + 1 test row pins an unmeasured value. No longer applies as written. Current main now returns INVALID_LIB_CONTEXT_ID for libCtxId >= 0x8000 in sceNpWebApiCreateContext (Export.cpp:168). The 0x8000 row in GuestNpWebApi.cpp:270 therefore matches what the sibling export does. One difference remains, and the debt entry records it: for an unknown id below 0x8000, sceNpWebApiCreateContextA returns INVALID_LIB_CONTEXT_ID (Export.cpp:180), while sceNpWebApiCreateContext returns LIB_CONTEXT_NOT_FOUND.

Negative control

The test cannot be built against main's headers, as found in the last review, so I mutated the production code instead. In Export.cpp, I made sceNpWebApiUnregisterExtdPushEventCallback return 0 instead of EXTD_PUSH_EVENT_CALLBACK_NOT_FOUND, then rebuilt. guest_np_web_api aborted on NpWebApi: unregister an extended callback that does not exist. I restored Export.cpp from the merged tree and rebuilt. The test passes again, and git status --porcelain is empty.

New findings

Blocking

None.

Non-blocking

  • The merge commit double-encoded the µ sign in the debt doc. In docs/dev/debt/libSceNpWebApi.md:71, "at most once per 1000 µs" became "1000 µs". At 30556bb48b the bytes are C2 B5; at 3c783ecec2 they are C3 82 C2 B5, which is UTF-8 read as Latin-1 and encoded again. The PR's diff against main changes this line only for that reason. It is unrelated to the PR and corrupts an entry that main wrote correctly. Fix: take main's version of line 71, so the PR's diff to this file is only the added entry.

Not verified

  • The PS4 Pro firmware 10.71 return values and the probe comparison. I have no console and no probe output.
  • The Windows build and tests. The author's Windows run on 30556bb48b is author-reported.
  • BunnyFl's PS5 13.42 null-callback measurement.
  • Behaviour with a title. I ran none.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5759590587 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9920#pullrequestreview-5759590587). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T21:16:37Z. **Review:** APPROVED --- # Re-checked — approved Commit `30556bb48b` removes the duplicate forward declaration of `sceNpWebApiCreateServicePushEventFilter`, and `public_headers` now passes on the merged tree. The later merge of `main` (`3c783ecec2`) garbled one character in the debt doc; that is non-blocking. ## What changed since my last review - `30556bb48b` deletes the in-file forward declaration in `Export.cpp`. `Export.cpp` gets the declaration from `include/Api.hpp`. - `3c783ecec2` merges `main` at `086c0686c8`. Commits `f6f6e77287` and `02dc3f2fd4` are unchanged. The six exports, the test section and the debt entry are the same as in the last review, apart from the encoding change below. - The description adds a "Refresh" note. The author reports that they did not run the linked runtime or `public_headers` tests on this merged head. Their earlier comment reports `guest_np_web_api`, `guest_np_web_api_initialize` and `public_headers` passing on `30556bb48b` (Windows, MinGW-w64 GCC 15.2). - Nobody has replied yet to BunnyFl's null-callback data point. ## What I ran - PR head: `3c783ecec230fa3a04bec38618b19f05fc6d39c7` - `main`: `086c0686c8adff3ee648fdbe34e0b0b647e1d511` - Merged tree: `ed864edb1f9e09d579949b02265fc461896179aa` (`--no-ff`, clean worktree), Release build with GCC 14.2.0 and Ninja, on Debian 13. ```sh git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...3c783ecec230fa3a04bec38618b19f05fc6d39c7 python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511 ctest --test-dir build -j8 --test-load 32 -R "^(guest_np_web_api|guest_np_web_api_initialize|public_headers)$" --output-on-failure # negative control: in Export.cpp, sceNpWebApiUnregisterExtdPushEventCallback returns 0 instead of 0x8055291D ninja -C build -j32 -l32 guest_np_web_api_tests ctest --test-dir build -R "^guest_np_web_api$" --output-on-failure # restore Export.cpp from ed864edb1f, rebuild, rerun, git status --porcelain (empty) git show <sha>:docs/dev/debt/libSceNpWebApi.md | grep -o "per 1000.\{0,6\}" | od -An -c # at 30556bb48b and 3c783ecec2 ``` | Check | Result | | - | - | | `git diff --check` | Pass | | `check_conventions.py` | Pass (`All conventions checks passed.`) | | Build (script) | Pass | | Selected tests (script, 817) | 814 passed, 2 expected skips, 1 known failure on `main` (`unwrap_self_…destination_directory_group`), 0 new failures | | `guest_np_web_api`, `guest_np_web_api_initialize`, `public_headers` | 3/3 pass. `public_headers` ran about 60 s on this machine, as it is also slow on `main`. | | Negative control | `guest_np_web_api` fails as expected | ## Previous findings - **Blocking: duplicate declaration fails `public_headers`.** Resolved. The only remaining mention of `sceNpWebApiCreateServicePushEventFilter` in `Export.cpp` is its definition (`Export.cpp:217`) plus the call at `Export.cpp:186`, and `public_headers` passes on the merged tree. - **Non-blocking: null callback in `sceNpWebApiRegisterExtdPushEventCallbackA`.** Still open. [`Export.cpp:322-330`](https://github.com/boykopovar/AnyPS5/blob/3c783ecec230fa3a04bec38618b19f05fc6d39c7/core/libs/prx/libSceNpWebApi/Export.cpp#L322-L330) still ignores `callback`. BunnyFl's PS5 13.42 result (`0x80552902` for a null callback, returned first) is neither handled in the code nor recorded in the debt entry. - **Non-blocking: the `0x7fff + 1` test row pins an unmeasured value.** No longer applies as written. Current `main` now returns `INVALID_LIB_CONTEXT_ID` for `libCtxId >= 0x8000` in `sceNpWebApiCreateContext` ([`Export.cpp:168`](https://github.com/boykopovar/AnyPS5/blob/3c783ecec230fa3a04bec38618b19f05fc6d39c7/core/libs/prx/libSceNpWebApi/Export.cpp#L168-L168)). The `0x8000` row in `GuestNpWebApi.cpp:270` therefore matches what the sibling export does. One difference remains, and the debt entry records it: for an unknown id below `0x8000`, `sceNpWebApiCreateContextA` returns `INVALID_LIB_CONTEXT_ID` ([`Export.cpp:180`](https://github.com/boykopovar/AnyPS5/blob/3c783ecec230fa3a04bec38618b19f05fc6d39c7/core/libs/prx/libSceNpWebApi/Export.cpp#L180-L180)), while `sceNpWebApiCreateContext` returns `LIB_CONTEXT_NOT_FOUND`. ## Negative control The test cannot be built against `main`'s headers, as found in the last review, so I mutated the production code instead. In `Export.cpp`, I made `sceNpWebApiUnregisterExtdPushEventCallback` return 0 instead of `EXTD_PUSH_EVENT_CALLBACK_NOT_FOUND`, then rebuilt. `guest_np_web_api` aborted on `NpWebApi: unregister an extended callback that does not exist`. I restored `Export.cpp` from the merged tree and rebuilt. The test passes again, and `git status --porcelain` is empty. ## New findings ### Blocking None. ### Non-blocking - **The merge commit double-encoded the µ sign in the debt doc.** In [`docs/dev/debt/libSceNpWebApi.md:71`](https://github.com/boykopovar/AnyPS5/blob/3c783ecec230fa3a04bec38618b19f05fc6d39c7/docs/dev/debt/libSceNpWebApi.md#L71-L71), "at most once per 1000 µs" became "1000 µs". At `30556bb48b` the bytes are `C2 B5`; at `3c783ecec2` they are `C3 82 C2 B5`, which is UTF-8 read as Latin-1 and encoded again. The PR's diff against `main` changes this line only for that reason. It is unrelated to the PR and corrupts an entry that `main` wrote correctly. Fix: take `main`'s version of line 71, so the PR's diff to this file is only the added entry. ## Not verified - The PS4 Pro firmware 10.71 return values and the probe comparison. I have no console and no probe output. - The Windows build and tests. The author's Windows run on `30556bb48b` is author-reported. - BunnyFl's PS5 13.42 null-callback measurement. - Behaviour with a title. I ran none. <!-- anyps5-bots job=3610 head=3c783ecec230fa3a04bec38618b19f05fc6d39c7 -->
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!9920
No description provided.