feat(libSceNKWebKit): implement PAL::SessionID generators #15911

Merged
gslashm merged 1 commit from upstream-pr/15911 into main 2026-11-04 23:43:36 +00:00
gslashm commented 2026-11-04 23:18:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gslashm on 2026-11-04T23:18:59Z.


What

Implements three libSceNKWebKit exports from Source/WebCore/PAL/pal/SessionID.cpp:33-56 at 80f77e94c6, with constants from SessionID.h:38-44:

  • PAL::SessionID::generatePersistentSessionID()
  • PAL::SessionID::generateEphemeralSessionID()
  • PAL::SessionID::enableGenerationProtection()

SessionID holds one uint64_t (SessionID.h:86) and has implicit copy operations, so it returns in rax. Once protection is enabled the generators throw instead of reproducing the RELEASE_ASSERT crash; this is in the debt file. ASSERT(isMainThread()) is not ported: ASSERT compiles to ((void)0) when ASSERT_ENABLED is 0 (Assertions.h:340), and PlatformEnable.h:64-70 sets that from NDEBUG; that the console build defines NDEBUG is inferred, not verified. Not compared with a console module.

tools/pr_overlap.py lists #13486 under the same exports. That PR is a relinker draft whose merge base predates the 8703 stubs, so its diff re-adds them, all still throwing; it implements none of these. On this head, no open PR adds the same files and no other PR shares an export; the 14 PRs the tool could not merge with main were compared separately and none shares an export or a new file, apart from #13486. Line conflicts are the debt count line (docs/dev/debt/libSceNKWebKit.md:36, 53 PRs), the lines the new debt entry occupies (:12-13, #15170, #15171, #15174, #15175, #15178, #15182, #15185) and the neighbouring stubs (Export.cpp:18331-18345, InventoryExports.hpp:1541-1544, #14918, #14919, #14920). Whichever merges later keeps both sides.

Tested

Windows 11 Pro, WinLibs GCC 15.2.0. No title and no console module. nkwebkit_palsessionid checks the first IDs and increments of both counters, their independence, and that both generators throw after protection is enabled. ctest -R nkwebkit: 13 of 13 pass. ctest -R public_headers: 65 of 65 pass. Whole suite, at the pre-rebase head: 16 of 4067 fail on an idle run, 26 of 4067 on a run alongside another heavy job; untouched main fails 18 of 4066. The failures are Windows environment errors (WinError 32 and 5 in temp cleanup, WinError 1314 creating symlinks), prx_thread_local_destructors on libkernel, which also fails on main, and once, on the busy run, agc_shader_disk_cache_large_file. No nkwebkit_* test fails. The rebase onto d63781e9ce changed no NKWebKit file and the focused tests and checks were rerun after it. tools/progress.py: 1312 of 11248, three more than main.

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:5163214031 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15911). Originally posted by [gslashm](https://github.com/gslashm) on 2026-11-04T23:18:59Z. --- ### What Implements three `libSceNKWebKit` exports from `Source/WebCore/PAL/pal/SessionID.cpp:33-56` at `80f77e94c6`, with constants from `SessionID.h:38-44`: - `PAL::SessionID::generatePersistentSessionID()` - `PAL::SessionID::generateEphemeralSessionID()` - `PAL::SessionID::enableGenerationProtection()` `SessionID` holds one `uint64_t` (`SessionID.h:86`) and has implicit copy operations, so it returns in `rax`. Once protection is enabled the generators throw instead of reproducing the `RELEASE_ASSERT` crash; this is in the debt file. `ASSERT(isMainThread())` is not ported: `ASSERT` compiles to `((void)0)` when `ASSERT_ENABLED` is 0 (`Assertions.h:340`), and `PlatformEnable.h:64-70` sets that from `NDEBUG`; that the console build defines `NDEBUG` is inferred, not verified. Not compared with a console module. `tools/pr_overlap.py` lists #13486 under the same exports. That PR is a relinker draft whose merge base predates the 8703 stubs, so its diff re-adds them, all still throwing; it implements none of these. On this head, no open PR adds the same files and no other PR shares an export; the 14 PRs the tool could not merge with `main` were compared separately and none shares an export or a new file, apart from #13486. Line conflicts are the debt count line (`docs/dev/debt/libSceNKWebKit.md:36`, 53 PRs), the lines the new debt entry occupies (`:12-13`, #15170, #15171, #15174, #15175, #15178, #15182, #15185) and the neighbouring stubs (`Export.cpp:18331-18345`, `InventoryExports.hpp:1541-1544`, #14918, #14919, #14920). Whichever merges later keeps both sides. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 11 Pro, WinLibs GCC 15.2.0. No title and no console module. `nkwebkit_palsessionid` checks the first IDs and increments of both counters, their independence, and that both generators throw after protection is enabled. `ctest -R nkwebkit`: 13 of 13 pass. `ctest -R public_headers`: 65 of 65 pass. Whole suite, at the pre-rebase head: 16 of 4067 fail on an idle run, 26 of 4067 on a run alongside another heavy job; untouched `main` fails 18 of 4066. The failures are Windows environment errors (`WinError 32` and `5` in temp cleanup, `WinError 1314` creating symlinks), `prx_thread_local_destructors` on `libkernel`, which also fails on `main`, and once, on the busy run, `agc_shader_disk_cache_large_file`. No `nkwebkit_*` test fails. The rebase onto `d63781e9ce` changed no NKWebKit file and the focused tests and checks were rerun after it. `tools/progress.py`: 1312 of 11248, three more than `main`. ### 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
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!15911
No description provided.