feat(libSceNKWebKit): implement the WebKit C API objects, preferences, JavaScriptCore C API and WTF primitives #13500

Merged
PrivacyOnion merged 1 commit from upstream-pr/13500 into main 2026-10-31 11:18:50 +00:00
PrivacyOnion commented 2026-10-30 17:04:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-10-30T17:04:04Z.


What

Replaces 1137 of the 11235 libSceNKWebKit stubs with implementations that follow Sony's OSS WebKit for PS5 11.x (neonmodder123/PS5-WebKit-11.x@80f77e9), evaluated for the PlayStation build:

  • WebKit C API object model (WKRetain, WKRelease, WKGetTypeID, every *GetTypeID) and value types: WKString, WKURL stored strings, WKArray/WKMutableArray, WKDictionary/WKMutableDictionary, WKData, numbers, geometry, WKUserContentURLPattern parsing, WKCertificateInfo and WKErrorCopyWKErrorDomain.
  • WKPreferences* (398 exports) with the PlayStation defaults from UnifiedWebPreferences.yaml.
  • Configuration objects: WKContextConfiguration, WKPageConfiguration, WKWebsiteDataStoreConfiguration, WKWebsitePolicies, WKUserScript, WKUserContentController, WKCredential, WKGeolocationPosition, WKPageGroup.
  • JavaScriptCore C API (JS*, 129 exports) on QuickJS-NG, added as the 3rdparty/quickjs submodule (v0.17.0) and built from source; JSStringRef values are libSceJsc strings.
  • WebCore geometry, transform and inline Color values; WTF allocation, bmalloc, Gigacage, assertions, clocks and random values; WTF::String, StringImpl, StringView, CString and URL value operations with layouts pinned by static_assert.

Exports that need the WebKit engine, the WebCore URL parser or layouts that cannot be proven from the source stay NotImplemented_nid_no_patch. Gaps (QuickJS GC versus the conservative stack scan, unknown media preference defaults, host services, layouts verified on Windows only) are in docs/dev/debt/libSceNKWebKit.md, and the implemented names leave its export list.

Tested

Windows 11, MinGW GCC (WinLibs UCRT), Release. ctest -R nkwebkit runs six new suites (base, config, jsc, preferences, webcoregeometry, wtf); they passed 6/6 before this update. The suites cover round trips, defaults, null and empty cases, JSClass callbacks, exceptions, typed arrays, protect/unprotect across JSGarbageCollect, and string ownership through fastFree. Not tested with a title or on Linux.

This update rebases onto current main, keeping the DateParsing.cpp and CharactersToNumber.cpp exports and tests that landed there, and makes tryFastMalloc, tryFastZeroedMalloc, tryFastCalloc and tryFastRealloc take the hidden TryMallocReturnValue* result pointer first, as the Itanium ABI passes a type with a user-provided move constructor and destructor; tryFastAlignedMalloc still returns void*. tests/Wtf.cpp calls them with that signature and checks the returned pointer and the value stored through it on success and failure. python3 tools/check_conventions.py --base upstream/main and python3 core/libs/tests/test_public_headers.py --audit-only pass on this head; the C++ build and tests after this update are left to CI. The libSceJsc string exports that libSceNKWebKit calls (JSStringCreateWithCharacters, JSStringCreateWithUTF8CString, JSStringRetain, JSStringRelease, JSStringGetLength, JSStringGetCharactersPtr, JSStringGetMaximumUTF8CStringSize, JSStringGetUTF8CString) now carry the _nid_postfix suffix, so nid_patcher renames the imports in libSceNKWebKit.prx to the same NIDs as the exports and the Linux patched_libraries load resolves them; the NIDs are unchanged.

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:5088113892 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13500). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-10-30T17:04:04Z. --- ### What Replaces 1137 of the 11235 `libSceNKWebKit` stubs with implementations that follow Sony's OSS WebKit for PS5 11.x ([neonmodder123/PS5-WebKit-11.x@80f77e9](https://github.com/neonmodder123/PS5-WebKit-11.x/tree/80f77e94c63ee7202eec3d4b5b1a021dd89011ba)), evaluated for the PlayStation build: - WebKit C API object model (`WKRetain`, `WKRelease`, `WKGetTypeID`, every `*GetTypeID`) and value types: `WKString`, `WKURL` stored strings, `WKArray`/`WKMutableArray`, `WKDictionary`/`WKMutableDictionary`, `WKData`, numbers, geometry, `WKUserContentURLPattern` parsing, `WKCertificateInfo` and `WKErrorCopyWKErrorDomain`. - `WKPreferences*` (398 exports) with the PlayStation defaults from `UnifiedWebPreferences.yaml`. - Configuration objects: `WKContextConfiguration`, `WKPageConfiguration`, `WKWebsiteDataStoreConfiguration`, `WKWebsitePolicies`, `WKUserScript`, `WKUserContentController`, `WKCredential`, `WKGeolocationPosition`, `WKPageGroup`. - JavaScriptCore C API (`JS*`, 129 exports) on QuickJS-NG, added as the `3rdparty/quickjs` submodule (v0.17.0) and built from source; `JSStringRef` values are `libSceJsc` strings. - WebCore geometry, transform and inline `Color` values; WTF allocation, bmalloc, Gigacage, assertions, clocks and random values; `WTF::String`, `StringImpl`, `StringView`, `CString` and `URL` value operations with layouts pinned by `static_assert`. Exports that need the WebKit engine, the WebCore URL parser or layouts that cannot be proven from the source stay `NotImplemented_nid_no_patch`. Gaps (QuickJS GC versus the conservative stack scan, unknown media preference defaults, host services, layouts verified on Windows only) are in `docs/dev/debt/libSceNKWebKit.md`, and the implemented names leave its export list. ### Tested Windows 11, MinGW GCC (WinLibs UCRT), Release. `ctest -R nkwebkit` runs six new suites (base, config, jsc, preferences, webcoregeometry, wtf); they passed 6/6 before this update. The suites cover round trips, defaults, null and empty cases, JSClass callbacks, exceptions, typed arrays, protect/unprotect across `JSGarbageCollect`, and string ownership through `fastFree`. Not tested with a title or on Linux. This update rebases onto current `main`, keeping the `DateParsing.cpp` and `CharactersToNumber.cpp` exports and tests that landed there, and makes `tryFastMalloc`, `tryFastZeroedMalloc`, `tryFastCalloc` and `tryFastRealloc` take the hidden `TryMallocReturnValue*` result pointer first, as the Itanium ABI passes a type with a user-provided move constructor and destructor; `tryFastAlignedMalloc` still returns `void*`. `tests/Wtf.cpp` calls them with that signature and checks the returned pointer and the value stored through it on success and failure. `python3 tools/check_conventions.py --base upstream/main` and `python3 core/libs/tests/test_public_headers.py --audit-only` pass on this head; the C++ build and tests after this update are left to CI. The `libSceJsc` string exports that `libSceNKWebKit` calls (`JSStringCreateWithCharacters`, `JSStringCreateWithUTF8CString`, `JSStringRetain`, `JSStringRelease`, `JSStringGetLength`, `JSStringGetCharactersPtr`, `JSStringGetMaximumUTF8CStringSize`, `JSStringGetUTF8CString`) now carry the `_nid_postfix` suffix, so `nid_patcher` renames the imports in `libSceNKWebKit.prx` to the same NIDs as the exports and the Linux `patched_libraries` load resolves them; the NIDs are unchanged. ### 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
MarcZX10 commented 2026-10-30 17:15:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T17:15:05Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The exact-head public-header audit fails the repository rule, and the new allocator can wrap its allocation-size calculation for large requests.

