feat(libSceNKWebKit): implement WTF::Thread::yield #13744

Merged
SHOnnay merged 1 commit from upstream-pr/13744 into main 2026-10-31 23:54:26 +00:00
SHOnnay commented 2026-10-31 03:56:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SHOnnay on 2026-10-31T03:56:25Z.


What

WTF::Thread::yield threw NotImplemented; it now calls the existing _Thrd_yield_nid_postfix helper (std::this_thread::yield) and returns void, per the pinned upstream WebKit declaration. The debt entry records that this is source-guided, not console-measured, and that the PS5 build may differ.

pr_overlap.py failed closed on #13500 and #13515 because their shared files could not be compared automatically against the base. A manual comparison found neither changes this export; both retain its throwing stub.

Tested

macOS only. A temporary isolated fixture failed on the throwing stub (1/1 failed, WTF::Thread::yield threw: _ZN3WTF6Thread5yieldEv) and passed after the change on ARM64 (1/1 passed) and x86-64 under Rosetta (1/1 passed). It checked only that the call returned without fault, not that the OS switched threads. The fixture was subsequently removed because this library's existing tests are full-build guest tests. No automated test is included in this PR. The full-build guest tests on Linux and Windows were not run.

Temporary fixture commands (before its removal):

cmake -S core/libs/tests/nkwebkit_thread_yield -B build/nkwebkit-thread-yield -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build/nkwebkit-thread-yield
ctest --test-dir build/nkwebkit-thread-yield --output-on-failure
cmake -S core/libs/tests/nkwebkit_thread_yield -B build/nkwebkit-thread-yield-x86 -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=x86_64
cmake --build build/nkwebkit-thread-yield-x86
ctest --test-dir build/nkwebkit-thread-yield-x86 --output-on-failure

Validation:

$ python3 tools/check_conventions.py --base upstream/main
All conventions checks passed.
$ python3 core/libs/tests/test_public_headers.py --audit-only
393 libraries, 24536 exports: unique declarations and umbrella coverage verified
$ python3 tools/pr_overlap.py --branch feat-nkwebkit-thread-yield
Overlap check failed closed on #13500 and #13515; manually compared as described above.

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 (Codex)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5094296467 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13744). Originally posted by [SHOnnay](https://github.com/SHOnnay) on 2026-10-31T03:56:25Z. --- ### What WTF::Thread::yield threw `NotImplemented`; it now calls the existing `_Thrd_yield_nid_postfix` helper (`std::this_thread::yield`) and returns void, per the pinned upstream [WebKit declaration](https://github.com/WebKit/WebKit/blob/c55364d53f971f63a709976f168d932d558b8909/Source/WTF/wtf/Threading.h#L182). The debt entry records that this is source-guided, not console-measured, and that the PS5 build may differ. `pr_overlap.py` failed closed on #13500 and #13515 because their shared files could not be compared automatically against the base. A manual comparison found neither changes this export; both retain its throwing stub. ### Tested macOS only. A temporary isolated fixture failed on the throwing stub (1/1 failed, `WTF::Thread::yield threw: _ZN3WTF6Thread5yieldEv`) and passed after the change on ARM64 (1/1 passed) and x86-64 under Rosetta (1/1 passed). It checked only that the call returned without fault, not that the OS switched threads. The fixture was subsequently removed because this library's existing tests are full-build guest tests. No automated test is included in this PR. The full-build guest tests on Linux and Windows were not run. Temporary fixture commands (before its removal): ```sh cmake -S core/libs/tests/nkwebkit_thread_yield -B build/nkwebkit-thread-yield -G Ninja -DCMAKE_BUILD_TYPE=Release cmake --build build/nkwebkit-thread-yield ctest --test-dir build/nkwebkit-thread-yield --output-on-failure cmake -S core/libs/tests/nkwebkit_thread_yield -B build/nkwebkit-thread-yield-x86 -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=x86_64 cmake --build build/nkwebkit-thread-yield-x86 ctest --test-dir build/nkwebkit-thread-yield-x86 --output-on-failure ``` Validation: ```text $ python3 tools/check_conventions.py --base upstream/main All conventions checks passed. $ python3 core/libs/tests/test_public_headers.py --audit-only 393 libraries, 24536 exports: unique declarations and umbrella coverage verified $ python3 tools/pr_overlap.py --branch feat-nkwebkit-thread-yield Overlap check failed closed on #13500 and #13515; manually compared as described above. ``` <!-- 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. --> ### 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 --> none - [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 (Codex)
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!13744
No description provided.