feat(libSceNKWebKit): implement WTF PlayStation platform defaults #19322

Merged
B-Howell merged 2 commits from upstream-pr/19322 into main 2026-11-13 11:38:50 +00:00
B-Howell commented 2026-11-13 03:32:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by B-Howell on 2026-11-13T03:32:17Z.


What

Implements 9 existing throwing WTF stubs in libSceNKWebKit with the PlayStation build of PS5-WebKit 11.x at 80f77e9. PlatformPlayStation.cmake compiles playstation/OSAllocatorPlayStation.cpp, text/unix/TextBreakIteratorInternalICUUnix.cpp and the generic sources:

  • OSAllocator::hintMemoryNotNeededSoon(void*, size_t): does nothing (UNUSED_PARAM(address); UNUSED_PARAM(bytes);).
  • FileSystem::setMetadataURL: empty under !PLATFORM(MAC).
  • FileSystem::makeSafeToUseMemoryMapForPath: returns true under !PLATFORM(IOS_FAMILY).
  • FileSystem::createTemporaryZipArchive: returns { }, a null String, under !PLATFORM(COCOA).
  • bootSessionUUIDString: returns String() outside OS(DARWIN) (UUID.cpp:156-173).
  • currentSearchLocaleID / currentTextBreakLocaleID: return setlocale(LC_MESSAGES, nullptr) when it is non-null, otherwise "" and "en_us". They reuse the guest libc setlocale_nid_postfix with the FreeBSD LC_MESSAGES value 6.
  • Thread::setCurrentThreadIsUserInitiated / setCurrentThreadIsUserInteractive: do nothing without HAVE(QOS_CLASSES) (Cocoa only) or OS(LINUX) (Threading.cpp:396-421).

The declarations move from InventoryExports.hpp to a typed WtfPlatformDefaultsExports.hpp. String results return through sret, using the existing 8-byte WtfAbi::String with its static_assert layout. The debt count goes from 5950 to 5941. The debt file gets one entry: the repository libc only reports C, so the two fallbacks cannot be reached in tests.

tools/progress.py done delta: +9.

Tested

WSL2 Ubuntu, Release, Ninja, g++.

  • New nkwebkit_wtfplatformdefaults test. It covers null, empty and non-empty String arguments, unchanged argument refcounts, null sret results, and locale IDs equal to C. It calls both priority setters with 0, -1 and -15 and requires NotImplementedCalls_nid_no_patch() to stay the same.
  • Red control on main (the same test and header without the implementation): nkwebkit_wtfplatformdefaults (Subprocess aborted) with _ZN3WTF11OSAllocator23hintMemoryNotNeededSoonEPvm not implemented.
  • With this change: ctest -R "^nkwebkit_(noops|wtfplatformdefaults)$" passed 2/2 on each of 3 runs.
  • ctest -R "^public_headers": 100% passed, 65/65.
  • On a559a64ca81, an ordinary merge of main at 82160bba912 after #18538, conventions passed; doc-only conflict on the count line; count is main's stated 5949 minus this change's 9 removed stubs (5940). Main's code changes since the last merge are over 1,000 lines from this PR's hunks, so the earlier test results stand.

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

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5289469173 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19322). Originally posted by [B-Howell](https://github.com/B-Howell) on 2026-11-13T03:32:17Z. --- ### What Implements 9 existing throwing `WTF` stubs in libSceNKWebKit with the PlayStation build of [PS5-WebKit 11.x at 80f77e9](https://github.com/neonmodder123/PS5-WebKit-11.x/tree/80f77e94c63ee7202eec3d4b5b1a021dd89011ba). `PlatformPlayStation.cmake` compiles `playstation/OSAllocatorPlayStation.cpp`, `text/unix/TextBreakIteratorInternalICUUnix.cpp` and the generic sources: - `OSAllocator::hintMemoryNotNeededSoon(void*, size_t)`: does nothing (`UNUSED_PARAM(address); UNUSED_PARAM(bytes);`). - `FileSystem::setMetadataURL`: empty under `!PLATFORM(MAC)`. - `FileSystem::makeSafeToUseMemoryMapForPath`: returns `true` under `!PLATFORM(IOS_FAMILY)`. - `FileSystem::createTemporaryZipArchive`: returns `{ }`, a null `String`, under `!PLATFORM(COCOA)`. - `bootSessionUUIDString`: returns `String()` outside `OS(DARWIN)` (UUID.cpp:156-173). - `currentSearchLocaleID` / `currentTextBreakLocaleID`: return `setlocale(LC_MESSAGES, nullptr)` when it is non-null, otherwise `""` and `"en_us"`. They reuse the guest libc `setlocale_nid_postfix` with the FreeBSD `LC_MESSAGES` value 6. - `Thread::setCurrentThreadIsUserInitiated` / `setCurrentThreadIsUserInteractive`: do nothing without `HAVE(QOS_CLASSES)` (Cocoa only) or `OS(LINUX)` (Threading.cpp:396-421). The declarations move from `InventoryExports.hpp` to a typed `WtfPlatformDefaultsExports.hpp`. `String` results return through sret, using the existing 8-byte `WtfAbi::String` with its `static_assert` layout. The debt count goes from 5950 to 5941. The debt file gets one entry: the repository libc only reports `C`, so the two fallbacks cannot be reached in tests. `tools/progress.py` done delta: +9. ### Tested WSL2 Ubuntu, Release, Ninja, g++. - New `nkwebkit_wtfplatformdefaults` test. It covers null, empty and non-empty `String` arguments, unchanged argument refcounts, null sret results, and locale IDs equal to `C`. It calls both priority setters with 0, -1 and -15 and requires `NotImplementedCalls_nid_no_patch()` to stay the same. - Red control on `main` (the same test and header without the implementation): `nkwebkit_wtfplatformdefaults (Subprocess aborted)` with `_ZN3WTF11OSAllocator23hintMemoryNotNeededSoonEPvm not implemented`. - With this change: `ctest -R "^nkwebkit_(noops|wtfplatformdefaults)$"` passed 2/2 on each of 3 runs. - `ctest -R "^public_headers"`: 100% passed, 65/65. - On `a559a64ca81`, an ordinary merge of `main` at `82160bba912` after #18538, conventions passed; doc-only conflict on the count line; count is main's stated 5949 minus this change's 9 removed stubs (5940). Main's code changes since the last merge are over 1,000 lines from this PR's hunks, so the earlier test results stand. ### 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 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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!19322
No description provided.