What I ran

Reviewed head e4894c3c6da20f401a1842e606b2423728bb011c against base a026562629da7bcc7af781639a11ab0647a524dd. A current-base merge preview was clean. Environment: Linux x86-64, Debian 12, Python 3.11.2, GCC 12.2.0; no C++ compiler command was run.

git diff --check a026562629da7bcc7af781639a11ab0647a524dd...e4894c3c6da20f401a1842e606b2423728bb011c
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13500
python3 tools/pr_stack_check.py 13500 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13500-e4894c3c6da2/stack
python3 tools/pr_abi_audit.py --base a026562629da7bcc7af781639a11ab0647a524dd --head e4894c3c6da20f401a1842e606b2423728bb011c --json > /tmp/anyps5-review-13500/abi.json
git archive refs/review/pr-13500-current | tar -x -C /tmp/anyps5-review-13500/head
git archive refs/review/main-latest | tar -x -C /tmp/anyps5-review-13500/main
cp tools/pr_test_quality.py /tmp/anyps5-review-13500/head/tools/pr_test_quality.py
(cd /tmp/anyps5-review-13500/head && python3 core/libs/tests/test_public_headers.py --audit-only)
(cd /tmp/anyps5-review-13500/main && python3 core/libs/tests/test_public_headers.py --audit-only)
python3 /tmp/anyps5-review-13500/head/tools/pr_test_quality.py --root /tmp/anyps5-review-13500/head --json core/libs/prx/libSceNKWebKit/tests/Base.cpp core/libs/prx/libSceNKWebKit/tests/Config.cpp core/libs/prx/libSceNKWebKit/tests/Jsc.cpp core/libs/prx/libSceNKWebKit/tests/Preferences.cpp core/libs/prx/libSceNKWebKit/tests/WebCoreGeometry.cpp core/libs/prx/libSceNKWebKit/tests/Wtf.cpp
gh pr checks 13500 --repo boykopovar/AnyPS5

The public-header audit was run from an archive of the exact PR head and, for comparison, an archive of base a026562629da7bcc7af781639a11ab0647a524dd.

Results

Check Result
Diff check Passed; no output.
Conventions and PR template Passed.
Current-base merge preview Clean against a026562629da7bcc7af781639a11ab0647a524dd.
Public-header audit (--audit-only) Failed on the PR head with 749 declaration errors; base passed with 0.
ABI audit passed_with_warnings; lexical audit only, not ABI proof.
Test-quality heuristic Six possible-unregistered-test warnings; verified false positives because CMake registers tests using file(GLOB) and a loop.
Hosted checks All six checks were pending when checked.
C++ build/CTest Not run.
Unedited check output
All conventions checks passed.
374 libraries, 23669 exports: unique declarations and umbrella coverage verified
RuntimeError: JSStringGetMaximumUTF8CStringSize: expected exactly one header declaration; found 2: core/libs/prx/libSceJsc/include/Api.hpp:31, core/libs/prx/libSceNKWebKit/tests/Jsc.cpp:22
WKArrayAppendItem: expected exactly one header declaration; found 1: core/libs/prx/libSceNKWebKit/tests/Base.cpp:81
_ZN7bmalloc3api21commitAlignedPhysicalEPvmNS_8HeapKindE: expected exactly one header declaration; found 0:
conventions	pending	0
eligibility	pending	0
intake	pending	0
labels	pending	0
library-portability	pending	0
report	pending	0

