feat(libSceNKWebKit): implement 87 branching leaf functions translated from the module #23757
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23757"
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:58:58Z.
What
Implements 87 more
libSceNKWebKitleaf functions, ones whose module body has forward conditional branches (null checks, flag tests, early returns). All 87 throwNotImplementedonmaintoday. Stacked on #23755 (it addssrc/LiftedAbi.hpp); only the last commit is new.Source and method are the same as #23755: the
libSceNKWebKit.sprxwith SHA-2563af992253665387feeb5df90ff27dff683e3aa270cc4d92a0535b46ab18fa20d, translated instruction by instruction. Each forwardjccbecomes anifaround the taken path, with the register and flag state copied on entry. A forwardjmpcontinues at its target, and everyretreturns that path's value. The return width is chosen across all paths. Backward branches (loops) are rejected, and those functions stay stubs.Left out:
JSFunction::sourceCodeandJSFunction::isHostFunctionNonInlinefollow a pointer only after clearing its low tag bit (and rax,-2). The test generator never builds tagged pointers, so that path was only ever exercised on garbage. A mutation of the mask went undetected, so I left both out rather than claim they were checked.JSDocument,JSElement,JSEventandJSNode::toWrappedreach their wrapped-pointer load only when the cell's JSType byte has one exact value (or range). Random memory rarely produces that, and a mutation of that load went undetected, so they are left out too.Debt: the fragment
docs/dev/debt/changes/feat-nkwebkit-lifted-branching-functions.mdadds the Functional entry and removes the 77 inventory rows.Overlap: I checked every open PR head that touches
libSceNKWebKit; none removes these stubs.How it was checked (offline)
Same differential harness as #23755 (the module's bytes against the C++ on randomized memory, with return value, all memory and fault parity compared): 1,500 trials per function, all 87 pass, 0 mismatches. The mutation results for both PRs are in #23755. Seeds are kept only when the digest is the same in 27 arena placements.
Tested
Linux Mint 22.3, GCC 13.3, Release:
nkwebkit_liftedbranchingfunctionstest replays 1,044 recorded seeds (12 per function) against digests recorded from the module's code, and checks that 74 functions throw on a null object. It contains no module code. Runtime 0.3 s.src/LiftedBranchingFunctions.cppmakes the test fail.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:13:22Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
1548201c46:tools/check_conventions.pypassed.nkwebkit_liftedbranchingfunctions_tests,nkwebkit_liftedleaffunctions_testsbuilt cleanly.nkwebkit_liftedbranchingfunctions,nkwebkit_liftedleaffunctions):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/LiftedBranchingFunctions.cpp,core/libs/prx/libSceNKWebKit/src/LiftedLeafFunctions.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-19T17:06:47Z.
Review: COMMENTED
Reviewed — no blocking findings
The sampled translated branch paths and supporting ABI helpers show no verified defect, but the full change was not reviewed, so a formal approval is not justified.
What I ran
1548201c46bcbab376eebada68af48131e4e9f58.Results
Findings
Blocking
None verified in the inspected ranges.
Non-blocking
None.
Not verified
The review was partial. Read:
review/description.md,review/commits.md,review/manifest.json, selected ranges ofreview/diff.patch, and selected ranges ofcore/libs/prx/libSceNKWebKit/src/LiftedAbi.hpp,core/libs/prx/libSceNKWebKit/tests/LiftedBranchingFunctions.cpp, andcore/libs/prx/libSceNKWebKit/include/LiftedBranchingFunctionsExports.hpp. The changed filescore/libs/prx/libSceNKWebKit/Export.cppandcore/libs/prx/libSceNKWebKit/include/InventoryExports.hppwere excluded from the review folder because they were too large. Other changed files and uninspected portions of read files were not reviewed. No build, test suite, negative control, Windows run, or physical console behavior was verified.To get this to a good state
Nothing is required. Optional: complete the source and test review and run the project checks before relying on this review as a merge decision.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T19:26:29Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
32d0478a0c:tools/check_conventions.pypassed.nkwebkit_liftedbranchingfunctions_tests,nkwebkit_liftedleaffunctions_testsbuilt cleanly.nkwebkit_liftedbranchingfunctions,nkwebkit_liftedleaffunctions):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/LiftedBranchingFunctions.cpp,core/libs/prx/libSceNKWebKit/src/LiftedLeafFunctions.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-19T19:55:37Z.
Review: COMMENTED
Reviewed — no blocking findings
This review covers head
32d0478a0cde7adc8b1933d5964480096cefb403; I found no verified blocking defect, but did not run the reported checks or read every changed file.What I ran
No commands or tests were run. I inspected the prepared diff and selected source and test ranges through
repo_read.py.Results
Findings
Blocking
None verified in the code inspected.
Non-blocking
None.
Sources
Not verified
The description reports 1,500 differential trials per function, recorded-seed tests, a negative control, the NKWebKit suite and convention checks; these were not run during this review. Windows behavior was also not verified. I read
description.md,commits.md,manifest.json, anddiff.patch; targeted ranges ofLiftedAbi.hpp,LiftedBranchingFunctions.cpp,LiftedBranchingFunctionsExports.hpp,tests/LiftedBranchingFunctions.cpp,Api.hpp,LegacyExports.hpp, andlibSceNKWebKit.hpp; and a section of the diff aroundExport.cpp. The full text ofExport.cppandInventoryExports.hppwas excluded from the review folder; I did not read their full text. I did not read all other changed files listed as reviewed in the manifest, including the leaf implementation, leaf tests, and debt documents.To get this to a good state
Nothing is required. Optional: run the reported checks on this head and review the remaining changed files before treating this as a complete approval.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T22:09:07Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed head is
bad30791d1651868f86e4c023cd2507a11d819f5; inspected code supports the described lifting, but this review did not run the reported checks and did not read every changed file.What I ran
Read the prepared description, commits, diff, manifest, and review-folder README. Read selected changed code and the test harness through
repo_read.py; no commands or tests were run. The PR description reports offline differential checks and Linux test results; those results were not independently verified.Results
Findings
Blocking
None identified in the selected code.
Non-blocking
None.
Not verified
The full text of
core/libs/prx/libSceNKWebKit/Export.cppandcore/libs/prx/libSceNKWebKit/include/InventoryExports.hppwas excluded as too large. The review folder lists all changed files, but only selected ranges of changed files were read; many changed lines and the full bodies ofLiftedBranchingFunctions.cpp,LiftedLeafFunctions.cpp, both test files, and debt documents were not inspected. Reported Linux tests, differential harness, negative control, convention check, build behavior, and Windows behavior were not run or confirmed. The files listed as reviewed in the manifest were not all read, so approval is not justified.To get this to a good state
Nothing is required. Optional: independently run the reported test and convention checks and review the remaining changed lines before relying on the translated functions.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T13:52:44Z.
Review: APPROVED
Reviewed — looks good
The implementations and declarations I inspected are consistent, and the review bundle and pinned source support merging; I did not run the project checks.
What I ran
b2e5c6a2d7e7005d210efb31f3bedcb4e1ee4512usingrepo_read.pytools.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
review/description.md,review/commits.md,review/manifest.json,review/diff.patch,core/libs/prx/libSceNKWebKit/src/LiftedBranchingFunctions.cpp,core/libs/prx/libSceNKWebKit/src/LiftedAbi.hpp,core/libs/prx/libSceNKWebKit/include/LiftedBranchingFunctionsExports.hpp,core/libs/prx/libSceNKWebKit/tests/LiftedBranchingFunctions.cpp, and selected ranges ofcore/libs/prx/libSceNKWebKit/Export.cpp.core/libs/prx/libSceNKWebKit/Export.cppwas excluded from the review bundle for size; only selected head ranges were read. Other changed files listed inreview/manifest.jsonwere not read in full.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T20:21:26Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
58d00c73ca479a667c792f3a518d2b703e21d8e8. No commands or tests were run; the Linux Mint/GCC test results in the PR description are author-reported. No merged-preview check was performed.Results
Findings
Blocking
None verified in the inspected code.
Non-blocking
Not verified
core/libs/prx/libSceNKWebKit/Export.cppis marked too large for the review folder. Its diff is present, but its full head text was not reviewed. Its changed portion removes stub definitions; detailed export registration and linkage behavior were not independently checked.LiftedBranchingFunctions.cpp,LiftedLeafFunctions.cpp, and both corresponding test files were not read line by line. Targeted portions and the relevant declarations were reviewed; the remainder is not verified.To get this to a good state
Nothing is required. Optional: retain or provide a reproducible differential-check procedure alongside the recorded digest replay.
Pull request closed