Repository navigation
Conversation
Progress report (0a025bd → 5a6572d)📈 System libraries: 44.62% (+0.07%, +26 implemented functions) ✅ 26 implemented
Changed libraries (implemented exports)
|
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 59b40f9624:
- Conventions:
tools/check_conventions.pypassed. - Build:
nkwebkit_wtfatomstring_tests,nkwebkit_wtfsymbolregistry_testsbuilt cleanly. - CTest (
nkwebkit_wtfatomstring,nkwebkit_wtfsymbolregistry):1/2 Test #4568: nkwebkit_wtfsymbolregistry ....... Passed 0.01 sec 2/2 Test #4561: nkwebkit_wtfatomstring ........... Passed 0.01 sec 100% tests passed, 0 tests failed out of 2 - Negative control: with
core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/WtfNumberFormat.cpp,core/libs/prx/libSceNKWebKit/src/WtfString.cpp,core/libs/prx/libSceNKWebKit/src/WtfStringAbi.hpp,core/libs/prx/libSceNKWebKit/src/WtfTextAbi.hpp,core/libs/prx/libSceNKWebKit/src/WtfAtomString.cpp,core/libs/prx/libSceNKWebKit/src/WtfSymbolRegistry.cppreverted tomainand the new tests kept, the suite fails:Restoring the change makes it pass again.1/2 Test #4561: nkwebkit_wtfatomstring ...........Subprocess aborted***Exception: 0.15 sec 2/2 Test #4568: nkwebkit_wtfsymbolregistry .......Subprocess aborted***Exception: 0.17 sec 0% tests passed, 2 tests failed out of 2 - Code reading:
- Verified SymbolImpl, RegisteredSymbolImpl, and SymbolRegistry ABI layout, offsets, and struct definitions in WtfSymbolExports.hpp matching upstream PS5 WebKit 11.x.
- Checked memory management, ref counting, and destruction order in WtfSymbolRegistry.cpp and WtfString.cpp (Destroy/Release/ForgetRegisteredSymbol).
- Audited thread safety of SymbolRegistry via RegistriesLock mutex for lookup, insertion, and registry destruction.
- Verified null/bounds checks and exception handling for all 6 exported symbols in WtfSymbolExports.hpp and WtfAtomStringExports.hpp.
- Confirmed AGENTS.md conventions compliance: no illegal comments, proper licence notices, no fake stub successes, and clean removal from InventoryExports.hpp.
Looks Good To Me
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — changes requested
Changes are required before merge: make registry lookup and insertion atomic so concurrent calls for one key return the same symbol.
What I ran
Reviewed head 59b40f9624215e3254ca6d00c890e0be4ea5d921; no build or tests were run.
Results
| Check | Result | Note |
|---|---|---|
| Source review | failed | Registry identity race |
| Build and tests | not run | No execution performed |
Findings
Blocking
core/libs/prx/libSceNKWebKit/src/WtfSymbolRegistry.cpp:204andcore/libs/prx/libSceNKWebKit/src/WtfSymbolRegistry.cpp:209: lookup releases the registry mutex before creating and inserting a symbol. Two concurrent calls for the same registry and key can both miss, create different symbols, and each return its own symbol; the secondemplacesilently fails. This breaks the registry guarantee that equal keys resolve to the same symbol. Keep lookup, creation and insertion atomic, or recheck after reacquiring the lock and discard/return the winner.
Non-blocking
None.
Not verified
No build, tests, CI results, or console behavior were verified. Export.cpp and include/InventoryExports.hpp were excluded as too large for the review folder; their diff hunks were inspected, but their full text was not read. All other changed files were read, including the full text of files marked included in the manifest.
To get this to a good state
Make registry creation safe for concurrent calls, then rerun the build and relevant NKWebKit tests.
|
Windows result for head Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, The tests this PR adds or extends, AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
…r one lock Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@MarcZX10 Fixed in 00cc5d4. The new |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
Nothing blocks this review; the points below are optional.
What I ran
Reviewed head 00cc5d4e8e6c003841364ce1477e3898d433343f. No commands or tests were run.
Results
| Check | Result | Note |
|---|---|---|
| Source review | not run | Reviewed selected changed code |
| Tests | not run | No test execution |
Findings
Blocking
None.
Non-blocking
addSlowCase(AtomStringTable&, StringImpl&)validates the supplied table but adds to the current thread’s host table instead (WtfAtomString.cpp:377-379). The debt note documents this limitation. Consider preserving the table association so guest callers using distinct tables retain expected lookup and release behavior.fromUTF8Internalrejects an empty range (WtfAtomString.cpp:399-402), while invalid non-empty UTF-8 returns a null atom (WtfAtomString.cpp:405). Consider checking upstream behavior for an empty range and matching it if empty input is valid.
Not verified
No build or tests were run, and no console behavior was checked. Read the prepared description, commits, manifest and diff, plus WtfSymbolRegistry.cpp, WtfSymbolImpl.cpp, WtfString.cpp, WtfAtomString.cpp, WtfNumberFormat.cpp, WtfSymbolExports.hpp, CMakeLists.txt, and WtfSymbolRegistry.cpp tests. Export.cpp and InventoryExports.hpp were excluded from the review folder as too large; their full text was not read. Other changed files were not read.
To get this to a good state
Nothing is required. The two non-blocking points above are optional follow-up considerations.
|
Retested head Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, The tests this PR adds or extends, AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head 0fcc403cdb1433011262f5f3110ff88e7ca1f184 using the prepared diff and pinned reader. No build or tests were run.
Results
| Check | Result | Note |
|---|---|---|
| Diff inspection | passed | Prepared diff reviewed |
| Build and tests | not run | No commands run |
| Source context | passed | Targeted source ranges read |
Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceNKWebKit/src/WtfAtomString.cpp:377: the overload receiving anAtomStringTable&ignores that table and inserts into the current thread’s table. An atom released on another thread can therefore fail to be found byRemoveAtomand terminate. This limitation is documented in the debt entry; consider tracking the owning table or routing removal through the supplied table when addressing that debt.
Sources
Behavior and limitation were checked against the changed source and the debt entry at this head.
Not verified
No build or tests were run. Full text was read for the included changed files except Export.cpp and include/InventoryExports.hpp, which the review bundle excluded for size; their relevant diff hunks were inspected. The complete test files were not read. files.json was not available through the reader; the file list showed the two excluded files above and the remaining changed files included.
To get this to a good state
Nothing is required. Optional: resolve the atom-table ownership/threading limitation described above.
|
Retested head Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, The tests this PR adds or extends, AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
…ring-table # Conflicts: # core/libs/prx/libSceNKWebKit/src/WtfNumberFormat.cpp
…registry # Conflicts: # core/libs/prx/libSceNKWebKit/src/WtfNumberFormat.cpp
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — changes requested
Changes are required before merge: ensure atom strings can be released from a different thread than the one whose table owns them.
What I ran
Reviewed head cdae24958ed029a28964b1794cc4ba3f79397ee6 using the prepared diff and the pinned-head reader repo_read.py. No build or tests were run; the Linux Mint test results in the description are author-reported.
Results
| Check | Result | Note |
|---|---|---|
| Change and targeted code review | passed | Inspected atom and symbol ownership paths |
| Build and tests | not run | Author-reported results only |
Findings
Blocking
core/libs/prx/libSceNKWebKit/src/WtfAtomString.cpp:332:RemoveAtomremoves an atom only from the releasing thread'sCurrentTable(), and terminates if it is not there. Atoms can be transferred across threads: the addedTestThreadTablesmoves a worker-created atom to the main thread atcore/libs/prx/libSceNKWebKit/tests/WtfAtomString.cpp:442-445, but releases it before the worker exits, so it does not exercise release from another thread. If the worker exits while an atom reference remains held elsewhere, its table destructor leaves the atom's flag set; releasing that atom on the receiving thread then terminates because that thread's table does not contain it. Track the owning table for each atom or otherwise make cross-thread release remove it safely.
Non-blocking
None.
Not verified
- Build and test execution were not performed.
Export.cppandinclude/InventoryExports.hppwere excluded from the review folder because they were too large. Their relevant hunks were visible indiff.patch, and the changed export region inExport.cppwas read through the pinned-head reader. The complete files were not read.- Review scope was the changed atom and symbol implementation, its string release path, exports, tests, and build registration; other unchanged repository behavior was not audited.
To get this to a good state
Make atom-table ownership safe when references cross threads, then rerun the atom-string and full NKWebKit test suites.
…table is destroyed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I checked this and the code is correct, so I changed no source. I added |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
Nothing in the reviewed code establishes a blocking defect; review remains incomplete because two changed files were excluded from the review folder and could not be read in full.
What I ran
Reviewed head e20f111179e1cb0c99b3e4fa2355df02d4e22803 using the prepared diff and repo_read.py at the pinned head. No build or tests were run. The author reports a successful full build and passing NKWebKit tests; this was not independently verified.
Results
| Check | Result | Note |
|---|---|---|
| Diff and included changed files | passed | Targeted source and test review |
| Build and tests | not run | Author-reported only |
| Excluded changed files | not run | Full text unavailable in review folder |
Findings
Blocking
None identified in the code read.
Non-blocking
None.
Not verified
Full contents of core/libs/prx/libSceNKWebKit/Export.cpp and core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp were excluded as too large for the review folder. They were not read through repo_read.py. Also not verified: build/test claims, Windows behavior, and behavior on physical PS5 hardware.
Files read: description.md, commits.md, manifest.json, diff.patch, core/libs/prx/libSceNKWebKit/CMakeLists.txt, core/libs/prx/libSceNKWebKit/src/WtfAtomString.cpp, core/libs/prx/libSceNKWebKit/src/WtfString.cpp, core/libs/prx/libSceNKWebKit/src/WtfStringAbi.hpp, core/libs/prx/libSceNKWebKit/src/WtfSymbolRegistry.cpp, and core/libs/prx/libSceNKWebKit/tests/WtfSymbolRegistry.cpp. Files excluded: Export.cpp and include/InventoryExports.hpp.
To get this to a good state
Nothing is required.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bol-registry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — changes requested
Changes are required before merge: reject reversed or empty UTF-8 ranges without forming an invalid length or passing them to the decoder.
What I ran
Reviewed diff and targeted code at head 5a6572d9c036916e8040f8c05e99ede207936e7d using repo_read.py. No build or tests were run in this review.
Results
| Check | Result | Note |
|---|---|---|
| Diff and source review | passed | Targeted changed code inspected |
| Build and tests | not run | Author reports successful runs |
Findings
Blocking
core/libs/prx/libSceNKWebKit/src/WtfAtomString.cpp:765: The function rejectsend <= startonly whenendis non-null. A caller can pass a non-nullendbeforestart; the subsequentend - startis negative and converted tosize_tforfromUTF8, potentially causing an oversized read. Check ordering before computing the length and reject or return null for an empty range, consistent with the intended behavior.
Non-blocking
None.
Not verified
- Build and test results were not independently verified; they are reported in the PR description.
Export.cppandInventoryExports.hppfull text was excluded from the review bundle; only their diff hunks were inspected. Other files in the diff and manifest were inspected in the prepared bundle.- Console behavior was not tested.
To get this to a good state
Validate the UTF-8 range before subtracting its pointers, then rerun the UTF-8 edge tests and the NKWebKit test suite.
|
A reversed range is already rejected: after a null |
What
Stacked on #22678 (the atom string table; its two commits come first, the last commit is this change). Implements 6 11.x WTF symbol exports:
SymbolImpl::create,SymbolImpl::createNullSymbolandPrivateSymbolImpl::create;SymbolRegistry::symbolForKeyand the registry'sD1/D2destructors.Source: pinned SymbolImpl.cpp, SymbolImpl.h and SymbolRegistry.cpp (PS5 11.x).
Details:
BufferSubstringStringImpl with the symbol flag (32). It shares the description's characters and holds a reference to the description's owner at +24, followed by the symbol hash from the existingnextHashForSymbolexport (+32) and the flags (+36). That's 40 bytes, or 48 for registered symbols, which add the registry pointer at +40. A substring description is resolved to its owner, as upstream does.HashSet<RefPtr<StringImpl>>that holds a strong reference to every symbol it creates. Here those references live in a host table keyed by the registry's address, and the guestHashSetstays empty. The registry's constructor is inline in the guest, so it is never called.symbolForKeyreturns the same symbol for equal keys (8- or 16-bit). A private registry (type 1) creates registered private symbols. The destructor clears each symbol's registry pointer, then drops the registry's references, like~SymbolRegistry.WtfString.cpp. Releasing a symbol used to callstd::terminate. Now it frees the symbol, releases the owner and, if the symbol is still registered, forgets it.RegisteredSymbolImplhas no exports of its own here, andSymbolRegistry::removeis inline.#22678 also gets a fix found while writing this:
addSlowCaseon a symbol (or any full-length substringadd) usedSubstringSharingImpl. That returns the string itself at full length, so the symbol itself was turned into an atom. It now always builds a new substring (or a copy when shorter than the substring header), likecreateSubstringSharingImpl, and #22678's test covers it.Debt: a fragment,
docs/dev/debt/changes/feat-nkwebkit-symbol-registry.md, adds the entry and removes the 6 inventory rows.Overlap:
pr_overlap.py --namesfinds no open PR with these exports.Tested
Linux Mint 22.3. New
nkwebkit_wtfsymbolregistrytest:symbolForKeywith equal 8- and 16-bit keys, public and private registries;The full build succeeds, and all NKWebKit tests pass, including the atom and
wtftext_allocationtests (the latter now also buildsWtfSymbolRegistry.cppandWtfSymbolImpl.cpp).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)