Findings

Blocking

  • Public-export declarations fail the repository audit. On this head the audit reports 749 errors, while the same command passes on base. It finds duplicate JSString* declarations in tests/Jsc.cpp, test-only declarations for WKArray*, and missing header declarations for exported functions. The repository requires every exported APS5_VABI function to have exactly one declaration in a header reachable through the library umbrella and forbids duplicates in tests. Add the required declarations to the public headers and remove duplicate/test-local declarations until the exact-head audit passes.
  • Allocator size addition can wrap. Allocate and TryAllocate add size + alignment + sizeof(AllocationHeader) without checked arithmetic. For a request near SIZE_MAX, this can produce a small allocation while storing the original large size in the header. The zeroed wrappers then write the requested length; for example, fastCalloc(1, SIZE_MAX) passes its multiplication check and calls memset with that huge length after allocation. Check the additions before calling malloc; make the try path return nullptr and the non-try path follow its allocation-failure behavior. Add boundary coverage for the try and zeroed wrappers.

Non-blocking

  • tests/Wtf.cpp declares unused bmalloc prototypes with an extra size_t parameter for tryLargeZeroedMemalignVirtual, commitAlignedPhysical, and decommitAlignedPhysical. The pinned upstream WebKit declarations use (alignment, size, HeapKind) and (pointer, size, HeapKind) respectively. Correct or remove these declarations so the test file does not describe different symbols.

Sources

Not verified

  • I did not build the library or run its C++ tests. The author-reported Windows test results were not independently reproduced.
  • Linux, Windows, macOS and WebKit runtime behavior were not tested in this review. Hosted checks were still pending.
  • The aggregate precheck could not run its local-only ABI and test-quality helpers in its isolated snapshot; I ran those helpers separately against the exact head.

To get this to a good state

