feat(libSceNKWebKit): implement the WTF::BitVector slow paths #14152
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14152"
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 gazaret on 2026-10-31T21:05:55Z.
What
Implements ten
WTF::BitVectorexports in libSceNKWebKit, which were throwing stubs:OutOfLineBits::create,resize,setSlow,clearAll,mergeSlow,excludeSlow,isEmptySlow,bitCountSlow,hashSlowCaseandequalsSlowCase. They follow BitVector.cpp and the one-word layout in BitVector.h from the pinned PS5 WebKit 11.x source the debt file already uses:OutOfLineBitspointer shifted right by one, whosenumBitsis rounded up to whole words;createallocates throughWTF::fastMallocwithout clearing the words, and the code frees throughWTF::fastFree, which is whatOutOfLineBits::destroydoes upstream;resize,setSlow,mergeSlowandexcludeSlowgrow, copy, shrink back inline and combine words as upstream does, including the empty (0) and deleted (1) hash-table values insetSlow.Where this differs from WebKit, as recorded in
docs/dev/debt/libSceNKWebKit.md:mergeSlowORs only the words both out-of-line vectors hold. WebKit reads past the other vector's words when this one is longer.isEmptySlow,bitCountSlowandhashSlowCaseon an inline, empty or deleted vector, and a null vector anywhere, throw where WebKit reads through an invalid pointer.equalsSlowCaseon two inline vectors compares their words.OutOfLineBits::destroyis forwarded tofastFreeby #13947, now merged, so a title'sBitVectordestructor frees the out-of-line vectors these functions produce.dumpstill throws, sinceWTF::PrintStreamis not implemented. The declarations, with theWTF::BitVectorlayout, are in a newinclude/WtfBitVector.hpp, and the code is insrc/WtfBitVector.cpp, so no CMake change is needed. The stubs are removed fromExport.cpp,InventoryExports.hppand the debt table, whose count drops to 7361. Onmainthe count says 7369 while the table has 7371 rows (concurrent merges each edit the same line), so it is recounted from the table rather than lowered by ten.Tested
Ubuntu 22.04 (WSL2), GCC 13.4, Release, rebased on
maind78531d356, fullBUILD_TESTING=ONbuild:New
nkwebkit_wtfbitvector: word rounding increate; growing, shrinking and returning inline inresize; deep copies and empty or deleted values insetSlow;clearAll;mergeSlowandexcludeSlowfor every mix of inline and out-of-line vectors; the three queries; andequalsSlowCaseacross sizes and trailing zero words. Passes 3 of 3 runs. The throwing paths are not asserted.ctest -R 'nkwebkit|public_headers|patched_librar|nid_': 112 of 112 pass.tools/check_conventions.py --base origin/main: no findings.Open pull requests were checked for these ten functions: none implements them.
Test merges (
git mergeat the current heads) with the 107 open pull requests that change libSceNKWebKit:Export.cpp,InventoryExports.hpporlibSceNKWebKit.hpp, at adjacent stub deletions with no duplicate export: 29, such as #13515, #14374, #14919 to #14948 and #15516; each of them already conflicts withmain;include/WebKitValueExports.hpp), #15157 to #15185 (src/Types.hpp,tests/Base.cpp), #14921 and #15213 (include/WtfExports.hpp) and #14212, already conflict withmainin files this pull request does not change;Whichever lands second needs a rebase that keeps both deletions and recounts the debt file. An earlier version of this description said every merge was clean; that came from a check that missed conflict markers and was wrong.
No title tested.
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)OutOfLineBits::destroy, is merged)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T21:46:56Z.
Review: APPROVED
Reviewed — looks good
The ten slow paths match the pinned WebKit representation, with the out-of-range merge read avoided, and the exact-head Windows CI built and passed the new
nkwebkit_wtfbitvectortest.What I ran
Reviewed head
53120e3badaeeec709a8bfc830af83838366d10e, on PR base01df56f7b77e01fc439802a3e59057115c497872; the merge preview against currentmainc21eb9a4d0748c11d3061cf402737eda2a30d00fwas clean. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0. I did not build locally.Results
mergeSlowavoid reading beyond a shorter source vector.tests/*.cppCMake glob rather than a literal path. The Windows CI log confirms it built and rannkwebkit_wtfbitvector.c21eb9a4d0748c11d3061cf402737eda2a30d00f; no declared dependency.53120e3badaeeec709a8bfc830af83838366d10e;nkwebkit_wtfbitvectorpassed. Conventions and labels also passed. Linux and specialized build jobs were skipped.Selected unedited output
Negative control
No local negative control was run; I did not build the test binary locally.
Sources
BitVector.cppand layout inBitVector.hNot verified
No local build or test run. I did not independently run the Linux tests or verify behavior on a PS5; the PR description reports 89/89 Linux CTests, but describes that run against
main0836dfdf4f, so I do not count it as exact-head evidence.Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:49:31Z.
Review: COMMENTED
Withdrawn. This review applied a title-ID/log requirement that is not in CONTRIBUTING (
Unblocks: noneis allowed), and it contained no code review.