feat(libSceNKWebKit): implement Inspector::IdentifiersFactory #16055

Merged
gslashm merged 1 commit from upstream-pr/16055 into main 2026-11-05 17:22:47 +00:00
gslashm commented 2026-11-05 13:36:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gslashm on 2026-11-05T13:36:53Z.


What

Implements two libSceNKWebKit exports from Source/JavaScriptCore/inspector/IdentifiersFactory.cpp at 80f77e94c6 (the whole file, :34-51). The signatures match Source/JavaScriptCore/inspector/IdentifiersFactory.h:34-35; nothing else comes from that header, so only the .cpp notice is carried:

  • Inspector::IdentifiersFactory::createIdentifier() (:43-46)
  • Inspector::IdentifiersFactory::requestId(unsigned long) (:48-51)

A plain non-atomic lastUsedIdentifier starts at 0 and createIdentifier pre-increments it, so the first result is 0.1 and the next 0.2; requestId(0) returns a null String and any other value returns 0.<decimal> without touching the counter. The text comes from makeString("0."_s, identifier) (:40), an 8-bit string with no padding. The counter stays a plain static, as upstream; no lock or atomic is added. No behaviour differs from the pinned source. Both exports return WTF::String by value through the hidden return pointer, because the existing 8-byte NKWebKit::WtfAbi::String owner has a non-trivial destructor. requestId takes std::uint64_t, not unsigned long: the mangled m is a 64-bit unsigned long on the console, while unsigned long is 32 bits in the MinGW host toolchain. Not compared with a console module.

tools/pr_overlap.py lists #13486 under the same exports. That PR is a relinker draft whose merge base predates the 8703 stubs, so its diff re-adds them, all still throwing; it implements neither export. On this head, no open PR adds the same files and no other PR shares an export; the 44 PRs the tool could not merge with main were compared separately and none shares an export or a new file, apart from #13486. Line conflicts are the debt count line (docs/dev/debt/libSceNKWebKit.md:39, 18 PRs) and the lines the new debt entry occupies (:14, #16041, and :14-15, #16016). Whichever merges later keeps both sides.

Tested

Windows 11 Pro, WinLibs GCC 15.2.0. No title and no console module. nkwebkit_inspectoridentifiersfactory checks, in a fixed order because the counter is process-wide: createIdentifier returns 0.1 then 0.2; requestId(0) returns a null String; requestId(42) returns 0.42 and requestId(1) returns 0.1; requestId(18446744073709551615) returns 0.18446744073709551615, which fails if the parameter is 32-bit; then createIdentifier returns 0.3, so requestId did not advance the counter. Every non-null result is checked for length, the 8-bit flag and exact bytes, and both signatures are pinned with static_assert. ctest -R nkwebkit: 14 of 14 pass. ctest -R public_headers: 65 of 65 pass. tools/progress.py: 1323 of 11248, two more than main at d23df92b38 (1321). cmake --build build: exit 0. Whole suite not run.

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:5172466626 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16055). Originally posted by [gslashm](https://github.com/gslashm) on 2026-11-05T13:36:53Z. --- ### What Implements two `libSceNKWebKit` exports from `Source/JavaScriptCore/inspector/IdentifiersFactory.cpp` at `80f77e94c6` (the whole file, `:34-51`). The signatures match `Source/JavaScriptCore/inspector/IdentifiersFactory.h:34-35`; nothing else comes from that header, so only the `.cpp` notice is carried: - `Inspector::IdentifiersFactory::createIdentifier()` (`:43-46`) - `Inspector::IdentifiersFactory::requestId(unsigned long)` (`:48-51`) A plain non-atomic `lastUsedIdentifier` starts at 0 and `createIdentifier` pre-increments it, so the first result is `0.1` and the next `0.2`; `requestId(0)` returns a null `String` and any other value returns `0.<decimal>` without touching the counter. The text comes from `makeString("0."_s, identifier)` (`:40`), an 8-bit string with no padding. The counter stays a plain static, as upstream; no lock or atomic is added. No behaviour differs from the pinned source. Both exports return `WTF::String` by value through the hidden return pointer, because the existing 8-byte `NKWebKit::WtfAbi::String` owner has a non-trivial destructor. `requestId` takes `std::uint64_t`, not `unsigned long`: the mangled `m` is a 64-bit `unsigned long` on the console, while `unsigned long` is 32 bits in the MinGW host toolchain. Not compared with a console module. `tools/pr_overlap.py` lists #13486 under the same exports. That PR is a relinker draft whose merge base predates the 8703 stubs, so its diff re-adds them, all still throwing; it implements neither export. On this head, no open PR adds the same files and no other PR shares an export; the 44 PRs the tool could not merge with `main` were compared separately and none shares an export or a new file, apart from #13486. Line conflicts are the debt count line (`docs/dev/debt/libSceNKWebKit.md:39`, 18 PRs) and the lines the new debt entry occupies (`:14`, #16041, and `:14-15`, #16016). Whichever merges later keeps both sides. ### 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 11 Pro, WinLibs GCC 15.2.0. No title and no console module. `nkwebkit_inspectoridentifiersfactory` checks, in a fixed order because the counter is process-wide: `createIdentifier` returns `0.1` then `0.2`; `requestId(0)` returns a null `String`; `requestId(42)` returns `0.42` and `requestId(1)` returns `0.1`; `requestId(18446744073709551615)` returns `0.18446744073709551615`, which fails if the parameter is 32-bit; then `createIdentifier` returns `0.3`, so `requestId` did not advance the counter. Every non-null result is checked for length, the 8-bit flag and exact bytes, and both signatures are pinned with `static_assert`. `ctest -R nkwebkit`: 14 of 14 pass. `ctest -R public_headers`: 65 of 65 pass. `tools/progress.py`: 1323 of 11248, two more than `main` at `d23df92b38` (1321). `cmake --build build`: exit 0. Whole suite not run. ### 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!16055
No description provided.