feat(libSceNKWebKit): implement WTF::URL::lastPathComponent and strippedForUseAsReferrer #14387
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14387"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by ashwin280802 on 2026-11-01T11:10:42Z.
What
Implements
WTF::URL::lastPathComponent() const(returnsStringView) andWTF::URL::strippedForUseAsReferrer() const(returnsString) in libSceNKWebKit over the existingWtfAbi::URLlayout, and removes theirNotImplemented_nid_no_patchstubs.docs/dev/debt/libSceNKWebKit.mddrops both table rows (7573 to 7571).Both follow the pinned PS5-WebKit-11.x URL.cpp (
lastPathComponentL95-110,pathStartL131-139,credentialsEndL452-459,strippedForUseAsReferrerL852-866) and the return types in its URL.h. There is no console measurement, so behaviour is matched to that source only. WherereverseFindfinds no/, the unsigned wrap of the upstream code is kept (mailto:abcyields the whole string). Upstream clamps inconsistent boundary fields (pathEndorqueryEndpast the string,userStartafterpasswordEnd, a credential end afterqueryEnd); this patch throwsstd::out_of_rangethere instead, and the debt file records it.pr_overlap.pyfound no open PR with the same exports. It could not compare #13515 and #14212 because they conflict withmain; a manual comparison of their added lines found neither symbol. #13992 changes neighbouring lines ofExport.cpp,InventoryExports.hppand the debt file, and several PRs edit the debt count line, so expect a trivial rebase.Tested
Windows 11 (MinGW GCC), commit
e48a355785,ctest --test-dir build-full -R "^(nkwebkit_wtf|public_headers)$" --timeout 120:python3 tools/check_conventions.py --base origin/mainpasses.Mutation check: I changed each new condition, operator and statement one at a time (28 single-line changes) and
nkwebkit_wtffailed on 27. The 28th, forcingif (!length) return result;off, only passes a null pointer to a zero-bytememcpy, which a test cannot observe; the empty result itself is asserted.Not covered by a test: that
memcpyguard, for the reason above.Not verified: Linux, and the full suite to completion. On my machine
guest_mmap_executable(aborts atGuestMemory.cpp:3436),public_headers(times out at 90 s on Linux) and two skipped tests fail the same way onmain(1f2c1da1fb), and none of them depends on this change. Not tested against a PS5 or a real WebKit build.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T14:20:16Z.
Review: COMMENTED
Reviewed — no blocking findings
The two WTF URL helpers match the pinned upstream
URL.cppline for line in the logic I compared, including the case where no slash exists (the wrap to the start of the string is what upstream'sreverseFindpath also produces); the PR currently conflicts with the currentmain, so it needs a rebase before it can merge.What I ran
c93db338c970662694e371086d0d0a841427ed95, basee67cc81869(the precheck base; the PR ismergeable=false,dirtyagainst the currentmainac26e59d9abf03805477b593f4d31294c185f442)./usr/bin/python33.11.2, no build.python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14387 --output-dir /dev/shm/reviewer-run/precheck/14387. Its mergeability check reported the conflict above.python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base e67cc81869 --head c93db338c970662694e371086d0d0a841427ed95 --json(exit 0;passed; 0 findings; 10,336 symbols).core/libs/prx/libSceNKWebKit/tests/Wtf.cppfrom a head extract: one literal-path registration heuristic.Source/WTF/wtf/URL.cppatneonmodder123/PS5-WebKit-11.x@80f77e94c63ee7202eec3d4b5b1a021dd89011ba, fetched withgh api. ItsURL::lastPathComponent(lines 95-110) usesreverseFind('/', end)followed byif (start < pathStart()) return {}and++start, the same sequence as the port, so a slash-less path returns the whole string on both sides. ItsURL::strippedForUseAsReferrer(lines 852-866) andcredentialsEnd(lines 452-459) match the port's logic; the port adds bounds checks.Results
Precheck report, checks table, unedited (
/dev/shm/reviewer-run/precheck/14387/report.md):The precheck deliberately does not configure, build, or compile AnyPS5.git diff --check e67cc818696fd6e6c58ac80adc6550c54aed68e8...c93db338c970662694e371086d0d0a841427ed95/usr/bin/python3 tools/check_conventions.py --base e67cc818696fd6e6c58ac80adc6550c54aed68e8 --head c93db338c970662694e371086d0d0a841427ed95 --title feat(libSceNKWebKit): implement WTF::URL::lastPathComponent and strippedForUseAsReferrer --body /dev/shm/reviewer-run/precheck/14387/pr-body.md/usr/bin/python3 tools/pr_abi_audit.py --base e67cc818696fd6e6c58ac80adc6550c54aed68e8 --head c93db338c970662694e371086d0d0a841427ed95 --jsonNo changed Python implementation files.No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.No changed test_*.py files./usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14387 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14387/stackNot run: C++ tests need exact-head binaries, which require a build; the precheck does not build./usr/bin/python3 /dev/shm/reviewer-run/precheck/14387/head-c93db338c970-6febd887/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14387/head-c93db338c970-6febd887 --json core/libs/prx/libSceNKWebKit/Export.cpp core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp core/libs/prx/libSceNKWebKit/include/WtfExports.hpp core/libs/prx/libSceNKWebKit/src/WtfString.cpp core/libs/prx/libSceNKWebKit/tests/Wtf.cpp docs/dev/debt/libSceNKWebKit.mdNo changed Python test module in tools/ can be run as a no-build base-source control.Negative control
Not run. The PR's
Wtf.cppchecks include themailto:abccase forlastPathComponent; the C++ test needs a build.Findings
Blocking: none.
Non-blocking:
dirtyagainst the currentmain. The author should rebase ontoac26e59d9abf03805477b593f4d31294c185f442(or the then-current main) and rerun the checks; I did not inspect the conflicting hunks.Sources
lastPathComponent:github.com/neonmodder123/PS5-WebKit-11.x@80f77e94c6/Source/WTF/wtf/URL.cpp (L95-L110)strippedForUseAsReferrer:github.com/neonmodder123/PS5-WebKit-11.x@80f77e94c6/Source/WTF/wtf/URL.cpp (L852-L866)github.com/boykopovar/AnyPS5@c93db338c9/core/libs/prx/libSceNKWebKit/src/WtfString.cppNot verified
conventions,eligibility,intake,labelsandlibrary-portabilitysucceeded;linux,register-context,relinker,relinker-asanandwrite-watchwere skipped.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T07:36:53Z.
Review: COMMENTED
Reviewed — no blocking findings; the two WTF URL functions are implemented, the Windows CTest run passed, and the branch is now mergeable
This PR replaces the
NotImplementedstubs forWTF::URL::lastPathComponentandWTF::URL::strippedForUseAsReferrerwith implementations inWtfString.cpp, and gives them typed signatures. I read the implementation additions in full. The Windows CTest run passed 2594 of 2594. I did not read the new test bodies intests/Wtf.cpp. An earlier review atc93db338c9compared this logic with the pinned upstreamURL.cpp; this head was not compared again in this pass.What I ran
79d336200234d272be99d1c38dcb287aadaeb67b; based8b60b46ed425b117b6fae18900fe6ab81ed6661. 6 files, +145/-15:libSceNKWebKit/src/WtfString.cpp(+46),include/WtfExports.hpp(+2),include/InventoryExports.hpp(-2),tests/Wtf.cpp(+97), and the NKWebKit debt doc (5 lines).WtfString.cppadditions in full:CredentialsEnd,lastPathComponent(which returns a null view when the path is empty or has no segment) andstrippedForUseAsReferrer(which keeps the user and query parts, drops the credentials, and returns the same string when there are none). Both throwstd::out_of_rangeon boundary values that the URL record does not allow.tests/Wtf.cpp.main.Results
WtfString.cppadditions (read)URL.cppat this headc93db338c9compared it; this head was nottests/Wtf.cppRead-only check output
Precheck was not run: no PR-head code is run here. Diff check: passed. Conventions: passed. ABI audit: passed (10333 symbols). Stack check: clean, no declared dependencies, no errors. Hosted:
gh api repos/boykopovar/AnyPS5/commits/79d336200234d272be99d1c38dcb287aadaeb67b/check-runs, and the Windows job log (2594 of 2594).Negative control
Not run here. A negative control needs a local build and run of the NKWebKit tests, and code from this head is not run here.
Findings
Blocking
None from the code read.
Non-blocking
strippedForUseAsReferrertests the credentials flag throughurl.bits & 1, and it computes its output length from the boundary fields. I read that arithmetic and did not compare it with the upstream source at this head, so the exact match to upstream behaviour is not verified here.Sources
github.com/boykopovar/AnyPS5@79d3362002/core/libs/prx/libSceNKWebKit/src/WtfString.cppgithub.com/boykopovar/AnyPS5@79d3362002/core/libs/prx/libSceNKWebKit/include/WtfExports.hppgithub.com/boykopovar/AnyPS5@79d3362002/core/libs/prx/libSceNKWebKit/tests/Wtf.cppwindowson 79d336200234d272be99d1c38dcb287aadaeb67bNot verified
lastPathComponentandstrippedForUseAsReferrerat this head, beyond what the tests check.tests/Wtf.cpp.To get this to a good state
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-05T00:25:08Z.
Review: COMMENTED
Re-checked — new head, no blocking findings
lastPathComponentandstrippedForUseAsReferrerfollow the pinned upstreamURL.cppfor consistent URLs; the head conflicts withmain, and I did not build or run the tests.What I ran
Head
6098f93a1280ce970b650f41cfba78936eb6ec17, current base9ab6a281ea61c9e62a7eb07eb4cef8f19ede1c5c. I read the whole diff (6 files) and compared both functions with the pinned upstream source (neonmodder123/PS5-WebKit-11.xat80f77e94c63ee7202eec3d4b5b1a021dd89011ba). Environment: Debian 12, Linux x86_64. No AnyPS5 build was run.Results
mainlastPathComponentagainst upstreamstrippedForUseAsReferreragainst upstreamnkwebkit_wtfPrecheck report for this head, unedited table
git diff --check 9ab6a281ea61c9e62a7eb07eb4cef8f19ede1c5c...6098f93a1280ce970b650f41cfba78936eb6ec17/marc/DeusMachina_0x1914/.venv/bin/python3 tools/check_conventions.py --base 9ab6a281ea61c9e62a7eb07eb4cef8f19ede1c5c --head 6098f93a1280ce970b650f41cfba78936eb6ec17 --title feat(libSceNKWebKit): implement WTF::URL::lastPathComponent and strippedForUseAsReferrer --body /tmp/anyps5-pr-precheck/final/14387/pr-body.md/marc/DeusMachina_0x1914/.venv/bin/python3 /marc/AnyPS5/tools/pr_abi_audit.py --base 9ab6a281ea61c9e62a7eb07eb4cef8f19ede1c5c --head 6098f93a1280ce970b650f41cfba78936eb6ec17 --json/marc/DeusMachina_0x1914/.venv/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14387 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/final/14387/stack/marc/DeusMachina_0x1914/.venv/bin/python3 /marc/AnyPS5/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/final/14387/head-6098f93a1280-bd0d1f50 --json core/libs/prx/libSceNKWebKit/Export.cpp core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp core/libs/prx/libSceNKWebKit/include/WtfExports.hpp core/libs/prx/libSceNKWebKit/src/WtfString.cpp core/libs/prx/libSceNKWebKit/tests/Wtf.cpp docs/dev/debt/libSceNKWebKit.mdNegative control
Not run. The PR reports a 28-change mutation check with 27 detected; I did not reproduce it.
Findings
Blocking
None.
Non-blocking
main. The PR is DIRTY and labeledneeds rebase; it needs a rebase before it can land.Sources
lastPathComponentin this PR:github.com/boykopovar/AnyPS5@6098f93a12/core/libs/prx/libSceNKWebKit/src/WtfString.cpp (L999-L1016)strippedForUseAsReferrerin this PR:github.com/boykopovar/AnyPS5@6098f93a12/core/libs/prx/libSceNKWebKit/src/WtfString.cpp (L1018-L1037)lastPathComponent:github.com/neonmodder123/PS5-WebKit-11.x@80f77e94c6/Source/WTF/wtf/URL.cpp (L95-L110)strippedForUseAsReferrer:github.com/neonmodder123/PS5-WebKit-11.x@80f77e94c6/Source/WTF/wtf/URL.cpp (L852-L866)Not verified
nkwebkit_wtfon any platform. A CI comment on this head reports a passing GPU run with no new failures; that is another contributor's report, not my run.To get this to a good state
mainand clear the conflicts.