feat(libSceNKWebKit): implement WTF::protocolHostAndPortAreEqual #14303

Merged
voidlakhan merged 1 commit from upstream-pr/14303 into main 2026-11-05 20:56:28 +00:00
voidlakhan commented 2026-11-01 09:00:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by voidlakhan on 2026-11-01T09:00:58Z.


What

Implements WTF::protocolHostAndPortAreEqual(const WTF::URL&, const WTF::URL&) in libSceNKWebKit (NID tDDzvLlQ7CE, mangled _ZN3WTF27protocolHostAndPortAreEqualERKNS_3URLES2_), replacing the throwing stub with verified upstream WebKit semantics.

  • Source Provenance: Upstream WebKit implementation from neonmodder123/PS5-WebKit-11.x (protocolHostAndPortAreEqual) and URL::port() at pinned commit 80f77e94c63ee7202eec3d4b5b1a021dd89011ba.
  • ABI & Symbol: Exported from libSceNKWebKit.sprx with NID tDDzvLlQ7CE. Added typed prototype in include/WtfExports.hpp taking (const NKWebKit::WtfAbi::URL*, const NKWebKit::WtfAbi::URL*) and returning bool.
  • Semantics:
    • Validates non-null URL pointers via Checked(), throwing on null pointers per repository convention.
    • Compares scheme lengths (schemeEnd from bitfield bits >> 6) and performs case-insensitive ASCII comparison of scheme substrings ([0, schemeEnd)).
    • Compares host lengths (hostEnd - hostStart) and performs case-insensitive ASCII comparison of host substrings ([hostStart, hostEnd)), correctly using HostStart() ((passwordEnd == userStart) ? passwordEnd : passwordEnd + 1).
    • Implements URLPort() helper extracting m_portLength ((bits >> 3) & 7) and parsing 16-bit decimal port numbers from [hostEnd + 1, portLength - 1) polymorphically over 8-bit Latin-1 and 16-bit UTF-16 string views.
    • Matches upstream a.port() == b.port() semantics where absent ports (std::nullopt) compare equal to each other, an explicit default port (e.g. :80) compares unequal to an absent port, and empty, non-digit, or out-of-range (> 65535) ports evaluate to std::nullopt.
  • Technical Debt: Removed declaration from include/InventoryExports.hpp, removed throwing stub from Export.cpp, and decremented unresolved inventory count from 7573 to 7572 in docs/dev/debt/libSceNKWebKit.md.