Fix the public-header audit errors and allocator overflow, then rerun the audit and relevant tests on the updated head. I’ll re-run the same checks against that head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5715965267 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13500#pullrequestreview-5715965267). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T17:15:05Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The exact-head public-header audit fails the repository rule, and the new allocator can wrap its allocation-size calculation for large requests. ## What I ran Reviewed head `e4894c3c6da20f401a1842e606b2423728bb011c` against base `a026562629da7bcc7af781639a11ab0647a524dd`. A current-base merge preview was clean. Environment: Linux x86-64, Debian 12, Python 3.11.2, GCC 12.2.0; no C++ compiler command was run. ```sh git diff --check a026562629da7bcc7af781639a11ab0647a524dd...e4894c3c6da20f401a1842e606b2423728bb011c python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13500 python3 tools/pr_stack_check.py 13500 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13500-e4894c3c6da2/stack python3 tools/pr_abi_audit.py --base a026562629da7bcc7af781639a11ab0647a524dd --head e4894c3c6da20f401a1842e606b2423728bb011c --json > /tmp/anyps5-review-13500/abi.json git archive refs/review/pr-13500-current | tar -x -C /tmp/anyps5-review-13500/head git archive refs/review/main-latest | tar -x -C /tmp/anyps5-review-13500/main cp tools/pr_test_quality.py /tmp/anyps5-review-13500/head/tools/pr_test_quality.py (cd /tmp/anyps5-review-13500/head && python3 core/libs/tests/test_public_headers.py --audit-only) (cd /tmp/anyps5-review-13500/main && python3 core/libs/tests/test_public_headers.py --audit-only) python3 /tmp/anyps5-review-13500/head/tools/pr_test_quality.py --root /tmp/anyps5-review-13500/head --json core/libs/prx/libSceNKWebKit/tests/Base.cpp core/libs/prx/libSceNKWebKit/tests/Config.cpp core/libs/prx/libSceNKWebKit/tests/Jsc.cpp core/libs/prx/libSceNKWebKit/tests/Preferences.cpp core/libs/prx/libSceNKWebKit/tests/WebCoreGeometry.cpp core/libs/prx/libSceNKWebKit/tests/Wtf.cpp gh pr checks 13500 --repo boykopovar/AnyPS5 ``` The public-header audit was run from an archive of the exact PR head and, for comparison, an archive of base `a026562629da7bcc7af781639a11ab0647a524dd`. ## Results | Check | Result | |---|---| | Diff check | Passed; no output. | | Conventions and PR template | Passed. | | Current-base merge preview | Clean against `a026562629da7bcc7af781639a11ab0647a524dd`. | | Public-header audit (`--audit-only`) | Failed on the PR head with 749 declaration errors; base passed with 0. | | ABI audit | `passed_with_warnings`; lexical audit only, not ABI proof. | | Test-quality heuristic | Six possible-unregistered-test warnings; verified false positives because CMake registers tests using `file(GLOB)` and a loop. | | Hosted checks | All six checks were pending when checked. | | C++ build/CTest | Not run. | <details><summary>Unedited check output</summary> ```text All conventions checks passed. ``` ```text 374 libraries, 23669 exports: unique declarations and umbrella coverage verified ``` ```text RuntimeError: JSStringGetMaximumUTF8CStringSize: expected exactly one header declaration; found 2: core/libs/prx/libSceJsc/include/Api.hpp:31, core/libs/prx/libSceNKWebKit/tests/Jsc.cpp:22 WKArrayAppendItem: expected exactly one header declaration; found 1: core/libs/prx/libSceNKWebKit/tests/Base.cpp:81 _ZN7bmalloc3api21commitAlignedPhysicalEPvmNS_8HeapKindE: expected exactly one header declaration; found 0: ``` ```text conventions pending 0 eligibility pending 0 intake pending 0 labels pending 0 library-portability pending 0 report pending 0 ``` </details> ## Findings ### Blocking - **Public-export declarations fail the repository audit.** On this head the audit reports 749 errors, while the same command passes on base. It finds duplicate `JSString*` declarations in `tests/Jsc.cpp`, test-only declarations for `WKArray*`, and missing header declarations for exported functions. The repository requires every exported `APS5_VABI` function to have exactly one declaration in a header reachable through the library umbrella and forbids duplicates in tests. Add the required declarations to the public headers and remove duplicate/test-local declarations until the exact-head audit passes. - **Allocator size addition can wrap.** `Allocate` and `TryAllocate` add `size + alignment + sizeof(AllocationHeader)` without checked arithmetic. For a request near `SIZE_MAX`, this can produce a small allocation while storing the original large size in the header. The zeroed wrappers then write the requested length; for example, `fastCalloc(1, SIZE_MAX)` passes its multiplication check and calls `memset` with that huge length after allocation. Check the additions before calling `malloc`; make the try path return `nullptr` and the non-try path follow its allocation-failure behavior. Add boundary coverage for the try and zeroed wrappers. ### Non-blocking - `tests/Wtf.cpp` declares unused bmalloc prototypes with an extra `size_t` parameter for `tryLargeZeroedMemalignVirtual`, `commitAlignedPhysical`, and `decommitAlignedPhysical`. The pinned upstream WebKit declarations use `(alignment, size, HeapKind)` and `(pointer, size, HeapKind)` respectively. Correct or remove these declarations so the test file does not describe different symbols. ## Sources - [Repository declaration rule at this PR head](https://github.com/boykopovar/AnyPS5/blob/e4894c3c6da20f401a1842e606b2423728bb011c/CONTRIBUTING.md#L6) - [Public-header audit implementation at the reviewed base](https://github.com/boykopovar/AnyPS5/blob/a026562629da7bcc7af781639a11ab0647a524dd/core/libs/tests/test_public_headers.py#L95-L152) - [Allocator arithmetic at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/e4894c3c6da20f401a1842e606b2423728bb011c/core/libs/prx/libSceNKWebKit/src/Bmalloc.cpp#L12-L49) - [Zeroed allocator wrappers at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/e4894c3c6da20f401a1842e606b2423728bb011c/core/libs/prx/libSceNKWebKit/src/WtfMemory.cpp#L26-L75) - [Pinned PS5 WebKit bmalloc declarations](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/bmalloc/bmalloc/bmalloc.h#L136-L164) ## Not verified - I did not build the library or run its C++ tests. The author-reported Windows test results were not independently reproduced. - Linux, Windows, macOS and WebKit runtime behavior were not tested in this review. Hosted checks were still pending. - The aggregate precheck could not run its local-only ABI and test-quality helpers in its isolated snapshot; I ran those helpers separately against the exact head. ## To get this to a good state Fix the public-header audit errors and allocator overflow, then rerun the audit and relevant tests on the updated head. I’ll re-run the same checks against that head.
MarcZX10 commented 2026-10-30 18:17:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T18:17:17Z.

Review: COMMENTED


Re-checked — new head, awaiting Windows CI

The updated head fixes the previously reported allocator-overflow and public-header declaration issues; I found no new source-level blocker, but the Windows build is still running.

What I ran

Reviewed head 0312a066453cff513919d9b5d15c04793e9e0fd1 against PR base a026562629da7bcc7af781639a11ab0647a524dd; its merge preview against that base was clean. Environment: Linux x86-64, Python 3.11.2, GCC 12.2.0.

git diff --check a026562629da7bcc7af781639a11ab0647a524dd...0312a066453cff513919d9b5d15c04793e9e0fd1
python3 core/libs/tests/test_public_headers.py --audit-only
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base refs/review/main-latest --head refs/review/13500-current --json
python3 tools/pr_test_quality.py --root /tmp/anyps5-13500-head.0g3Hl1 --json core/libs/prx/libSceNKWebKit/tests/Wtf.cpp core/libs/prx/libSceNKWebKit/tests/WebCoreGeometry.cpp
gh pr view 13500 --repo boykopovar/AnyPS5

Results

Check Result
Patch whitespace Passed; git diff --check exited 0 with no output.
Public-header source audit Passed: 374 libraries and 23,669 exports had unique declarations and umbrella coverage.
Export ABI lexical audit passed_with_warnings; 26 warnings are callback/type names in test sources reported as missing function declarations. This lexical helper does not establish binary ABI correctness.
Test-quality heuristic Two possible-registration warnings are false positives: CMake's tests/*.cpp glob registers both test files and creates CTest entries.
Hosted checks Eligibility, conventions, Emscripten library portability, labels, and report passed. Windows was still in progress. Relinker, relinker-ASan, register-context, write-watch, and Linux jobs were skipped.
Build or C++ tests run locally No; the initial review process prohibits building, and no existing exact-head binary was available.
Unedited output from focused checks
374 libraries, 23669 exports: unique declarations and umbrella coverage verified

