feat(libSceNKWebKit): forward the exports the 11.00 module aliases #13947
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13947"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by edubox on 2026-10-31T13:36:20Z.
What
275 exports have no body of their own in the PS5 11.00
libSceNKWebKit: the code at their address is ajmp rel32into another export of the same image. They are now defined insrc/ForwardExports.cppas an assembly tail jump (jmpto the target symbol), so every register reaches the target unchanged and the alias keeps whatever return type and arguments the target uses.The targets are:
operator new-family exports that forward toWTF::fastMalloc, 104operator delete-family exports that forward toWTF::fastFree, 2WKUserMediaPermissionRequest*DeviceUIDsthat forward toWKMutableArrayCreate, 2 to a WebCore::Region constructor and 1 toWebCore::MIMETypeRegistry::isSupportedImageMIMEType.Each alias was matched by recomputing its NID from the declared symbol and reading the jump at its 11.00 address, and I checked that the destination is another export of the same image. The behaviour is only as verified as the target's, and no prototype is claimed for either symbol.
docs/dev/debt/libSceNKWebKit.mddrops the 267 inventory rows that no longer throw (6,981 → 6,714 of the 8,703 listed declarations, 123 → 115 in the prototype-unknown group) and gains an entry with the measurement and that limit. Only 11.00 was measured.Tested
ctest -R 'nkwebkit|guest_nkwebkit': 9/9 passed, including the newnkwebkit_forwarding. It calls the 74 aliases whose target is a throwing stub and requires the stub to run (theNotImplementedcall counter advances by one, the call throws), and it exercisesoperator new,operator new[],operator delete,operator delete[], destructor,MIMETypeCache::operator new,InspectorHeapAgent::operator deleteand the twoWK*aliases.python3 tools/check_conventions.py --base origin/main: passed.python3 tools/pr_overlap.py --branch feat/nkwebkit-forward-exports --jobs 32:Export.cppand the debt inventory overlap textually with several open pull requests and none shares an export with this batch (checked their diffs), so the conflicts are in the stub list and the inventory table, not in behaviour.libSceNKWebKit(checked their relinker registries), so the 11.00 module is the only evidence.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T13:40:32Z.
Review: DISMISSED
Reviewed — changes requested
The 272 alias definitions do not match the category counts in the PR description and debt entry, which currently add up to more aliases than the source contains.
What I ran
Head
89469750098b377ca1788b56ab3eb38830c3d9b5; base73f4f7e06e4f210a8c6570e335fd654dc0a86134; stack preview was clean. Environment: Linux, Python 3.11.2, GCC 12.2.0.Results
Unedited conventions-check output
Unedited alias-count command output
Findings
Blocking
operator new/operator new[]aliases targetfastMalloc, then list 104 delete aliases, 16 destructor aliases, and 2 WK aliases. These figures total 318, whileForwardExports.cppcontains 272 aliases. Demangling the source gives 91 new/new[] names, 93 delete/delete[] names, 70 destructors, 16 other names, and 2 WK names; the target list has 91fastMalloc, 103fastFree, 2WKMutableArrayCreate, and 76 other targets. Please correct both descriptions and explain the 76 aliases to other targets so the documented tally matches the source.Non-blocking
Sources
89469750098b377ca1788b56ab3eb38830c3d9b5:ForwardExports.cpp.libSceNKWebKit.md.Not verified
To get this to a good state
Reconcile the PR description and debt-entry counts with the aliases and targets in
ForwardExports.cpp, including the 76 aliases whose targets are not the three listed implementations. I’ll rerun the same checks on the updated head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T14:59:51Z.
Review: DISMISSED
Re-checked — new head, changes requested
The updated head corrects the alias inventory, but its Windows forwarding test still calls guest-ABI exports through host-ABI declarations.
What I ran
Reviewed head
a2eae76e962cdf1ff22628b7e55db22a0080da31against base73f4f7e06e4f210a8c6570e335fd654dc0a86134; the current-base merge preview is clean. Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. No project build or local C++ tests were run.Results
pr_abi_audit.pyandpr_test_quality.pyfiles are not present there.Unedited precheck output
Findings
Blocking
tests/Forwarding.cppincludesVabiMacros.hppbut leaves the export declarations andExpectStubfunction-pointer type unannotated. The added allocator/free calls at lines 206–226 therefore use the Windows host calling convention to enter forwarding exports that use the guest ABI; on Windows x64, their arguments can be passed in the wrong registers. The repository definesAPS5_VABIassysv_abion Windows and uses it for function pointers that cross this boundary. ApplyAPS5_VABIto the guest-export declarations and the callback type (including the new allocation/free calls), then rerun the focused forwarding test on Windows.Non-blocking
Sources
VabiMacros.hppat the reviewed head defines the Windows guest ABI annotation.Forwarding.cppat the reviewed head shows the unannotated declarations and direct allocator/free calls.CondExecPatch.cpp.Not verified
To get this to a good state
Annotate the guest ABI declarations and callback type, then rerun the focused Windows forwarding test; I’ll recheck the same source and relevant checks on the new head.