feat(nkwebkit): implement six bmalloc heap operators #17272

Merged
B-Howell merged 17 commits from upstream-pr/17272 into main 2026-11-15 18:17:00 +00:00
B-Howell commented 2026-11-08 16:42:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by B-Howell on 2026-11-08T16:42:44Z.


What

Implement the six existing scalar allocation, array allocation, and scalar deletion exports for IsoTLSEntry and IsoHeapImplBase. They use the existing Primary heap APIs, following the pinned MAKE_BMALLOCED implementation.

tools/progress.py reports six more implemented exports. On the merged base aeaaf736, libSceNKWebKit moves from 2,116/10,982 to 2,122/10,982 and overall progress moves from 12,460/37,870 to 12,466/37,870. Physical console ABI remains unverified.

Tested

  • Windows with WinLibs GCC 15.2.0 r7. The original control reached all six named throws. On 56c24eb68112f5854d23a748c7a2b8107271421e, nkwebkit_wtf and nkwebkit_base each passed 3/3 and public headers passed 65/65.

  • WSL Ubuntu with GCC 11.4.0. On the same commit, nkwebkit_wtf and nkwebkit_base each passed 3/3 and public headers passed 65/65.

  • Conventions passed. Scoped overlap review covered 1,870 exact open PR heads and found no competing implementation for these six exports. The latest-main merge preview preserves all five tested topic blobs.

  • On 333ade1ce5fb6436aeaa2ec2428a5f6e8ffe4b28, an ordinary merge of main at ac94ac850371e12cde7048c3db59135e19a869c3 that resolves the debt doc conflict with #17258 by keeping both entries, conventions passed. The source is unchanged from the tested commits, so it was not rebuilt locally; hosted CI covers the merged code.

  • On 18b16e325653d34f9beb763851155a13fd099055, an ordinary merge of main at bbfb93353c21d6e4e47361bcb96ae16f294273f3, conventions passed; doc-only conflict; count recomputed from the merged tree as the InventoryExports.hpp declarations whose Export.cpp definition still throws through NotImplemented_nid_no_patch (5951).

  • On 42cdf69b24a55268c35898fec54ce0c7732b578b, an ordinary merge of main at 145e689adab572c44a99369516565d28e85f6c12, conventions passed; doc-only conflict, keeping both the #17276 LibWebRTCProvider entry and this one; count recomputed from the merged tree (5949). Not rebuilt.

  • On fb80af1310ab31bcd6f99a7ec0e465b606de6c2f, an ordinary merge of main at d24d5a0e46f3e4d32d24c7e22058f55cf8d9e00e after #16937, conventions passed; doc-only conflict on the count line; count is main's stated 5967 minus this change's 6 removed stubs (5961). Not rebuilt.

  • On 8641745471ef34129b85ee8299e076ab386112aa, an ordinary merge of main at 6cc25635cf62042b693c8e2e4ff12ec8a47abb70 after #18533, conventions passed; doc-only conflict on the count line; count is main's stated 5965 minus this change's 6 removed inventory declarations (5959). Not rebuilt.

  • On ea64da9689e5c3d32070862d5f771b27b334a250, an ordinary merge of main at 993ad4ed86a15cbbb31cbd9fa9e512ee2c1b7c9f after #18094, conventions passed; doc-only conflict on the count line; count is main's stated 5962 minus this change's 6 removed inventory declarations (5956). #18094's code is 4,000+ lines from ours in Export.cpp and InventoryExports.hpp; not rebuilt.

  • On b4b99088ed21dddc3993a6751b9f15c9027371fd, an ordinary merge of main at 1d1fb4f1e1762b07fe309d1afd13cdbbd58b0f44 after #18415, conventions passed; doc-only conflict on the count line; count is main's stated 5950 minus this change's 6 removed inventory declarations (5944). Main's code is 3,900+ lines from ours in Export.cpp and InventoryExports.hpp; not rebuilt.

  • On 8352d286d2f, an ordinary merge of main at 82160bba912 after #18538, conventions passed; doc-only conflict on the count line; count is main's stated 5949 minus this change's 6 removed stubs (5943). Main's code changes since the last merge are over 1,000 lines from this PR's hunks, so the earlier test results stand.

  • On 43ad6bf71e3, an ordinary merge of main at c76eb6a2643 after #19322 and #17764, conventions passed; doc-only union merge of the count line; count is main's stated 5940 minus this change's 6 removed stubs (5934). Main's code changes are over 10,000 lines from this PR's hunks, so not rebuilt.

  • On 256b2fd2e73, an ordinary merge of main at 19ba356e59f after #19460, conventions passed; doc-only union merge of the count line; count is main's stated 5939 minus this change's 6 removed stubs (5933). #19460's code is 10,000+ lines from this PR's hunks, so not rebuilt.

  • On 307bec40e5c: merged main after #19603; count line removed. Ordinary merge of main at 9b22c40f49a, conventions passed. The debt diff against main is now only this PR's entry and its 6 removed table rows. No code conflict and main changed none of this PR's other files, so not rebuilt.

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

