feat(libSceNKWebKit): implement 93 call wrappers translated from the module #23758
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23758"
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 RiverWhy on 2026-11-19T15:59:02Z.
What
Implements 93
libSceNKWebKitexports whose module body has no branches and only calls other named exports, plus loads, stores and arithmetic through its arguments. All 93 throwNotImplementedonmaintoday. Stacked on #23755 (lifted leaf functions), whosesrc/LiftedAbi.hppthis reuses. It addsCall<R>for calls.Source: the
libSceNKWebKit.sprxwith SHA-2563af992253665387feeb5df90ff27dff683e3aa270cc4d92a0535b46ab18fa20d(the module the existing Constant-return exports debt entry reads as 11.00). Each body was translated instruction by instruction into C++, with the same translator as #23755 extended forcall,push/popand tail calls:std::invalid_argumentwhere the module would fault.The translator refuses loops, any branch, stack locals that escape into a call, and a scalar float live across a call.
81 distinct callees. 68 are still stubs, so 76 of these wrappers throw
NotImplementedfrom a callee until that callee is implemented. This is the same as the already accepted forwarded exports. 17 have all callees implemented today:CachePayload::makeEmptyPayload/makeMallocPayload,InlineWatchpointSet::inflateSlow,ExternalStringImpl::create(2),PasteboardImageC1/C2,CalculationValue::create,DeviceMotionData::create,CredentialStorage::getFromPersistentStorage,MutableStyleProperties::create,OpaqueJSString::string,MediaPlayer::contentMIMEType/contentTypeCodecs,FrameView::baseBackgroundColor,InspectorTargetAgent::connectionTypeandJSDestructibleObjectHeapCellTypeD0.Left out: 8
EmptyFrameLoaderClienterror factories claimed by #23737; 153 wrappers with branches; 34 with stack locals; 104 bodies that jump out to a named export.Debt: the fragment
docs/dev/debt/changes/feat-nkwebkit-lifted-wrappers.mdadds the Functional entry and removes the 74 inventory rows.Overlap: I fetched every open PR head that touches
libSceNKWebKit/Export.cpp(49) and diffed it againstmain. Apart from #23737 (excluded above), none removes these stubs.How it was checked
Offline, against the module's own code (none of it is in the repository):
rel32call patched to a recording mock, side by side with the C++, on randomized memory (arena, arguments and mock return values). The harness compares the call log (callee and six argument registers), the memory and the return value. 101/101 candidates pass 600 trials each, with 0 mismatches and the same crash behaviour.In the repository, the new
nkwebkit_liftedwrapperstest:-rdynamicso it interposes on the library's calls. It replays the 744 recorded seeds and compares digests. When not recording, a mock forwards to the real export throughdlsym(RTLD_NEXT). The CMake change is limited to this one test on Linux.Tested
Linux Mint 22.3, GCC 13.3, Release:
nkwebkit_liftedwrapperspasses. Negative control: changing one stored constant (CachePayload::makeEmptyPayloadwrites 2 instead of 1) makes it fail with a digest mismatch.nkwebkit_*tests pass.tools/check_conventions.pypasses.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 PrivacyOnion on 2026-11-19T16:10:08Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
beada4133f:tools/check_conventions.pypassed.nkwebkit_liftedleaffunctions_tests,nkwebkit_liftedwrappers_testsbuilt cleanly.nkwebkit_liftedleaffunctions,nkwebkit_liftedwrappers):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/Api.hpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/LiftedLeafFunctions.cpp,core/libs/prx/libSceNKWebKit/src/LiftedWrappers.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T16:29:44Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing in the inspected code blocks merge; the points below are optional.
What I ran
Reviewed head
beada4133fffe8b9c02c920c6a901672f02e7c12usingrepo_read.pyto inspect the prepared diff and selected files. No build or tests were run; test results below are author-reported.Results
Findings
Blocking
None in the inspected code.
Non-blocking
MAP_FIXED_NOREPLACEand aborts if the mapping fails. Consider reporting this as a skipped or unavailable test when that address is already occupied or unsupported. Seecore/libs/prx/libSceNKWebKit/tests/LiftedWrappers.cpp:1019.Not verified
The full text of
core/libs/prx/libSceNKWebKit/Export.cppandcore/libs/prx/libSceNKWebKit/include/InventoryExports.hppwas excluded because each file is too large for the review folder; their changed hunks were not fully inspected through the reader. The earlier leaf-function implementation and test are included in this PR but were not fully reviewed. No tests were executed. Linux Mint/GCC results and the differential harness results are author-reported. Windows behavior and console behavior were not verified.To get this to a good state
Nothing is required. Optional: make the fixed-address mapping failure produce a clear skip or diagnostic instead of an assertion.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T19:29:56Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
484e84be92:tools/check_conventions.pypassed.nkwebkit_liftedleaffunctions_tests,nkwebkit_liftedwrappers_testsbuilt cleanly.nkwebkit_liftedleaffunctions,nkwebkit_liftedwrappers):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/Api.hpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/LiftedLeafFunctions.cpp,core/libs/prx/libSceNKWebKit/src/LiftedWrappers.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T19:52:31Z.
Review: COMMENTED
Reviewed — comments
This review is incomplete, so a formal approval or change request is not justified.
What I ran
Reviewed head
484e84be92e002d69d9fbd5864a6c915270e9a17. I read the prepared description, commit list, manifest, diff, and selected ranges from the CMake file,Api.hpp,LiftedAbi.hpp,LiftedWrappers.cpp, and its test. I did not run commands or tests. The author reports Linux tests and convention checks passed; those results were not independently verified.Results
Findings
Blocking
None identified in the portions reviewed.
Non-blocking
None.
Not verified
The complete review is not verified: changed files not read include
Export.cpp,InventoryExports.hpp,LegacyExports.hpp, both lifted export headers,LiftedLeafFunctions.cpp,LiftedLeafFunctions.cpptests, and both debt change documents. Other than selected ranges,LiftedWrappers.cppand its tests were also not read in full.Export.cppandInventoryExports.hppwere excluded from the prepared folder for size; the remaining listed files were included but not read. No build, test, or convention command was run.To get this to a good state
Nothing is required. Optional: complete the review of the changed files and independently run the reported checks before making a formal decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T22:04:01Z.
Review: COMMENTED
Reviewed — comments
This review covers the wrapper implementation and selected test paths at head
2a6f7695cb4a59d34856729e2c310b8d28d500c6; the large export and inventory files were not fully inspected.What I ran
No commands were run. I read the prepared description, commits, manifest, diff, and selected changed files through the pinned PR reader. The reported Linux tests and convention check are author-reported and were not run for this review.
Results
Findings
Blocking
None verified in the code read.
Non-blocking
None.
Not verified
Full text of
core/libs/prx/libSceNKWebKit/Export.cppandcore/libs/prx/libSceNKWebKit/include/InventoryExports.hppwas excluded as oversized. The diff covers those files, but their complete contents and all changed declaration mappings were not audited. Most ofcore/libs/prx/libSceNKWebKit/tests/LiftedWrappers.cppandcore/libs/prx/libSceNKWebKit/src/LiftedWrappers.cppwas not read.LiftedLeafFunctions.cpp, its tests, generated export inventories, and debt documents were not read. No tests or builds were run; no behavior was checked on Windows or a console. Other changed paths are listed in the prepared manifest and file listing.To get this to a good state
Nothing is required. Optional: complete review of the excluded export inventories and implementation files, and independently run the reported test suite.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T13:51:03Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed head is
c1afa45d451af2ea4f9f6eb7bc9ca3f30b9d3ce2; the inspected wrapper ABI helper, Linux recording path, test setup, and changed export context showed no concrete defect. The author reports passing Linux tests, but I did not run them, and one changed file was excluded from the review bundle.What I ran
No commands or tests were run. I inspected the prepared patch and used
repo_read.pyto read targeted changed files and code at the pinned head. No merged preview was checked.Results
Negative control
Not run by me. The description reports that the author’s constant mutation caused the digest test to fail.
Findings
Blocking
None.
Non-blocking
None.
Sources
Behavior reviewed against the prepared diff and source at the pinned head
c1afa45d451af2ea4f9f6eb7bc9ca3f30b9d3ce2.Not verified
I read the PR description, commit list, patch, review manifest, and these changed files:
CMakeLists.txt,Api.hpp,InventoryExports.hpp,LegacyExports.hpp,LiftedLeafFunctionsExports.hpp,LiftedWrappersExports.hpp,libSceNKWebKit.hpp,LiftedAbi.hpp,LiftedLeafFunctions.cpp,LiftedWrappers.cpp,LiftedLeafFunctions.cpptest,LiftedWrappers.cpptest, and both debt change notes.Export.cppwas too large for the review bundle; I read only its affected region throughrepo_read.py. I did not read every added line in all included changed files, so completeness and uninspected wrapper translations are not verified. Tests, conventions, Windows behavior, and console behavior were not run or confirmed.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T20:17:01Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; optional points are listed below.
What I ran
Reviewed head
18ed8c8bbf050d17c120209078f8a8aa595c3b3fagainstmain. I read the prepared description, commits, diff, manifest, CMake configuration, ABI helpers, wrapper implementation, wrapper exports, and wrapper test source. I did not execute tests or build commands.Results
Findings
Blocking
None.
Non-blocking
Not verified
Export.cpp's full text was excluded from the review bundle; its changed hunks are visible in the prepared diff, but I did not read the file at the pinned head.LiftedLeafFunctions.cpp,LiftedLeafFunctionsExports.hpp,InventoryExports.hpp,LegacyExports.hpp, the leaf test source, and the debt change files were not read.LiftedWrappers.cppand its tests were only sampled, not read in full. Therefore I cannot approve: not every reviewed file was read, and the full change was not verified.To get this to a good state
Nothing is required. Optional: independently run the described Linux checks and review the unread changed files before relying on this assessment.
Pull request closed