feat(libSceNKWebKit): implement WebCore::SQLiteDatabaseTracker transaction counting #19550

Merged
B-Howell merged 6 commits from upstream-pr/19550 into main 2026-11-18 07:16:39 +00:00
B-Howell commented 2026-11-13 14:45:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by B-Howell on 2026-11-13T14:45:13Z.


What

Implements the four WebCore::SQLiteDatabaseTracker exports (setClient, incrementTransactionInProgressCount, decrementTransactionInProgressCount, hasTransactionInProgress) from the pinned PS5 11.x SQLiteDatabaseTracker.cpp: one locked client pointer and counter, the client's willBeginFirstTransaction on the 0 to 1 step and didFinishLastTransaction on the 1 to 0 step, and !client || count > 0 for hasTransactionInProgress. Without a client, counting does nothing.

The guest client is called through vtable slots 2 and 3 of the pinned SQLiteDatabaseTrackerClient.h (virtual destructor pair first), the same way InspectorFrontendRouter.cpp calls FrontendChannel. The 8-byte client layout is pinned with static_assert in SQLiteDatabaseTrackerAbi.hpp. A decrement at zero with a client set is an ASSERT in the source; here it throws instead of wrapping. The debt file records the remaining gap (no console comparison) and the NKWebKit count goes from main's 5940 to 5936.

tools/progress.py: libSceNKWebKit 2997/11258 to 3001/11258 (+4 implemented, system libraries 39.91%).

Tested

Ubuntu (WSL2), Release, Ninja, current main c76eb6a264 plus this commit.

  • New nkwebkit_sqlitedatabasetracker (fake guest client with counters on slots 2 and 3; trap functions on slots 0 and 1): no client, counting with a client, decrement at zero, and clearing the client. Passed 3/3 runs.
  • Red control: the same test with main's throwing bodies fails (_ZN7WebCore21SQLiteDatabaseTracker24hasTransactionInProgressEv not implemented, subprocess aborted).
  • ctest -R '^public_headers': 65/65 passed.
  • On 626b8dfd8fe: 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 4 removed table rows. No code conflict and main changed none of this PR's other files, so not rebuilt.
  • 2026-11-14: comment-only commit 1b3ce192b4a rewrites each Derived from line as Derived from <path>@<40-character revision>, one line per source file (maintainer ruling, #19819 comment). No code changed, so no rebuild; tools/check_conventions.py --base origin/main passes and git diff --check is clean.
  • Debt fragment db0a13b034: merged main c3d38470e0c and moved this PR's debt edits into docs/dev/debt/changes/claude-nkwebkit-sqlite-db-tracker.md; the debt files match main, and the fragment applied to main gives the same debt lines as the previous head. debt_fold.py --check and check_conventions.py --base origin/main pass. Documentation only, no build.

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:5297502123 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19550). Originally posted by [B-Howell](https://github.com/B-Howell) on 2026-11-13T14:45:13Z. --- ### What Implements the four `WebCore::SQLiteDatabaseTracker` exports (`setClient`, `incrementTransactionInProgressCount`, `decrementTransactionInProgressCount`, `hasTransactionInProgress`) from the pinned [PS5 11.x `SQLiteDatabaseTracker.cpp`](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/sql/SQLiteDatabaseTracker.cpp): one locked client pointer and counter, the client's `willBeginFirstTransaction` on the 0 to 1 step and `didFinishLastTransaction` on the 1 to 0 step, and `!client || count > 0` for `hasTransactionInProgress`. Without a client, counting does nothing. The guest client is called through vtable slots 2 and 3 of the pinned [`SQLiteDatabaseTrackerClient.h`](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/sql/SQLiteDatabaseTrackerClient.h) (virtual destructor pair first), the same way `InspectorFrontendRouter.cpp` calls `FrontendChannel`. The 8-byte client layout is pinned with `static_assert` in `SQLiteDatabaseTrackerAbi.hpp`. A decrement at zero with a client set is an `ASSERT` in the source; here it throws instead of wrapping. The debt file records the remaining gap (no console comparison) and the NKWebKit count goes from main's 5940 to 5936. `tools/progress.py`: libSceNKWebKit 2997/11258 to 3001/11258 (+4 implemented, system libraries 39.91%). ### Tested Ubuntu (WSL2), Release, Ninja, current `main` c76eb6a2643 plus this commit. - New `nkwebkit_sqlitedatabasetracker` (fake guest client with counters on slots 2 and 3; trap functions on slots 0 and 1): no client, counting with a client, decrement at zero, and clearing the client. Passed 3/3 runs. - Red control: the same test with main's throwing bodies fails (`_ZN7WebCore21SQLiteDatabaseTracker24hasTransactionInProgressEv not implemented`, subprocess aborted). - `ctest -R '^public_headers'`: 65/65 passed. - On `626b8dfd8fe`: 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 4 removed table rows. No code conflict and main changed none of this PR's other files, so not rebuilt. - 2026-11-14: comment-only commit `1b3ce192b4a` rewrites each `Derived from` line as `Derived from <path>@<40-character revision>`, one line per source file (maintainer ruling, [#19819 comment](https://github.com/boykopovar/AnyPS5/pull/19819#issuecomment-6868889186)). No code changed, so no rebuild; `tools/check_conventions.py --base origin/main` passes and `git diff --check` is clean. - Debt fragment `db0a13b034`: merged main `c3d38470e0c` and moved this PR's debt edits into `docs/dev/debt/changes/claude-nkwebkit-sqlite-db-tracker.md`; the debt files match main, and the fragment applied to main gives the same debt lines as the previous head. `debt_fold.py --check` and `check_conventions.py --base origin/main` pass. Documentation only, no build. ### 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
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!19550
No description provided.