feat(libSceNKWebKit): implement the exports the 11.00 module leaves empty #13930
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13930"
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:05:29Z.
What
357 exports that
Export.cppdeclared as throwing stubs do nothing in the PS5 11.00libSceNKWebKit: at each export address the code in the firmware image is a singleret, so the console ignores the call.retwrites no return register, so a zero result would be this library's invention, not the module's behaviour. The batch is split:voidcontract and are empty functions insrc/NoOpExports.cpp: 113 destructors and 2 constructors (the Itanium C++ ABI fixes their return type) and 39 functions the current WebKit public C API headers declarevoid, includingWKIconDatabaseEnableDatabaseCleanup.The set was built by recomputing each declared symbol's NID, looking it up in the 11.00 dynamic symbol table and keeping only entries whose body is exactly
ret(all 357 checked byte by byte). The declarations live once ininclude/NoOpExports.hpp, which the umbrella header reaches.docs/dev/debt/libSceNKWebKit.mddrops the 153 inventory rows that no longer throw (7,366 → 7,213 of the 8,703 listed declarations; the prototype-unknown group stays at 126) and gains an entry with the measurement and the void/unknown split. Only 11.00 was measured; other module versions and the true prototypes stay unverified.The reproducibility material is in https://gist.github.com/edubox/323bbb1210275d600736ac2c1dff8f16: the extraction/check script, the module SHA-256
3af992253665387feeb5df90ff27dff683e3aa270cc4d92a0535b46ab18fa20dand one row per export with name, NID, vaddr, file offset, size, bytes and verdict.Review evidence
Across the 30 dumped titles' relinker registries, zero reference
libSceNKWebKit(rg -l libSceNKWebKit registries/*.registry.jsonreturns nothing), so no title ID or title log line exists for these exports. "Unblocks: none" is accurate.The 11.00 module is the only revision available here; no other module version was supplied or found, so the bare-
retbodies (including the 113 destructors) are verified only against that image, with one row per export in the gist. Whether an export-only change like this should be kept or closed is a maintainer decision; this PR does not claim a title and has not been closed.Tested
main5cb015caaa:ctest -R 'nkwebkit|guest_nkwebkit'10/10 passed, including the newnkwebkit_noops. It calls the 154 void exports through the public header and checks that they add noNotImplementedcalls.python3 tools/check_conventions.py --base origin/main: passed.python3 tools/pr_overlap.py --branch feat/nkwebkit-no-op-exports --jobs 32: #13515, #13744, #13766, #13770 and #13772 shareExport.cppand the debt file textually, so the comparison could not complete; I read their diffs and none of them implements any of these 357 exports (they add 6 other exports). Merge conflicts are expected inExport.cppand the debt inventory, and both sets must survive whichever lands second.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 CnRJay on 2026-11-01T19:51:04Z.
Review: COMMENTED
The method (recomputing the NIDs and keeping only entries whose 11.00 body is exactly
ret) is sound, and keeping the 177 unknown-prototype exports throwing is the right call. Two things stand:357 exports moved from throw to silent return is a large behavioural change for any caller. Say which of them a title imports, or state that none is known.
The no-op set was measured on 11.00 only and the PR says other module versions are unverified. Say what happens on the other revisions that ship the library.
Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T09:29:15Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The PR merges and builds cleanly, the new
nkwebkit_noopstest passes, and it fails when the 180 bodies throw as they did onmain. However, 26 of the 65 C API exports the PR declaresvoid(it says "the current WebKit C API headers declarevoid") actually return a value, so they belong in the group that keeps throwing.What I ran
Head
16bbbb24faad0a1a019aa5c7b1d8de5dff43af9d,main4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree00c2720cd6f55fc562ad477280bde0fbe54cc682.(The build tree had to be regenerated for the negative control because the controls change the file set that the source globs pick up. The sandbox stopped CMake from rewriting configure outputs owned by another user, so I replaced those generated files with copies that keep their timestamps, then reran
cmake. No source file was involved.)Results
git diff --checkcheck_conventions.pymain(unwrap_self_..._destination_directory_group), unrelatedctest -R nkwebkitnkwebkit_noops0.01 s)ctest -R public_headersnkwebkit_noopsfails (Subprocess aborted)nkwebkit_noopspasses,git status --porcelainemptyNegative control 2 output
Negative control
Export.cpp,include/Api.hpp,include/InventoryExports.hppandlibSceNKWebKit.hppfrommainand moved the two new production files aside.nkwebkit_noops_teststhen fails to build:fatal error: prx/libSceNKWebKit/include/NoOpExports.hpp: No such file or directory.src/NoOpExports.cppcallNotImplemented_nid_no_patch(__func__), which is whatmaindoes for these exports. The test aborts. So the test does detect the change.Afterwards I restored the merged files, rebuilt, and the test passed again with a clean
git status.Findings
Blocking
26 exports with non-
voidreturn types are declared and implemented asvoid. Seecore/libs/prx/libSceNKWebKit/include/NoOpExports.hpp:11-12andcore/libs/prx/libSceNKWebKit/include/NoOpExports.hpp:44-67, plus the matching bodies insrc/NoOpExports.cpp. In WebKit's public C API (WKRenderLayer.h,WKRenderObject.h, andWKBundlePagePrivate.hfor the twoWKBundlePageones), these functions return a value:WKBundlePageCopyRenderTreereturnsWKRenderObjectRef.WKBundlePageCopyRenderLayerTreereturnsWKRenderLayerRef.WKRenderLayerGetRendererandWKRenderLayerGetFrameContentsLayerreturn object refs.WKRenderLayerCopyRendererName,CopyElementTagName,CopyElementIDand theWKRenderObjectCopy*functions returnWKStringRef.GetElementClassNames, the threeGet*ZOrderList/GetNormalFlowListfunctions andWKRenderObjectGetChildrenreturnWKArrayRef.WKRenderLayerIsClipping,IsClippedandIsReflectionreturnbool.WKRenderLayerGetCompositingLayerTypereturns an enum.WKRenderLayerGetBackingStoreMemoryEstimatereturnsdouble.WKRenderLayerGetAbsoluteBoundsandWKRenderObjectGetFrameRectreturnWKRect.WKRenderObjectGetAbsolutePositionreturnsWKPoint.WKRenderObjectGetTextLengthreturnsunsigned.The names alone say as much: under WebKit's Create/Copy rule,
Copy*returns a new object, and anIs*predicate cannot bevoid.This contradicts the classification stated in the PR and in the new debt entry (
docs/dev/debt/libSceNKWebKit.md:17): "65 the current WebKit C API headers declarevoid". By the PR's own reasoning ("retwrites no return register … returning zero would be this library's choice"), these exports have a known non-voidcontract and an unmeasured return value. With an emptyvoidbody, a guest caller reads whatever happens to be in RAX/XMM0, and in theWKRectcase relies on a returned sret pointer that is never set. The caller gets a garbage pointer or flag instead of a clearNotImplementedstop. That breaks the rule "every function either does exactly what it is supposed to or throws".Suggested fix: move these 26 back to throwing stubs (to
Export.cpp/Api.hppand the inventory table, as onmain). Update the counts in the debt entry and the description (39 C APIvoid+ 115 ctor/dtor = 154 empty functions; 203 throwing). Then re-check the remaining 39 C API names against the headers.Non-blocking
nkwebkit_noops"checks that the 177 unresolved exports still throw".tests/NoOps.cpp:19-201only calls the 180 empty functions and checks that the not-implemented counter is unchanged (line 20 and line 201). None of the 177 is called. Either correct the description or drop the claim.Export.cpp". The diff removes 180 definitions (540 lines = 180 × 3); the other 177 were never touched. The description's split is right, but the "357 … removed" phrasing is not.Export.cpp. Each removed stub leaves a double blank line: 182 such runs after the merge, against 2 onmain.git diff --checkand the conventions check accept this, but removing the separator line with each stub would keep the file uniform.Not verified
retbodies, NIDs and the module SHA-256 come from the author's gist and the 11.00 image, which I do not have. I did not re-measure them.libSceNKWebKitaccording to the author, so I saw no runtime behaviour in a game, and none was launched.To get this to a good state
voidC API exports listed above back toNotImplemented_nid_no_patchstubs and restore their inventory rows.docs/dev/debt/libSceNKWebKit.md, the commit message and the PR description.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T11:04:24Z.
Review: CHANGES_REQUESTED
Re-checked — changes still requested
Commit
fb551aab85moves the 26 value-returning WebKit C API exports back toNotImplemented_nid_no_patchstubs, which resolves the previous blocking finding. Butdocs/dev/debt/libSceNKWebKit.mdstill has none of their 26 inventory rows and still gives the throwing count as 7258.What changed since my last review
fb551aab85"fix(libSceNKWebKit): keep value-returning C API exports throwing". The first commit16bbbb24fais unchanged.include/NoOpExports.hpp,src/NoOpExports.cppandtests/NoOps.cpp.int APS5_VABI X() { NotImplemented_nid_no_patch(__func__); }at the end ofExport.cpp, with their declarations appended toinclude/InventoryExports.hpp. This is the same form as onmain.nkwebkit_noopsonly checks the 154voidexports. It also states "drops the 153 inventory rows … (7,437 → 7,284)".ctest -R nkwebkit12/12,public_headers65/65 and a passing conventions check.What I ran
Head
fb551aab854c873a566006cfb3eee856b0009c53,main4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree25bc84630b1694cb72ab4e9dcb2233acb2163918.git diff --checkcheck_conventions.pymain(unwrap_self_..._destination_directory_group), unrelatedctest -R nkwebkitnkwebkit_noops0.01 s)ctest -R public_headersnkwebkit_noopsfails (Subprocess aborted)nkwebkit_noopspasses;git status --porcelainemptyPrevious findings
voidC API exports declaredvoid: Resolved.fb551aab85removes exactly the 26 names fromNoOpExports.hpp,NoOpExports.cppandNoOps.cpp. It adds 26 throwing definitions toExport.cppand 26 declarations toInventoryExports.hpp, in the same form as onmain(e.g.WKRenderLayerIsClipping). I re-read the remaining 39 C API names (WKContext*Set*,WKIconDatabase*,WKCookieManager*,WKContextGetStatistics*,WKWebsiteDataStore*and similar). None has a Copy/Get-value/Is name that would imply a return value. The 39/154/203 counts in the debt entry match the code (154 empty definitions insrc/NoOpExports.cpp).NotImplementedcalls, which is whattests/NoOps.cppdoes.16bbbb24fa) still says "180 … 65 functions … The other 177 keep throwing", which is now wrong. Squash or reword it so the history matches the final 154/203 split.Export.cpp: Still open. There are still 182 runs of two consecutive blank lines in the mergedExport.cpp.New findings
Blocking
docs/dev/debt/libSceNKWebKit.md:37still says "7258 of the 8703 inventory declarations listed below throw". The PR still removes 179 rows from the inventory table, including all 26 namesfb551aab85put back as throwing stubs: none of the 26 has a row in the merged file. For example,WKRenderLayerIsClippingis atdocs/dev/debt/libSceNKWebKit.md:725onmainand absent after the merge, and the same holds forWKBundlePageCopyRenderTree. The PR description claims the opposite: "drops the 153 inventory rows … (7,437 → 7,284)". The debt file is where the project records what throws (CONTRIBUTING: a PR that closes a gap "cuts it to what is still open"), so 26 throwing exports now go unlisted and the count is wrong. Fix: restore the 26| name | NID |rows frommainand change 7258 to 7284. That is 7437 − 153, since one of the 154 implemented exports had no inventory row.Non-blocking
None.
Not verified
voidcontracts of the remaining 39 come from the author, backed only by my reading of their names.retbodies, NIDs or the module SHA-256 (the author's gist and the 11.00 image). No title importslibSceNKWebKit, so I saw no runtime behaviour, and I launched no game.To get this to a good state
docs/dev/debt/libSceNKWebKit.mdand set the count on line 37 to 7284, matching the description.Export.cpp.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T12:20:07Z.
Review: APPROVED
Re-checked — approved
Commit
8fed98c69fputs the 26 inventory rows for the value-returning C API exports back in the debt file and changes the throwing count to 7284. The inventory now matches the code, and that was the last blocking finding.What changed since my last review
8fed98c69f"docs(libSceNKWebKit): keep the 26 throwing exports in the inventory". It changes onlydocs/dev/debt/libSceNKWebKit.md(+27 −1):WKBundlePageCopyRender*rows and 24WKRenderLayer*/WKRenderObject*rows.16bbbb24faandfb551aab85are unchanged (range-diff=).ctest -R nkwebkit12/12 and a passing conventions check.What I ran
Head
8fed98c69f669fdc9d60c559273faf78fbfa3308,main4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree85f5b9a961b03616c79c54dab995f533af621bf9.git diff --checkcheck_conventions.pymain(unwrap_self_..._destination_directory_group), unrelatedctest -R nkwebkitsrc/NoOpExports.cppThe merged inventory has no row that differs from
main, so the 26 restored rows have the same NIDs as onmain.Negative control
The new commit changes only documentation and does not touch
tests/NoOps.cpp. My previous review ran the negative control on the same test and production code: with all 154 bodies made to throw,nkwebkit_noopsfailed. I did not repeat it.Previous findings
docs/dev/debt/libSceNKWebKit.md:37now reads "7284 of the 8703".WKBundlePageCopyRenderTreeis back at line 204 andWKRenderLayerIsClippingat line 693.16bbbb24fastill says "180 of them have a known void contract … The other 177 keep throwing", but the final split is 154/203. Rewording or squashing it at merge would fix the history.Export.cpp: Still open (minor). The mergedcore/libs/prx/libSceNKWebKit/Export.cppstill has 182 places with two blank lines in a row, left where stubs were removed.New findings
Blocking
None.
Non-blocking
None.
Not verified
retbodies, the NIDs or the module SHA-256 against the 11.00 image. They come from the author's gist.voidcontracts of the 39 C API exports against the WebKit headers (no network). They are author-reported, and the names are consistent with them.libSceNKWebKit, so I observed no runtime behaviour, and I launched no game.