feat(libSceNKWebKit): implement FastBitVector storage operations #14256

Merged
StoneDC merged 1 commit from upstream-pr/14256 into main 2026-11-02 19:47:15 +00:00
StoneDC commented 2026-11-01 04:18:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by StoneDC on 2026-11-01T04:18:21Z.


What

Replaces three throwing libSceNKWebKit inventory declarations with WTF::FastBitVector::clearRange, FastBitVectorWordOwner::resizeSlow and setEqualsSlow. Range clearing preserves every bit outside the requested interval; growth preserves the existing words, zeroes new words and leaves the stored bit count to the inline caller; copying allocates independent storage, including self-copy. All allocation uses the module's existing fastMalloc/fastFree exports.

The 16-byte LP64 layout and behavior follow the paired header and pinned PS5 11.x WebKit mirror. Invalid ranges, accessed null storage, shrinking the word count and overflowing the upstream round-up throw; console ABI and behavior equivalence remain unverified and are recorded in the library debt file.

The debt entry is placed away from other pending additions. Existing inventory prose is explicitly identified as historical, with live totals linked to the generated report, so this change does not compete with other PRs over the shared numeric summary. Only these three entries are removed from the pending table.

Tested

  • Ubuntu under WSL2, GCC 15.2, Release with BUILD_TESTING=ON: built the relinker, all system libraries and the relevant test executables; 75 related CTests passed (nkwebkit|public_headers|patched_libraries), including the 64 public-header compile batches and loading the patched libraries. Rebuilt and reran after rebasing on a8b98da3a5.
  • The new test calls through the guest function-pointer signatures and checks 383,306 clearing intervals with guard words and tail-bit preservation, 27,661 growth/boundary cases, 17,161 independent copies, 131 self-copies, allocation sizes and invalid-input state preservation.
  • Windows 11, WinLibs GCC 15.2 UCRT with the project's DWARF configuration: the actual modified function and allocator sources passed the same focused cases using the existing local libc exception runtime. This was not a full current-main Windows product build.
  • ASan, UBSan and leak detection passed for the production function and allocator sources with the focused tests. Three independent negative controls (broken clearing, changed stored size and corrupted copy data) were all rejected.
  • tools/check_conventions.py --base origin/main, the public-header audit and git diff --check passed.
  • tools/pr_overlap.py --repo boykopovar/AnyPS5 --branch feat/nkwebkit-fastbitvector refreshed 1,638 open PR heads and reported no confirmed shared exports, new files or textual conflicts. It exits 2 because #13515, #13992 and #14212 already conflict with main. I compared all three original patches by the exact target symbols and NIDs (q1+R1z2aE0E, NetEd5QBLRw, qY895ndHoiI): none occurs. Document merge previews are clean for the other related branches; #13515 and #13992 have the same one document-conflict region against main before and after this change, while #14212 merges with this document cleanly.
  • No console, macOS or title run was performed.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5104294871 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14256). Originally posted by [StoneDC](https://github.com/StoneDC) on 2026-11-01T04:18:21Z. --- ### What Replaces three throwing `libSceNKWebKit` inventory declarations with `WTF::FastBitVector::clearRange`, `FastBitVectorWordOwner::resizeSlow` and `setEqualsSlow`. Range clearing preserves every bit outside the requested interval; growth preserves the existing words, zeroes new words and leaves the stored bit count to the inline caller; copying allocates independent storage, including self-copy. All allocation uses the module's existing `fastMalloc`/`fastFree` exports. The 16-byte LP64 layout and behavior follow the paired header and [pinned PS5 11.x WebKit mirror](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/FastBitVector.cpp). Invalid ranges, accessed null storage, shrinking the word count and overflowing the upstream round-up throw; console ABI and behavior equivalence remain unverified and are recorded in the library debt file. The debt entry is placed away from other pending additions. Existing inventory prose is explicitly identified as historical, with live totals linked to the generated report, so this change does not compete with other PRs over the shared numeric summary. Only these three entries are removed from the pending table. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> - Ubuntu under WSL2, GCC 15.2, Release with `BUILD_TESTING=ON`: built the relinker, all system libraries and the relevant test executables; 75 related CTests passed (`nkwebkit|public_headers|patched_libraries`), including the 64 public-header compile batches and loading the patched libraries. Rebuilt and reran after rebasing on `a8b98da3a5`. - The new test calls through the guest function-pointer signatures and checks 383,306 clearing intervals with guard words and tail-bit preservation, 27,661 growth/boundary cases, 17,161 independent copies, 131 self-copies, allocation sizes and invalid-input state preservation. - Windows 11, WinLibs GCC 15.2 UCRT with the project's DWARF configuration: the actual modified function and allocator sources passed the same focused cases using the existing local libc exception runtime. This was not a full current-main Windows product build. - ASan, UBSan and leak detection passed for the production function and allocator sources with the focused tests. Three independent negative controls (broken clearing, changed stored size and corrupted copy data) were all rejected. - `tools/check_conventions.py --base origin/main`, the public-header audit and `git diff --check` passed. - `tools/pr_overlap.py --repo boykopovar/AnyPS5 --branch feat/nkwebkit-fastbitvector` refreshed 1,638 open PR heads and reported no confirmed shared exports, new files or textual conflicts. It exits 2 because #13515, #13992 and #14212 already conflict with main. I compared all three original patches by the exact target symbols and NIDs (`q1+R1z2aE0E`, `NetEd5QBLRw`, `qY895ndHoiI`): none occurs. Document merge previews are clean for the other related branches; #13515 and #13992 have the same one document-conflict region against main before and after this change, while #14212 merges with this document cleanly. - No console, macOS or title run was performed. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-01 04:27:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T04:27:28Z.

Review: APPROVED


Reviewed — looks good

The three implementations match the pinned PS5 WebKit 11.x routines for normal operations, preserve the owner layout, and add checked failures for invalid states and ranges.

What I ran

Reviewed head 584596ed7d747e079a9274b12a13dc4ed36ec086; the PR-recorded base is 5b8211d66b66c2791b1e65f08856ae103fa6ef8d. The local merge preview was clean against current target main ad4854ce62584b3438576786299c88e79d2e8601. Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. I did not build or run the C++ test locally.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14256 --output-dir /tmp/anyps5-pr-precheck-14256
git diff --check ad4854ce62584b3438576786299c88e79d2e8601...584596ed7d747e079a9274b12a13dc4ed36ec086
python3 tools/check_conventions.py --base ad4854ce62584b3438576786299c88e79d2e8601 --head 584596ed7d747e079a9274b12a13dc4ed36ec086 --title 'feat(libSceNKWebKit): implement FastBitVector storage operations' --body /tmp/anyps5-pr-precheck-14256/pr-body.md
python3 tools/pr_abi_audit.py --base ad4854ce62584b3438576786299c88e79d2e8601 --head 584596ed7d747e079a9274b12a13dc4ed36ec086 --json > /tmp/anyps5-abi-14256-current.json
python3 -c 'import json; d=json.load(open("/tmp/anyps5-abi-14256-current.json")); print("status={} symbols={} findings={}".format(d["status"], len(d["symbols"]), len(d["findings"])))'
python3 tools/pr_test_quality.py --root /tmp/anyps5-review-14256 core/libs/prx/libSceNKWebKit/tests/FastBitVector.cpp
grep -n 'file(GLOB nkWebKitTests CONFIGURE_DEPENDS' /tmp/anyps5-review-14256/core/libs/prx/libSceNKWebKit/CMakeLists.txt
python3 tools/pr_overlap.py --branch feat/nkwebkit-fastbitvector --repo boykopovar/AnyPS5 --jobs 8
gh pr checks 14256 --repo boykopovar/AnyPS5
curl -fsSL https://raw.githubusercontent.com/neonmodder123/PS5-WebKit-11.x/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/FastBitVector.cpp -o /tmp/PS5-FastBitVector.cpp
curl -fsSL https://raw.githubusercontent.com/neonmodder123/PS5-WebKit-11.x/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/FastBitVector.h -o /tmp/PS5-FastBitVector.h

Results

Check Result
Diff and conventions Passed against current main ad4854....
Merge preview Clean against ad4854...; no declared dependencies.
ABI audit Passed: 10,109 symbols scanned, 0 findings. This lexical check does not certify console ABI/version behavior.
Test registration The CMake CONFIGURE_DEPENDS glob includes the new tests/FastBitVector.cpp file. The heuristic warning below is a false positive.
Open-PR overlap The full helper failed to parse a GitHub API response. I manually searched exact symbols/NIDs in #13515 and #13992 (no matches); #14212 does not touch this source or debt file. The PR author reports a broader 1,638-PR overlap scan, not independently verified here.
Hosted CI Eligibility, intake, library-portability and report passed. Windows, conventions and labels were pending; Linux and specialized jobs were skipped.
Raw command output

Precheck:

/tmp/anyps5-pr-precheck-14256/report.md
/tmp/anyps5-pr-precheck-14256/report.json
Conclusion: checks failed

The precheck report says diff, conventions and live-stack checks passed. Its ABI and test-quality subprocesses could not run because the custom scripts are workspace-only; I ran them manually as listed above.

Diff check produced no output. Conventions:

All conventions checks passed.

ABI summary:

status=passed symbols=10109 findings=0

Test-quality heuristic:

core/libs/prx/libSceNKWebKit/tests/FastBitVector.cpp:1: possible-unregistered-cpp-test: Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage.
Heuristic findings require manual interpretation.

CMake registration:

49:    file(GLOB nkWebKitTests CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp)

The global overlap helper failed with:

pr_overlap: Invalid \uXXXX escape: line 1 column 1341691 (char 1341690)

Hosted checks:

linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41272575016/job/124748759000
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41272575016/job/124748758785
relinker	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41272575016/job/124748758771
relinker-asan	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41272575016/job/124748758797
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41272575016/job/124748758747
windows	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41272575016/job/124748757900
eligibility	pass	10s	https://github.com/boykopovar/AnyPS5/actions/runs/41272575016/job/124748188846
intake	pass	3s	https://github.com/boykopovar/AnyPS5/actions/runs/41272574998/job/124748189256
library-portability	pass	1m20s	https://github.com/boykopovar/AnyPS5/actions/runs/41272575065/job/124748189104
report	pass	36s	https://github.com/boykopovar/AnyPS5/actions/runs/41272575026/job/124748188967
conventions	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41272575020/job/124748190007
labels	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41272575005/job/124748189636

Findings

Blocking

None found in the inspected source and tests.

Non-blocking

The PR explicitly leaves console-module ABI equivalence unverified; keep that limitation in the debt record. The author-reported C++ builds, runtime test cases, sanitizers and negative controls were not independently run in this review.

Sources

Not verified

No build, C++ test, sanitizer run, console, macOS or title run was performed locally. The PR's build/test, sanitizers and negative-control results are author-reported. The global overlap scan did not complete; related open PRs were checked manually as stated above. Hosted Windows CI was pending at the last refresh.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5726434489 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14256#pullrequestreview-5726434489). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T04:27:28Z. **Review:** APPROVED --- # Reviewed — looks good The three implementations match the pinned PS5 WebKit 11.x routines for normal operations, preserve the owner layout, and add checked failures for invalid states and ranges. ## What I ran Reviewed head `584596ed7d747e079a9274b12a13dc4ed36ec086`; the PR-recorded base is `5b8211d66b66c2791b1e65f08856ae103fa6ef8d`. The local merge preview was clean against current target `main` `ad4854ce62584b3438576786299c88e79d2e8601`. Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. I did not build or run the C++ test locally. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14256 --output-dir /tmp/anyps5-pr-precheck-14256 git diff --check ad4854ce62584b3438576786299c88e79d2e8601...584596ed7d747e079a9274b12a13dc4ed36ec086 python3 tools/check_conventions.py --base ad4854ce62584b3438576786299c88e79d2e8601 --head 584596ed7d747e079a9274b12a13dc4ed36ec086 --title 'feat(libSceNKWebKit): implement FastBitVector storage operations' --body /tmp/anyps5-pr-precheck-14256/pr-body.md python3 tools/pr_abi_audit.py --base ad4854ce62584b3438576786299c88e79d2e8601 --head 584596ed7d747e079a9274b12a13dc4ed36ec086 --json > /tmp/anyps5-abi-14256-current.json python3 -c 'import json; d=json.load(open("/tmp/anyps5-abi-14256-current.json")); print("status={} symbols={} findings={}".format(d["status"], len(d["symbols"]), len(d["findings"])))' python3 tools/pr_test_quality.py --root /tmp/anyps5-review-14256 core/libs/prx/libSceNKWebKit/tests/FastBitVector.cpp grep -n 'file(GLOB nkWebKitTests CONFIGURE_DEPENDS' /tmp/anyps5-review-14256/core/libs/prx/libSceNKWebKit/CMakeLists.txt python3 tools/pr_overlap.py --branch feat/nkwebkit-fastbitvector --repo boykopovar/AnyPS5 --jobs 8 gh pr checks 14256 --repo boykopovar/AnyPS5 curl -fsSL https://raw.githubusercontent.com/neonmodder123/PS5-WebKit-11.x/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/FastBitVector.cpp -o /tmp/PS5-FastBitVector.cpp curl -fsSL https://raw.githubusercontent.com/neonmodder123/PS5-WebKit-11.x/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/FastBitVector.h -o /tmp/PS5-FastBitVector.h ``` ## Results | Check | Result | |---|---| | Diff and conventions | Passed against current `main` `ad4854...`. | | Merge preview | Clean against `ad4854...`; no declared dependencies. | | ABI audit | Passed: 10,109 symbols scanned, 0 findings. This lexical check does not certify console ABI/version behavior. | | Test registration | The CMake `CONFIGURE_DEPENDS` glob includes the new `tests/FastBitVector.cpp` file. The heuristic warning below is a false positive. | | Open-PR overlap | The full helper failed to parse a GitHub API response. I manually searched exact symbols/NIDs in #13515 and #13992 (no matches); #14212 does not touch this source or debt file. The PR author reports a broader 1,638-PR overlap scan, not independently verified here. | | Hosted CI | Eligibility, intake, library-portability and report passed. Windows, conventions and labels were pending; Linux and specialized jobs were skipped. | <details><summary>Raw command output</summary> Precheck: ```text /tmp/anyps5-pr-precheck-14256/report.md /tmp/anyps5-pr-precheck-14256/report.json Conclusion: checks failed ``` The precheck report says diff, conventions and live-stack checks passed. Its ABI and test-quality subprocesses could not run because the custom scripts are workspace-only; I ran them manually as listed above. Diff check produced no output. Conventions: ```text All conventions checks passed. ``` ABI summary: ```text status=passed symbols=10109 findings=0 ``` Test-quality heuristic: ```text core/libs/prx/libSceNKWebKit/tests/FastBitVector.cpp:1: possible-unregistered-cpp-test: Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage. Heuristic findings require manual interpretation. ``` CMake registration: ```text 49: file(GLOB nkWebKitTests CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp) ``` The global overlap helper failed with: ```text pr_overlap: Invalid \uXXXX escape: line 1 column 1341691 (char 1341690) ``` Hosted checks: ```text linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41272575016/job/124748759000 register-context skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41272575016/job/124748758785 relinker skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41272575016/job/124748758771 relinker-asan skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41272575016/job/124748758797 write-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41272575016/job/124748758747 windows pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41272575016/job/124748757900 eligibility pass 10s https://github.com/boykopovar/AnyPS5/actions/runs/41272575016/job/124748188846 intake pass 3s https://github.com/boykopovar/AnyPS5/actions/runs/41272574998/job/124748189256 library-portability pass 1m20s https://github.com/boykopovar/AnyPS5/actions/runs/41272575065/job/124748189104 report pass 36s https://github.com/boykopovar/AnyPS5/actions/runs/41272575026/job/124748188967 conventions pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41272575020/job/124748190007 labels pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41272575005/job/124748189636 ``` </details> ## Findings ### Blocking None found in the inspected source and tests. ### Non-blocking The PR explicitly leaves console-module ABI equivalence unverified; keep that limitation in the debt record. The author-reported C++ builds, runtime test cases, sanitizers and negative controls were not independently run in this review. ## Sources - [Pinned PS5 WebKit 11.x `FastBitVector.cpp`](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/FastBitVector.cpp) - [Pinned PS5 WebKit 11.x `FastBitVector.h`](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/FastBitVector.h) - [PR implementation and its recorded console-ABI limitation](https://github.com/boykopovar/AnyPS5/blob/584596ed7d747e079a9274b12a13dc4ed36ec086/core/libs/prx/libSceNKWebKit/src/WtfFastBitVector.cpp) ## Not verified No build, C++ test, sanitizer run, console, macOS or title run was performed locally. The PR's build/test, sanitizers and negative-control results are author-reported. The global overlap scan did not complete; related open PRs were checked manually as stated above. Hosted Windows CI was pending at the last refresh.
CnRJay commented 2026-11-01 19:49:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:49:32Z.

Review: COMMENTED


Withdrawn. This review applied a title-ID/log requirement that is not in CONTRIBUTING (Unblocks: none is allowed), and it contained no code review.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729922544 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14256#pullrequestreview-5729922544). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-11-01T19:49:32Z. **Review:** COMMENTED --- Withdrawn. This review applied a title-ID/log requirement that is not in CONTRIBUTING (`Unblocks: none` is allowed), and it contained no code review.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!14256
No description provided.