Prepared with Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5213122583 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17272). Originally posted by [B-Howell](https://github.com/B-Howell) on 2026-11-08T16:42:44Z. --- ### What Implement the six existing scalar allocation, array allocation, and scalar deletion exports for IsoTLSEntry and IsoHeapImplBase. They use the existing Primary heap APIs, following the [pinned MAKE_BMALLOCED implementation](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/bmalloc/bmalloc/BMalloced.h). `tools/progress.py` reports six more implemented exports. On the merged base `aeaaf736`, libSceNKWebKit moves from 2,116/10,982 to 2,122/10,982 and overall progress moves from 12,460/37,870 to 12,466/37,870. Physical console ABI remains unverified. ### 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. --> - Windows with WinLibs GCC 15.2.0 r7. The original control reached all six named throws. On `56c24eb68112f5854d23a748c7a2b8107271421e`, `nkwebkit_wtf` and `nkwebkit_base` each passed 3/3 and public headers passed 65/65. - WSL Ubuntu with GCC 11.4.0. On the same commit, `nkwebkit_wtf` and `nkwebkit_base` each passed 3/3 and public headers passed 65/65. - Conventions passed. Scoped overlap review covered 1,870 exact open PR heads and found no competing implementation for these six exports. The latest-main merge preview preserves all five tested topic blobs. - On `333ade1ce5fb6436aeaa2ec2428a5f6e8ffe4b28`, an ordinary merge of `main` at `ac94ac850371e12cde7048c3db59135e19a869c3` that resolves the debt doc conflict with #17258 by keeping both entries, conventions passed. The source is unchanged from the tested commits, so it was not rebuilt locally; hosted CI covers the merged code. - On `18b16e325653d34f9beb763851155a13fd099055`, an ordinary merge of `main` at `bbfb93353c21d6e4e47361bcb96ae16f294273f3`, conventions passed; doc-only conflict; count recomputed from the merged tree as the `InventoryExports.hpp` declarations whose `Export.cpp` definition still throws through `NotImplemented_nid_no_patch` (5951). - On `42cdf69b24a55268c35898fec54ce0c7732b578b`, an ordinary merge of `main` at `145e689adab572c44a99369516565d28e85f6c12`, conventions passed; doc-only conflict, keeping both the #17276 LibWebRTCProvider entry and this one; count recomputed from the merged tree (5949). Not rebuilt. - On `fb80af1310ab31bcd6f99a7ec0e465b606de6c2f`, an ordinary merge of `main` at `d24d5a0e46f3e4d32d24c7e22058f55cf8d9e00e` after #16937, conventions passed; doc-only conflict on the count line; count is main's stated 5967 minus this change's 6 removed stubs (5961). Not rebuilt. - On `8641745471ef34129b85ee8299e076ab386112aa`, an ordinary merge of `main` at `6cc25635cf62042b693c8e2e4ff12ec8a47abb70` after #18533, conventions passed; doc-only conflict on the count line; count is main's stated 5965 minus this change's 6 removed inventory declarations (5959). Not rebuilt. - On `ea64da9689e5c3d32070862d5f771b27b334a250`, an ordinary merge of `main` at `993ad4ed86a15cbbb31cbd9fa9e512ee2c1b7c9f` after #18094, conventions passed; doc-only conflict on the count line; count is main's stated 5962 minus this change's 6 removed inventory declarations (5956). #18094's code is 4,000+ lines from ours in `Export.cpp` and `InventoryExports.hpp`; not rebuilt. - On `b4b99088ed21dddc3993a6751b9f15c9027371fd`, an ordinary merge of `main` at `1d1fb4f1e1762b07fe309d1afd13cdbbd58b0f44` after #18415, conventions passed; doc-only conflict on the count line; count is main's stated 5950 minus this change's 6 removed inventory declarations (5944). Main's code is 3,900+ lines from ours in `Export.cpp` and `InventoryExports.hpp`; not rebuilt. - On `8352d286d2f`, an ordinary merge of `main` at `82160bba912` after #18538, conventions passed; doc-only conflict on the count line; count is main's stated 5949 minus this change's 6 removed stubs (5943). Main's code changes since the last merge are over 1,000 lines from this PR's hunks, so the earlier test results stand. - On `43ad6bf71e3`, an ordinary merge of `main` at `c76eb6a2643` after #19322 and #17764, conventions passed; doc-only union merge of the count line; count is main's stated 5940 minus this change's 6 removed stubs (5934). Main's code changes are over 10,000 lines from this PR's hunks, so not rebuilt. - On `256b2fd2e73`, an ordinary merge of `main` at `19ba356e59f` after #19460, conventions passed; doc-only union merge of the count line; count is main's stated 5939 minus this change's 6 removed stubs (5933). #19460's code is 10,000+ lines from this PR's hunks, so not rebuilt. - On `307bec40e5c`: merged main after #19603; count line removed. Ordinary merge of `main` at `9b22c40f49a`, conventions passed. The debt diff against main is now only this PR's entry and its 6 removed table rows. No code conflict and main changed none of this PR's other files, so not rebuilt. ### 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 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no --> Prepared with Codex.
PrivacyOnion commented 2026-11-08 16:59:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-08T16:59:36Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 56c24eb681:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: nkwebkit_wtf_tests built cleanly.
  • CTest (nkwebkit_wtf):
    1/1 Test #3414: nkwebkit_wtf .....................   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/src/Bmalloc.cpp reverted to main and the new tests kept, the suite fails:
    1/1 Test #3414: nkwebkit_wtf .....................***Failed    0.01 sec
    0% tests passed, 1 tests failed out of 1
    
    Restoring the change makes it pass again.
  • Code reading:
    • Export.cpp: verified removal of the six NotImplemented_nid_no_patch stubs
    • InventoryExports.hpp: verified updated signatures for IsoTLSEntry and IsoHeapImplBase nw, dl, and na exports
    • Bmalloc.cpp: verified operator implementations delegate to mallocOutOfLine and freeOutOfLine using HeapKind 0 (Primary)
    • Bmalloc.cpp and Wtf.cpp: verified absence of code comments conforming to AGENTS.md conventions
    • docs/dev/debt/libSceNKWebKit.md: verified debt section added and export inventory table updated
    • Wtf.cpp: verified unit test coverage for alignment, zero-size allocation, read/write roundtrip, and nullptr deletion
    • PR metadata: verified conventional commit title and complete checklist
  • Note: the AI-assisted checkbox can stay.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5818764551 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17272#pullrequestreview-5818764551). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-08T16:59:36Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `56c24eb681`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `nkwebkit_wtf_tests` built cleanly. - **CTest** (`nkwebkit_wtf`): ``` 1/1 Test #3414: nkwebkit_wtf ..................... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/src/Bmalloc.cpp` reverted to `main` and the new tests kept, the suite fails: ``` 1/1 Test #3414: nkwebkit_wtf .....................***Failed 0.01 sec 0% tests passed, 1 tests failed out of 1 ``` Restoring the change makes it pass again. - **Code reading**: - Export.cpp: verified removal of the six NotImplemented_nid_no_patch stubs - InventoryExports.hpp: verified updated signatures for IsoTLSEntry and IsoHeapImplBase nw, dl, and na exports - Bmalloc.cpp: verified operator implementations delegate to mallocOutOfLine and freeOutOfLine using HeapKind 0 (Primary) - Bmalloc.cpp and Wtf.cpp: verified absence of code comments conforming to AGENTS.md conventions - docs/dev/debt/libSceNKWebKit.md: verified debt section added and export inventory table updated - Wtf.cpp: verified unit test coverage for alignment, zero-size allocation, read/write roundtrip, and nullptr deletion - PR metadata: verified conventional commit title and complete checklist - Note: the AI-assisted checkbox can stay. Looks Good To Me
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!17272
No description provided.