Tested

  • Windows 10 (x86_64, MinGW GCC 14.2 / Ninja)
  • tests/nkwebkit_wtf_tests.exe: 1/1 test passed (nkwebkit_wtf passed, 100% pass rate).
    • Verified exact-match URLs, same-origin URLs with different fragments, queries, and paths.
    • Verified case-insensitive scheme comparisons (e.g., HTTPS: vs https:).
    • Verified case-insensitive host comparisons (e.g., EXAMPLE.TEST vs example.test).
    • Verified scheme mismatches and host mismatches.
    • Verified explicit port mismatches (:8443 vs :9443).
    • Verified explicit port vs absent port (http://example.test:80 vs http://example.test compares unequal).
    • Verified absent port vs absent port (http://example.test/path vs http://example.test/other compares equal).
    • Verified 16-bit UTF-16 vs 8-bit Latin-1 string representations with explicit ports.
    • Verified port 0 (:0), max uint16_t port (:65535), empty synthetic port (:), malformed non-digit port (:8x), and out-of-range port (:70000).
    • Verified absent/invalid URLs and null pointer exceptions.
  • python tools/check_conventions.py --base upstream/main: passed locally.
  • git diff --check upstream/main..HEAD: clean diff (no whitespace or conflict markers).
  • Not tested on Linux or physical PS5 hardware.

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:5105547376 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14303). Originally posted by [voidlakhan](https://github.com/voidlakhan) on 2026-11-01T09:00:58Z. --- ### What Implements `WTF::protocolHostAndPortAreEqual(const WTF::URL&, const WTF::URL&)` in `libSceNKWebKit` (NID `tDDzvLlQ7CE`, mangled `_ZN3WTF27protocolHostAndPortAreEqualERKNS_3URLES2_`), replacing the throwing stub with verified upstream WebKit semantics. - **Source Provenance**: Upstream WebKit implementation from [`neonmodder123/PS5-WebKit-11.x`](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/URL.cpp#L743-L770) (`protocolHostAndPortAreEqual`) and [`URL::port()`](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/URL.cpp#L158-L161) at pinned commit `80f77e94c63ee7202eec3d4b5b1a021dd89011ba`. - **ABI & Symbol**: Exported from `libSceNKWebKit.sprx` with NID `tDDzvLlQ7CE`. Added typed prototype in `include/WtfExports.hpp` taking `(const NKWebKit::WtfAbi::URL*, const NKWebKit::WtfAbi::URL*)` and returning `bool`. - **Semantics**: - Validates non-null URL pointers via `Checked()`, throwing on null pointers per repository convention. - Compares scheme lengths (`schemeEnd` from bitfield `bits >> 6`) and performs case-insensitive ASCII comparison of scheme substrings (`[0, schemeEnd)`). - Compares host lengths (`hostEnd - hostStart`) and performs case-insensitive ASCII comparison of host substrings (`[hostStart, hostEnd)`), correctly using `HostStart()` (`(passwordEnd == userStart) ? passwordEnd : passwordEnd + 1`). - Implements `URLPort()` helper extracting `m_portLength` (`(bits >> 3) & 7`) and parsing 16-bit decimal port numbers from `[hostEnd + 1, portLength - 1)` polymorphically over 8-bit Latin-1 and 16-bit UTF-16 string views. - Matches upstream `a.port() == b.port()` semantics where absent ports (`std::nullopt`) compare equal to each other, an explicit default port (e.g. `:80`) compares unequal to an absent port, and empty, non-digit, or out-of-range (`> 65535`) ports evaluate to `std::nullopt`. - **Technical Debt**: Removed declaration from `include/InventoryExports.hpp`, removed throwing stub from `Export.cpp`, and decremented unresolved inventory count from 7573 to 7572 in `docs/dev/debt/libSceNKWebKit.md`. ### Tested - Windows 10 (x86_64, MinGW GCC 14.2 / Ninja) - `tests/nkwebkit_wtf_tests.exe`: 1/1 test passed (`nkwebkit_wtf` passed, 100% pass rate). - Verified exact-match URLs, same-origin URLs with different fragments, queries, and paths. - Verified case-insensitive scheme comparisons (e.g., `HTTPS:` vs `https:`). - Verified case-insensitive host comparisons (e.g., `EXAMPLE.TEST` vs `example.test`). - Verified scheme mismatches and host mismatches. - Verified explicit port mismatches (`:8443` vs `:9443`). - Verified explicit port vs absent port (`http://example.test:80` vs `http://example.test` compares unequal). - Verified absent port vs absent port (`http://example.test/path` vs `http://example.test/other` compares equal). - Verified 16-bit UTF-16 vs 8-bit Latin-1 string representations with explicit ports. - Verified port 0 (`:0`), max uint16_t port (`:65535`), empty synthetic port (`:`), malformed non-digit port (`:8x`), and out-of-range port (`:70000`). - Verified absent/invalid URLs and null pointer exceptions. - `python tools/check_conventions.py --base upstream/main`: passed locally. - `git diff --check upstream/main..HEAD`: clean diff (no whitespace or conflict markers). - Not tested on Linux or physical PS5 hardware. ### 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 09:17:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T09:17:36Z.

Review: APPROVED


Reviewed — looks good

I found no blocking issue in the implementation: it follows the pinned WebKit comparison and port-parsing semantics, and the hosted Windows job passes.

What I ran

Reviewed head c1577a68c78852b2ac93b03f0b06ae53d13629f2 against PR base 1f2c1da1fbc2e455b921616cdacb5a714d7fe7ba; an independent merge preview against current main 26fa1212b82f76dd49cf12d65e445d6ff3e0844c was clean. Environment: Debian GNU/Linux 12, Python 3.11.2, Git 2.39.5, GCC 12.2.0. No local C++ build or CTest was run; Windows CI compiled and tested this head.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14303
git diff --check 1f2c1da1fbc2e455b921616cdacb5a714d7fe7ba...c1577a68c78852b2ac93b03f0b06ae53d13629f2
python3 tools/pr_abi_audit.py --base 1f2c1da1fbc2e455b921616cdacb5a714d7fe7ba --head c1577a68c78852b2ac93b03f0b06ae53d13629f2 --json | jq '{status, finding_count: (.findings | length)}'
gh pr checks 14303 --repo boykopovar/AnyPS5

Results

Check Result
Diff whitespace check Passed.
Conventions and PR template Passed.
ABI declaration/export audit Passed: 0 findings.
Full precheck orchestration Incomplete: its temporary PR snapshot lacks the workspace-only ABI and test-quality helper scripts; the ABI audit was rerun successfully from the main checkout.
Merge preview Passed: clean against current main.
Hosted Windows, conventions, report, labels, eligibility, library-portability Passed.
Hosted Linux and specialized jobs Skipped.
Local build or CTest Not run.
Raw selected check output
All conventions checks passed.

/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14303-c1577a68c788/head-c1577a68c788-5940ade7/tools/pr_abi_audit.py': [Errno 2] No such file or directory
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14303-c1577a68c788/head-c1577a68c788-5940ade7/tools/pr_test_quality.py': [Errno 2] No such file or directory

{
  "status": "passed",
  "finding_count": 0
}

conventions	pass	0	https://github.com/boykopovar/AnyPS5/actions/runs/41290048194/job/124799225985
library-portability	pass	1m40s	https://github.com/boykopovar/AnyPS5/actions/runs/41290050646/job/124799232202
report	pass	39s	https://github.com/boykopovar/AnyPS5/actions/runs/41290050653/job/124799232271
windows	pass	0	https://github.com/boykopovar/AnyPS5/actions/runs/41290050648/job/124800279901
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41290050648/job/124800280672
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41290050648/job/124800280994
relinker	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41290050648/job/124800280956
relinker-asan	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41290050648/job/124800281174
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41290050648/job/124800280912
eligibility	pass	5s	https://github.com/boykopovar/AnyPS5/actions/runs/41290050648/job/124799232433
labels	pass	8s	https://github.com/boykopovar/AnyPS5/actions/runs/41290048160/job/124799225905

Negative control

Assertion Change to code under test Result
Whether the repository test fails when the implementation is removed or corrupted No negative-control variant was run by me. Could not be exercised.

Findings

Blocking

None.

Non-blocking

The Linux and specialized hosted jobs were skipped, and console behavior was not verified. The author reports a passing Windows test executable in the PR description; I did not rerun it locally.

Sources

Not verified

I did not run a local C++ build, CTest, Linux build, specialized CI job, or console test. The author's Windows test result is reported in the PR body and was not independently reproduced here.

To get this to a good state

No changes are required for the reviewed head. If the head changes, I will rerun the same checks against the new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5727347588 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14303#pullrequestreview-5727347588). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T09:17:36Z. **Review:** APPROVED --- # Reviewed — looks good I found no blocking issue in the implementation: it follows the pinned WebKit comparison and port-parsing semantics, and the hosted Windows job passes. ## What I ran Reviewed head `c1577a68c78852b2ac93b03f0b06ae53d13629f2` against PR base `1f2c1da1fbc2e455b921616cdacb5a714d7fe7ba`; an independent merge preview against current `main` `26fa1212b82f76dd49cf12d65e445d6ff3e0844c` was clean. Environment: Debian GNU/Linux 12, Python 3.11.2, Git 2.39.5, GCC 12.2.0. No local C++ build or CTest was run; Windows CI compiled and tested this head. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14303 git diff --check 1f2c1da1fbc2e455b921616cdacb5a714d7fe7ba...c1577a68c78852b2ac93b03f0b06ae53d13629f2 python3 tools/pr_abi_audit.py --base 1f2c1da1fbc2e455b921616cdacb5a714d7fe7ba --head c1577a68c78852b2ac93b03f0b06ae53d13629f2 --json | jq '{status, finding_count: (.findings | length)}' gh pr checks 14303 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | |---|---| | Diff whitespace check | Passed. | | Conventions and PR template | Passed. | | ABI declaration/export audit | Passed: 0 findings. | | Full precheck orchestration | Incomplete: its temporary PR snapshot lacks the workspace-only ABI and test-quality helper scripts; the ABI audit was rerun successfully from the main checkout. | | Merge preview | Passed: clean against current `main`. | | Hosted Windows, conventions, report, labels, eligibility, library-portability | Passed. | | Hosted Linux and specialized jobs | Skipped. | | Local build or CTest | Not run. | <details> <summary>Raw selected check output</summary> ```text All conventions checks passed. /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14303-c1577a68c788/head-c1577a68c788-5940ade7/tools/pr_abi_audit.py': [Errno 2] No such file or directory /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14303-c1577a68c788/head-c1577a68c788-5940ade7/tools/pr_test_quality.py': [Errno 2] No such file or directory { "status": "passed", "finding_count": 0 } conventions pass 0 https://github.com/boykopovar/AnyPS5/actions/runs/41290048194/job/124799225985 library-portability pass 1m40s https://github.com/boykopovar/AnyPS5/actions/runs/41290050646/job/124799232202 report pass 39s https://github.com/boykopovar/AnyPS5/actions/runs/41290050653/job/124799232271 windows pass 0 https://github.com/boykopovar/AnyPS5/actions/runs/41290050648/job/124800279901 linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41290050648/job/124800280672 register-context skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41290050648/job/124800280994 relinker skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41290050648/job/124800280956 relinker-asan skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41290050648/job/124800281174 write-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41290050648/job/124800280912 eligibility pass 5s https://github.com/boykopovar/AnyPS5/actions/runs/41290050648/job/124799232433 labels pass 8s https://github.com/boykopovar/AnyPS5/actions/runs/41290048160/job/124799225905 ``` </details> ## Negative control | Assertion | Change to code under test | Result | |---|---|---| | Whether the repository test fails when the implementation is removed or corrupted | No negative-control variant was run by me. | Could not be exercised. | ## Findings ### Blocking None. ### Non-blocking The Linux and specialized hosted jobs were skipped, and console behavior was not verified. The author reports a passing Windows test executable in the PR description; I did not rerun it locally. ## Sources - [Implementation and tests at the reviewed PR head](https://github.com/boykopovar/AnyPS5/tree/c1577a68c78852b2ac93b03f0b06ae53d13629f2/core/libs/prx/libSceNKWebKit) - [Pinned WebKit comparison and URL port behavior](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/URL.cpp#L743-L770) - [Pinned WebKit integer parser semantics](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/text/StringToIntegerConversion.h#L33-L104) ## Not verified I did not run a local C++ build, CTest, Linux build, specialized CI job, or console test. The author's Windows test result is reported in the PR body and was not independently reproduced here. ## To get this to a good state No changes are required for the reviewed head. If the head changes, I will rerun the same checks against the new head.
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!14303
No description provided.