The diff check exited 0 and emitted no output. The ABI audit summary was passed_with_warnings with 26 public-declaration-not-found findings, all names from test callback/type APIs. The test-quality helper emitted two possible-unregistered-cpp-test warnings; direct inspection confirmed the CMake glob and add_test registration.

Findings

Blocking

None identified in the updated source. The previously reported allocation-size overflow is guarded before allocation, and the exact-head public-header audit now passes.

Non-blocking

Approval is withheld until the hosted Windows job completes because this update changes public C++ declarations and allocator code. The Linux job was skipped, and I did not run local C++ build or runtime tests.

Sources

Not verified

No local C++ build, CTest run, Linux build/runtime, or console behavior was verified. Hosted Windows CI was incomplete at the final check snapshot.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5716745652 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13500#pullrequestreview-5716745652). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T18:17:17Z. **Review:** COMMENTED --- # Re-checked — new head, awaiting Windows CI The updated head fixes the previously reported allocator-overflow and public-header declaration issues; I found no new source-level blocker, but the Windows build is still running. ## What I ran Reviewed head `0312a066453cff513919d9b5d15c04793e9e0fd1` against PR base `a026562629da7bcc7af781639a11ab0647a524dd`; its merge preview against that base was clean. Environment: Linux x86-64, Python 3.11.2, GCC 12.2.0. ```sh git diff --check a026562629da7bcc7af781639a11ab0647a524dd...0312a066453cff513919d9b5d15c04793e9e0fd1 python3 core/libs/tests/test_public_headers.py --audit-only python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base refs/review/main-latest --head refs/review/13500-current --json python3 tools/pr_test_quality.py --root /tmp/anyps5-13500-head.0g3Hl1 --json core/libs/prx/libSceNKWebKit/tests/Wtf.cpp core/libs/prx/libSceNKWebKit/tests/WebCoreGeometry.cpp gh pr view 13500 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | |---|---| | Patch whitespace | Passed; `git diff --check` exited 0 with no output. | | Public-header source audit | Passed: 374 libraries and 23,669 exports had unique declarations and umbrella coverage. | | Export ABI lexical audit | `passed_with_warnings`; 26 warnings are callback/type names in test sources reported as missing function declarations. This lexical helper does not establish binary ABI correctness. | | Test-quality heuristic | Two possible-registration warnings are false positives: CMake's `tests/*.cpp` glob registers both test files and creates CTest entries. | | Hosted checks | Eligibility, conventions, Emscripten library portability, labels, and report passed. Windows was still in progress. Relinker, relinker-ASan, register-context, write-watch, and Linux jobs were skipped. | | Build or C++ tests run locally | No; the initial review process prohibits building, and no existing exact-head binary was available. | <details><summary>Unedited output from focused checks</summary> ```text 374 libraries, 23669 exports: unique declarations and umbrella coverage verified ``` The diff check exited 0 and emitted no output. The ABI audit summary was `passed_with_warnings` with 26 `public-declaration-not-found` findings, all names from test callback/type APIs. The test-quality helper emitted two `possible-unregistered-cpp-test` warnings; direct inspection confirmed the CMake glob and `add_test` registration. </details> ## Findings ### Blocking None identified in the updated source. The previously reported allocation-size overflow is guarded before allocation, and the exact-head public-header audit now passes. ### Non-blocking Approval is withheld until the hosted Windows job completes because this update changes public C++ declarations and allocator code. The Linux job was skipped, and I did not run local C++ build or runtime tests. ## Sources - [Updated allocator and overflow guards at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/0312a066453cff513919d9b5d15c04793e9e0fd1/core/libs/prx/libSceNKWebKit/src/Bmalloc.cpp) - [Public export declarations at the reviewed head](https://github.com/boykopovar/AnyPS5/tree/0312a066453cff513919d9b5d15c04793e9e0fd1/core/libs/prx/libSceNKWebKit/include) ## Not verified No local C++ build, CTest run, Linux build/runtime, or console behavior was verified. Hosted Windows CI was incomplete at the final check snapshot.
MarcZX10 commented 2026-10-30 18:24:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T18:24:54Z.

Review: APPROVED


Re-checked — new head, looks good

The public-header audit passes and the allocator boundary fix is in place; exact-head Windows CI and Emscripten portability checks passed. I approve head 0312a066453cff513919d9b5d15c04793e9e0fd1; Linux and specialized jobs were skipped, and I did not run a local build.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5716857770 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13500#pullrequestreview-5716857770). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T18:24:54Z. **Review:** APPROVED --- # Re-checked — new head, looks good The public-header audit passes and the allocator boundary fix is in place; exact-head Windows CI and Emscripten portability checks passed. I approve head `0312a066453cff513919d9b5d15c04793e9e0fd1`; Linux and specialized jobs were skipped, and I did not run a local build.
MarcZX10 commented 2026-10-30 19:15:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T19:15:09Z.

Review: CHANGES_REQUESTED


Re-checked — changes requested

The four tryFast* exports use the wrong return ABI: upstream returns TryMallocReturnValue, while this PR exposes void* under the same symbols.

What I ran

