feat(libSceNKWebKit): implement 40 jump-out stubs translated from the module #24000
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24000"
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-20T00:41:48Z.
What
Implements 40
libSceNKWebKitexports whose module body is a jump to another function of the module. All 40 throwNotImplementedonmaintoday. Stacked on #23758 (lifted wrappers), which is stacked on #23755 (lifted leaf functions); it reusessrc/LiftedAbi.hppandCallfrom them.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 #23758:ApplicationCacheStorage::setMaximumSize,Gigacage::free,fastFree,Color::operator=,TextStream::operator<<,aboutBlankURL,WTF::equal). They call it through its existing declaration inlibSceNKWebKit.hpp.std::invalid_argumentwhere the module would fault.The translator refuses loops, globals, stack locals, atomics, indirect calls and calls to unnamed internal functions. Stubs with several jump-outs are not included.
25 distinct callees, all declared in the existing export headers; this PR declares no callee. 7 are implemented today. 18 are still stubs, and 18 of these exports throw
NotImplementedfrom a callee until that callee is implemented. This is the same as the forwarded exports and #23758. The other 22 are fully working today (13 have no calls; 9 call implemented exports only).Exports that call still-stubbed exports:
WKBundleFrameGetJavaScriptContext:_ZN7WebCore16ScriptController13jsWindowProxyERNS_15DOMWrapperWorldE,_ZN7WebCore21mainThreadNormalWorldEvWKBundleFrameGetPendingUnloadCount:_ZNK7WebCore9DOMWindow27pendingUnloadEventListenersEvWKBundleFrameStopLoading:_ZN7WebCore11FrameLoader17stopForUserCancelEbWKBundleGarbageCollectJavaScriptObjects:_ZN7WebCore12GCController17garbageCollectNowEv,_ZN7WebCore12GCController9singletonEvWKBundleGarbageCollectJavaScriptObjectsOnAlternateThreadForDebugging:_ZN7WebCore12GCController43garbageCollectOnAlternateThreadForDebuggingEb,_ZN7WebCore12GCController9singletonEvWKBundlePageClearMainFrameName:_ZN7WebCore9FrameTree9clearNameEvWKBundlePageListenForLayoutMilestones:_ZN7WebCore4Page19addLayoutMilestonesEN3WTF9OptionSetINS_15LayoutMilestoneEEEWKBundlePageOverlayClear:_ZN7WebCore11PageOverlay5clearEvWKBundlePageResetTrackedRepaints:_ZN7WebCore9FrameView20resetTrackedRepaintsEvWKBundlePageSetTracksRepaints:_ZN7WebCore9FrameView17setTracksRepaintsEb_ZN7WebCore4Page31setRemoteInspectionNameOverrideERKN3WTF6StringE:_ZN3WTF10StringImpl7destroyEPS0_,_ZN9Inspector24RemoteControllableTarget6updateEv_ZN7WebCore8Settings23setUsesBackForwardCacheEb:_ZN7WebCore16BackForwardCache14pruneToSizeNowEjNS_13PruningReasonE,_ZN7WebCore16BackForwardCache9singletonEv_ZN7WebCore8Settings24setVisualViewportEnabledEb:_ZN7WebCore4Page30setNeedsRecalcStyleInAllFramesEv_ZN7WebCore8Settings27setLoadsImagesAutomaticallyEb:_ZN7WebCore9TimerBase5startEN3WTF7SecondsES2__ZN7WebCore8Settings32setAcceleratedCompositingEnabledEb:_ZN7WebCore4Page30setNeedsRecalcStyleInAllFramesEv_ZN7WebCore8Settings32setShouldAllowUserInstalledFontsEb:_ZN7WebCore4Page30setNeedsRecalcStyleInAllFramesEv_ZN7WebCore8Settings33setFontFallbackPrefersPictographsEb:_ZN7WebCore4Page30setNeedsRecalcStyleInAllFramesEv_ZN7WebCore8Settings41setAcceleratedCompositedAnimationsEnabledEb:_ZN7WebCore4Page30setNeedsRecalcStyleInAllFramesEvLeft out:
WKPageGetAllowsRemoteInspection(#23759) andSQLiteFileSystem::ensureDatabaseDirectoryExists(#23752), which open PRs implement; 351 other stubs whose jump target cannot be lifted (globals, loops, stack locals, several jump-outs or an unnamed callee).Debt: the fragment
docs/dev/debt/changes/feat-nkwebkit-lifted-jump-outs.mdadds the Functional entry and removes the 37 inventory rows that exist for these exports.Overlap: I diffed every open PR updated since the previous check (737) against
mainfor the 40 names. Apart from #23759 and #23752 (excluded above), none implements them.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. 40/40 pass 3000 trials each, with 0 mismatches and the same crash behaviour.Settings::setVisualViewportEnabled(0x1d8written as0x1e0) andSettings::setUsesBackForwardCache(0x1d0written as0x1d8).0x5a0000000000), recorded by running the module's bytes.In the repository, the new
nkwebkit_liftedjumpoutstest:-rdynamicso it interposes on the library's calls. It replays the 320 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_liftedjumpoutspasses. Negative control: changing one stored offset (WKBundleSetTabKeyCyclesThroughElementswrites at+0xdbinstead of+0xda) makes it abort with a digest mismatch.nkwebkitpass.tools/check_conventions.pyand the public-headers audit (test_public_headers.py --audit-only) pass.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-20T01:07:17Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
d5eff2e123:tools/check_conventions.pypassed.nkwebkit_liftedjumpouts_tests,nkwebkit_liftedleaffunctions_tests,nkwebkit_liftedwrappers_testsbuilt cleanly.nkwebkit_liftedjumpouts,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/LiftedJumpOuts.cpp,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-20T05:24:57Z.
Review: COMMENTED
Reviewed — comments
The prepared bundle and selected jump-out implementation were inspected, but the full changed code was not reviewed, so a formal approval or change request is not justified.
What I ran
Head:
d5eff2e123d42f8bcf35f195f97adf96bdb8b666. No commands or tests were run; the reported test results below are from the author’s description.Results
Negative control
Not run by this reviewer. The author reports that a changed offset caused the digest test to fail.
Findings
Blocking
None verified in the inspected portions.
Non-blocking
None.
Sources
Reviewed source:
core/libs/prx/libSceNKWebKit/src/LiftedAbi.hpp,core/libs/prx/libSceNKWebKit/src/LiftedJumpOuts.cpp,core/libs/prx/libSceNKWebKit/tests/LiftedJumpOuts.cpp,core/libs/prx/libSceNKWebKit/CMakeLists.txt,core/libs/prx/libSceNKWebKit/include/LiftedJumpOutsExports.hpp, andcore/libs/prx/libSceNKWebKit/include/Api.hpp. Also readreview/description.md,review/commits.md,review/manifest.json,review/README.md, and portions ofreview/diff.patch.Not verified
The remaining changed files and hunks were not read in full.
core/libs/prx/libSceNKWebKit/Export.cppwas excluded from the prepared folder because it was too large; the full file was not read through the repository reader. The other changed files, including the lifted leaf and wrapper implementations and tests, were only identified in the manifest and not reviewed. Windows behavior was not verified. The reported Linux checks were not independently run.To get this to a good state
Nothing is required. Optional: complete review of the unread changed files and verify the author-reported checks on this head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T14:47:00Z.
Review: COMMENTED
Reviewed — comments
The review is incomplete because most changed files and the reported checks were not independently verified.
What I ran
Inspected the prepared diff and selected files at head
5ee991f173538c7b3ce3590cbd1b8f5f14bf0f26. No commands or tests were run.Results
Findings
Blocking
None verified in the inspected portions.
Non-blocking
None.
Not verified
Read the prepared description, commits, manifest and diff, plus
CMakeLists.txt,LiftedAbi.hpp,LiftedJumpOuts.cpp, andtests/LiftedJumpOuts.cpp. Of 18 changed repository files, 4 were read directly;Export.cppwas excluded from the review folder as too large and was not read. The remaining 13 changed files were not read. Build and test results, the differential harness and mutation testing were not independently confirmed.To get this to a good state
Nothing is required. Optional: complete inspection of the remaining changed files and independently run the reported checks before relying on this review as a merge approval.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T20:25:00Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed jump-out implementation and the inspected tests show no verified blocking defect; the full review remains incomplete because the large changed
Export.cppwas not available through the pinned reader.What I ran
Read the prepared review packet for head
067a19dd96170805356ccc1839b7866ed029c78e; inspected the jump-out implementation, ABI helpers, test code, export declarations, and test wiring through the PR reader. No commands or tests were run in this review.Results
Export.cppunavailable through the pinned readerFindings
Blocking
None identified in the code inspected.
Non-blocking
None.
Not verified
Export.cppis listed as excluded because it is too large for the review folder; the reader did not provide it, so its changed implementations and wiring are not verified. Full text ofInventoryExports.hppandLegacyExports.hppwas not read. No tests were run; the Linux results and Windows limitation in the PR description are author-reported. No physical-console behavior was verified.Files read:
description.md,commits.md,manifest.json,diff.patch(selected ranges),CMakeLists.txt,LiftedAbi.hpp,LiftedJumpOuts.cpp,LiftedJumpOutsExports.hpp, andLiftedJumpOuts.cpptests. Excluded from full-text review:Export.cpp; the prepared packet also reports it as excluded by size. Other changed files were listed but not read in this targeted review.To get this to a good state
Nothing is required. Optional: make the changed
Export.cppranges available for review and run the reported tests on the exact head before relying on those claims.Pull request closed