Reviewed exact head 0312a066453cff513919d9b5d15c04793e9e0fd1 against base a026562629da7bcc7af781639a11ab0647a524dd. Environment: Linux x86-64, GCC 12.2.0, Python 3.11.2. I did not build or compile the project.

git show 0312a066453cff513919d9b5d15c04793e9e0fd1:core/libs/prx/libSceNKWebKit/include/WtfExports.hpp
git show 0312a066453cff513919d9b5d15c04793e9e0fd1:core/libs/prx/libSceNKWebKit/src/WtfMemory.cpp
git show 0312a066453cff513919d9b5d15c04793e9e0fd1:core/libs/prx/libc/include/general/VabiMacros.hpp
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13500

Results

Check Result
Exact-head source comparison Blocking ABI mismatch confirmed by comparing all four exported definitions with the pinned WebKit declarations.
No-build precheck Diff, conventions, Python syntax, and test registration passed; ABI and test-quality helpers were unavailable in the isolated checkout. No project build ran.
Hosted checks Windows, conventions, eligibility, labels, report, and library portability passed at this head; Linux and specialized build jobs were skipped.
Unedited source output for the mismatched declarations
WTF_EXPORT_PRIVATE TryMallocReturnValue tryFastMalloc(size_t);
WTF_EXPORT_PRIVATE TryMallocReturnValue tryFastZeroedMalloc(size_t);
WTF_EXPORT_PRIVATE TryMallocReturnValue tryFastCalloc(size_t numElements, size_t elementSize);
WTF_EXPORT_PRIVATE TryMallocReturnValue tryFastRealloc(void*, size_t);
void* APS5_VABI _ZN3WTF13tryFastMallocEm(std::size_t size) {
void* APS5_VABI _ZN3WTF19tryFastZeroedMallocEm(std::size_t size) {
void* APS5_VABI _ZN3WTF13tryFastCallocEmm(std::size_t count, std::size_t size) {
void* APS5_VABI _ZN3WTF14tryFastReallocEPvm(void* ptr, std::size_t size) {

Findings

Blocking

  • The source implementation and declarations return void* for all four symbols, but the pinned WebKit interface returns TryMallocReturnValue, a non-trivial C++ type with a move constructor and destructor. With the PS5 SysV ABI, a non-trivial aggregate return uses an indirect result pointer; keeping the same mangled name does not make the void* prototype ABI-compatible. A WebKit caller can pass its result pointer in the hidden-return register and shift the explicit arguments, causing these implementations to interpret the wrong values and return an incompatible result. Implement the actual TryMallocReturnValue ABI (including its success/failure state), or leave these exports unimplemented until that ABI can be represented correctly.

Non-blocking

None identified in this follow-up.

Sources

Not verified

I did not compile a caller using the PS5 toolchain or run the WebKit runtime; the ABI defect is established from the pinned source interface, the PR prototypes, and the repository's APS5_VABI definition. Linux and specialized hosted jobs were skipped.

To get this to a good state

Correct these four exports to match TryMallocReturnValue's target ABI and add coverage for its success and failure results. I’ll re-run the same source and no-build checks on the new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5717510889 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13500#pullrequestreview-5717510889). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T19:15:09Z. **Review:** CHANGES_REQUESTED --- # Re-checked — changes requested The four `tryFast*` exports use the wrong return ABI: upstream returns `TryMallocReturnValue`, while this PR exposes `void*` under the same symbols. ## What I ran Reviewed exact head `0312a066453cff513919d9b5d15c04793e9e0fd1` against base `a026562629da7bcc7af781639a11ab0647a524dd`. Environment: Linux x86-64, GCC 12.2.0, Python 3.11.2. I did not build or compile the project. ```sh git show 0312a066453cff513919d9b5d15c04793e9e0fd1:core/libs/prx/libSceNKWebKit/include/WtfExports.hpp git show 0312a066453cff513919d9b5d15c04793e9e0fd1:core/libs/prx/libSceNKWebKit/src/WtfMemory.cpp git show 0312a066453cff513919d9b5d15c04793e9e0fd1:core/libs/prx/libc/include/general/VabiMacros.hpp python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13500 ``` ## Results | Check | Result | |---|---| | Exact-head source comparison | Blocking ABI mismatch confirmed by comparing all four exported definitions with the pinned WebKit declarations. | | No-build precheck | Diff, conventions, Python syntax, and test registration passed; ABI and test-quality helpers were unavailable in the isolated checkout. No project build ran. | | Hosted checks | Windows, conventions, eligibility, labels, report, and library portability passed at this head; Linux and specialized build jobs were skipped. | <details> <summary>Unedited source output for the mismatched declarations</summary> ```text WTF_EXPORT_PRIVATE TryMallocReturnValue tryFastMalloc(size_t); WTF_EXPORT_PRIVATE TryMallocReturnValue tryFastZeroedMalloc(size_t); WTF_EXPORT_PRIVATE TryMallocReturnValue tryFastCalloc(size_t numElements, size_t elementSize); WTF_EXPORT_PRIVATE TryMallocReturnValue tryFastRealloc(void*, size_t); ``` ```text void* APS5_VABI _ZN3WTF13tryFastMallocEm(std::size_t size) { void* APS5_VABI _ZN3WTF19tryFastZeroedMallocEm(std::size_t size) { void* APS5_VABI _ZN3WTF13tryFastCallocEmm(std::size_t count, std::size_t size) { void* APS5_VABI _ZN3WTF14tryFastReallocEPvm(void* ptr, std::size_t size) { ``` </details> ## Findings ### Blocking - The source implementation and declarations return `void*` for all four symbols, but the pinned WebKit interface returns `TryMallocReturnValue`, a non-trivial C++ type with a move constructor and destructor. With the PS5 SysV ABI, a non-trivial aggregate return uses an indirect result pointer; keeping the same mangled name does not make the `void*` prototype ABI-compatible. A WebKit caller can pass its result pointer in the hidden-return register and shift the explicit arguments, causing these implementations to interpret the wrong values and return an incompatible result. Implement the actual `TryMallocReturnValue` ABI (including its success/failure state), or leave these exports unimplemented until that ABI can be represented correctly. ### Non-blocking None identified in this follow-up. ## Sources - [Pinned WebKit `TryMallocReturnValue` type and four function declarations](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/FastMalloc.h#L77-L101) - [PR declarations at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/0312a066453cff513919d9b5d15c04793e9e0fd1/core/libs/prx/libSceNKWebKit/include/WtfExports.hpp#L73-L89) - [PR definitions at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/0312a066453cff513919d9b5d15c04793e9e0fd1/core/libs/prx/libSceNKWebKit/src/WtfMemory.cpp#L49-L75) - [`APS5_VABI` uses the SysV ABI on the PS5 host path](https://github.com/boykopovar/AnyPS5/blob/0312a066453cff513919d9b5d15c04793e9e0fd1/core/libs/prx/libc/include/general/VabiMacros.hpp#L4-L10) ## Not verified I did not compile a caller using the PS5 toolchain or run the WebKit runtime; the ABI defect is established from the pinned source interface, the PR prototypes, and the repository's `APS5_VABI` definition. Linux and specialized hosted jobs were skipped. ## To get this to a good state Correct these four exports to match `TryMallocReturnValue`'s target ABI and add coverage for its success and failure results. I’ll re-run the same source and no-build checks on the new head.
adriadam10 commented 2026-10-30 21:11:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-30T21:11:52Z.

Review: CHANGES_REQUESTED


Checked the head against the cited WebKit source; the earlier header and allocator-overflow points are fixed, and Windows CI is green. One blocking ABI problem remains, the one CodingBreadd and MarcZX10 raised:

  • tryFastMalloc, tryFastZeroedMalloc, tryFastCalloc and tryFastRealloc (include/WtfExports.hpp:73-89, src/WtfMemory.cpp:49-75) are declared as returning void*. In the followed source (Source/WTF/wtf/FastMalloc.h L98-101) they return TryMallocReturnValue, which has a user-provided move constructor and destructor (L77-86, L181-184). Under the Itanium C++ ABI that is returned in memory: the caller passes a hidden result pointer in rdi, the real arguments shift to rsi/rdx/rcx, and the callee returns that pointer in rax. With the current signatures a WTF caller's result pointer is read as the size and no result is ever written. Fix: take the hidden TryMallocReturnValue* first (storing the pointer through it, returning it), for all four, and keep the null-on-overflow behaviour.
  • tests/Wtf.cpp:44-68 calls the exports with the wrong signature, so it cannot catch this. Update it to the corrected signatures and check the value stored through the result pointer.
  • tryFastAlignedMalloc returns a plain void* in the source, so it stays as is.
  • Non-blocking, from the earlier review: the unused bmalloc prototypes in tests/Wtf.cpp (tryLargeZeroedMemalignVirtual, commitAlignedPhysical, decommitAlignedPhysical) have an extra size_t versus upstream's (alignment, size, HeapKind) / (pointer, size, HeapKind); fix or drop them.

Happy to re-check once pushed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5718697881 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13500#pullrequestreview-5718697881). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-30T21:11:52Z. **Review:** CHANGES_REQUESTED --- Checked the head against the cited WebKit source; the earlier header and allocator-overflow points are fixed, and Windows CI is green. One blocking ABI problem remains, the one CodingBreadd and MarcZX10 raised: - `tryFastMalloc`, `tryFastZeroedMalloc`, `tryFastCalloc` and `tryFastRealloc` (`include/WtfExports.hpp:73-89`, `src/WtfMemory.cpp:49-75`) are declared as returning `void*`. In the followed source (`Source/WTF/wtf/FastMalloc.h` L98-101) they return `TryMallocReturnValue`, which has a user-provided move constructor and destructor (L77-86, L181-184). Under the Itanium C++ ABI that is returned in memory: the caller passes a hidden result pointer in `rdi`, the real arguments shift to `rsi`/`rdx`/`rcx`, and the callee returns that pointer in `rax`. With the current signatures a WTF caller's result pointer is read as the size and no result is ever written. Fix: take the hidden `TryMallocReturnValue*` first (storing the pointer through it, returning it), for all four, and keep the null-on-overflow behaviour. - `tests/Wtf.cpp:44-68` calls the exports with the wrong signature, so it cannot catch this. Update it to the corrected signatures and check the value stored through the result pointer. - `tryFastAlignedMalloc` returns a plain `void*` in the source, so it stays as is. - Non-blocking, from the earlier review: the unused bmalloc prototypes in `tests/Wtf.cpp` (`tryLargeZeroedMemalignVirtual`, `commitAlignedPhysical`, `decommitAlignedPhysical`) have an extra `size_t` versus upstream's `(alignment, size, HeapKind)` / `(pointer, size, HeapKind)`; fix or drop them. Happy to re-check once pushed.
MarcZX10 commented 2026-10-31 09:34:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T09:34:24Z.

Review: APPROVED


Re-checked — new head, looks good

The hidden result-buffer implementation now matches the pinned WebKit TryMallocReturnValue ABI, and the exact-head Windows check passed.

What I ran

Reviewed head b7d83106ea189266c97bed91e25f91b25039d58c against PR base d8ffa97effa1ab0113dc265d936e94322045875d; the merge preview against current main c3c45d73abd34dca81da6bad87cb6d36ea437a66 was clean. Environment: Linux x86-64, Python 3.11.2. I did not run a local build.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13500
python3 tools/pr_stack_check.py 13500 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-13500-stack

The precheck's diff and conventions checks passed. Its ABI-audit and test-quality helper commands could not run because those helper files are absent from the isolated PR checkout; I treated them as unavailable, not as code failures. GitHub's windows and library-portability checks passed on this exact head; Linux and specialized jobs were skipped. The precheck did not build or run C++ tests.

Sources

The implementation and one-pointer result layout are in WtfMemory.cpp and WtfMemoryTypes.hpp; the pinned upstream declarations are in FastMalloc.h.

Not verified

No local build or Linux/specialized hosted job ran on this head. The Windows CI result is hosted evidence, not a local test run.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5722189823 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13500#pullrequestreview-5722189823). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T09:34:24Z. **Review:** APPROVED --- # Re-checked — new head, looks good The hidden result-buffer implementation now matches the pinned WebKit `TryMallocReturnValue` ABI, and the exact-head Windows check passed. ## What I ran Reviewed head `b7d83106ea189266c97bed91e25f91b25039d58c` against PR base `d8ffa97effa1ab0113dc265d936e94322045875d`; the merge preview against current `main` `c3c45d73abd34dca81da6bad87cb6d36ea437a66` was clean. Environment: Linux x86-64, Python 3.11.2. I did not run a local build. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13500 python3 tools/pr_stack_check.py 13500 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-13500-stack ``` The precheck's diff and conventions checks passed. Its ABI-audit and test-quality helper commands could not run because those helper files are absent from the isolated PR checkout; I treated them as unavailable, not as code failures. GitHub's `windows` and `library-portability` checks passed on this exact head; Linux and specialized jobs were skipped. The precheck did not build or run C++ tests. ## Sources The implementation and one-pointer result layout are in [WtfMemory.cpp](https://github.com/boykopovar/AnyPS5/blob/b7d83106ea189266c97bed91e25f91b25039d58c/core/libs/prx/libSceNKWebKit/src/WtfMemory.cpp#L49-L80) and [WtfMemoryTypes.hpp](https://github.com/boykopovar/AnyPS5/blob/b7d83106ea189266c97bed91e25f91b25039d58c/core/libs/prx/libSceNKWebKit/src/WtfMemoryTypes.hpp#L11-L15); the pinned upstream declarations are in [FastMalloc.h](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/FastMalloc.h#L1142-L1182). ## Not verified No local build or Linux/specialized hosted job ran on this head. The Windows CI result is hosted evidence, not a local test run.
adriadam10 commented 2026-10-31 10:04:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-31T10:04:37Z.

Review: CHANGES_REQUESTED


The full Build on this head fails on Linux (run 41189425926, job linux):

  • patched_libraries fails with libSceNKWebKit.prx: undefined symbol: JSStringGetLength. src/String.cpp:79 and src/JscContext.cpp:186 call libSceJsc functions (prx/libSceJsc/include/Api.hpp) through a plain link dependency (CMakeLists.txt:23, PUBLIC libSceJsc). After NID patching, libSceJsc.prx exports the NID names, and libSceNKWebKit.prx does not get its import renamed, so dlopen cannot resolve it. Windows loads it, which is why the Windows run was green.

Suggested direction: don't import libSceJsc symbols from libSceNKWebKit at load time. Share the JSString implementation through a static library or object sources linked into both, or go through helpers that don't need a cross-library symbol, and check that patched_libraries loads every .prx on Linux.

Everything else I checked on the previous review (the tryFast* ABI, headers, allocator overflow, submodule, debt file) is fine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5722279763 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13500#pullrequestreview-5722279763). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-31T10:04:37Z. **Review:** CHANGES_REQUESTED --- The full Build on this head fails on Linux (run 41189425926, job `linux`): - `patched_libraries` fails with `libSceNKWebKit.prx: undefined symbol: JSStringGetLength`. `src/String.cpp:79` and `src/JscContext.cpp:186` call `libSceJsc` functions (`prx/libSceJsc/include/Api.hpp`) through a plain link dependency (`CMakeLists.txt:23`, `PUBLIC libSceJsc`). After NID patching, `libSceJsc.prx` exports the NID names, and `libSceNKWebKit.prx` does not get its import renamed, so `dlopen` cannot resolve it. Windows loads it, which is why the Windows run was green. Suggested direction: don't import `libSceJsc` symbols from `libSceNKWebKit` at load time. Share the `JSString` implementation through a static library or object sources linked into both, or go through helpers that don't need a cross-library symbol, and check that `patched_libraries` loads every `.prx` on Linux. Everything else I checked on the previous review (the `tryFast*` ABI, headers, allocator overflow, submodule, debt file) is fine.
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!13500
No description provided.