Repository navigation
feat(libSceNKWebKit): implement UTF-16 grapheme counts - #26663
Conversation
|
@Kerutzuu I checked c63c8e8. The counting logic matches WTF's TextBreakIterator.cpp, but CharacterBreakIterator() passes a local icu::UnicodeString to setText() and then returns the iterator. ICU keeps a reference to that string (brkiter.h: "The BreakIterator will retain a reference to the supplied string"), so first() and next() in both exports read a destroyed object. Please keep the text alive as long as the iterator, for example by building the UnicodeString in each export and passing it in, or by opening a UText over the guest buffer with utext_openUChars and setText(UText*). The debt fragment also uses "## change [WTF whitespace simplification]", which would replace the WtfWhitespace.cpp entry; it should be an "## add" entry with its own name. The grapheme change does not need the Inspector work from #22666 and #23061, so could you also rebase it onto main by itself? Then it does not wait on that stack. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
22b5b6d to
85e33db
Compare
|
I checked 85e33db. The rebase onto main and the setText lifetime fix both look right, and the counting matches WTF. I don't think this head builds yet. Once they link, the character break rules ( Could you add the break iterator sources plus a source for the rules data (or count UAX #29 clusters without ICU), then build and run the GraphemeClusters test? The PR says the C++ tests were not built, so a run on the new head would settle it. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
ICU4C never opens uprops at runtime. Grapheme and InCB properties come from the compiled in uchar_props_data.h and ExtPict from uemoji.icu, which is already embedded. Also update the debt note, which still described break iteration.
|
I checked e9078eb. Dropping the break iterator fixes my earlier build concern, and the UAX #29 rules and the new test cases look right. I pushed 5c15521 on top with two small changes:
Once a Build runs green on Linux and Windows with the GraphemeClusters test, this is ready from my side. |
|
Could you approve and run the Build workflow for #26663? The focused GraphemeClusters test passes locally on both Windows and Linux. |
|
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.
|
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The UTF-16 grapheme counting implementation and its targeted cases appear sound at the reviewed head; local checks were reported by the author, and hosted build checks remain unavailable.
What I ran
Reviewed head aeafe8ac9694cf0f6b57e0f41009bfc0d6a8380b. I read the prepared description, commit list, manifest, diff, implementation, test file, and debt note. No tests or builds were run during this review. The author reports passing Windows build, focused test, conventions, debt, and diff checks; hosted Linux and Windows checks have no jobs because the workflow is action_required.
Results
| Check | Result | Note |
|---|---|---|
| Source review | passed | Implementation and targeted cases read |
| Local checks | not run | Author reports passing Windows checks |
| Hosted builds | not run | Workflow requires admin action |
Findings
Blocking
None.
Non-blocking
None.
Not verified
Console ABI behavior and console ICU Unicode-version differences are explicitly unverified in the added debt note. Hosted Linux and Windows builds were not run. The changed files listed in the manifest were all read; excluded files: none indicated in the manifest.
To get this to a good state
Nothing is required.
Read the pinned ICU GraphemeBreakTest data. Exercise both exported WebKit helpers for every sequence and verify every expected boundary as a UTF-16 code-unit offset, including supplementary characters. AI-assisted: Codex + GPT-6.2 Astra (xhigh)
|
I checked I put the corpus check into the existing CTest in 6dde1c9cb0. It reads the submodule fixture directly. I checked it with two local mutations that the existing examples both passed:
Restoring the implementation passed the enhanced test. Separately, I compared the exported helpers with Node's ICU 78.2 AI-assisted: Codex + GPT-6.2 Astra (xhigh). |
|
@RavenCurseBurg, thanks for adding and validating the Unicode GraphemeBreakTest corpus check. Could you push commit |
|
Please pick it up on your branch. GitHub reports read access for my account on your fork. I verified that git fetch https://github.com/RavenCurseBurg/AnyPS5.git refs/heads/test/nkwebkit-grapheme-conformance
git merge --ff-only FETCH_HEADThe regression runs apply directly to that tree. Thank you for including the test. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the Unicode grapheme logic is covered by the added conformance test, and the author reports a successful Windows build and test run.
What I ran
Reviewed head 6dde1c9cb07124c4b8e33962cb85eb380f287249. I read all four changed files and the prepared description, commits, manifest, and diff using repo_read.py. No commands or tests were run by me; the Windows results below are author-reported.
Results
| Check | Result | Note |
|---|---|---|
| Source review | passed | All four changed files read |
| Build and tests | not run | Windows results reported by author |
| Hosted checks | not run | Linux and Windows workflows await approval |
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not independently run the build or tests, verify hosted checks, or compare behavior against a console module. The author reports local Windows build, grapheme tests, convention checks, debt check, and whitespace check passed; hosted Linux and Windows checks have not passed yet. Files read: core/libs/prx/libSceNKWebKit/CMakeLists.txt, core/libs/prx/libSceNKWebKit/src/GraphemeClusters.cpp, core/libs/prx/libSceNKWebKit/tests/GraphemeClusters.cpp, and docs/dev/debt/changes/feat-nkwebkit-utf16-grapheme-clusters.md. All four files listed in the manifest were included and read; no changed files were excluded.
To get this to a good state
Nothing is required.
|
Could a repository admin approve and run the Build workflow for the latest head |
What
Implements UTF-16 grapheme counting with UAX #29 using ICU's compiled-in grapheme-break and Indic-conjunct properties and the already-embedded emoji data. Existing 8-bit CRLF handling remains unchanged; no ICU BreakIterator or
uprops.icudependency is needed.Tested
Windows 10.0.26300, MSYS2 UCRT64 GCC 16.2.0-7, CMake 4.3.1, Ninja 1.13.2:
cmake -S . -B build-grapheme -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM="D:\VStudio\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" -DCMAKE_C_COMPILER="C:\msys64\ucrt64\bin\gcc.exe" -DCMAKE_CXX_COMPILER="C:\msys64\ucrt64\bin\g++.exe" -DBUILD_TESTING=ON— passed.cmake --build build-grapheme --target nkwebkit_graphemeclusters_tests --parallel 8— passed.ctest --test-dir build-grapheme -R '^nkwebkit_graphemeclusters$' --output-on-failure— passed (1/1).python3 tools/check_conventions.py— passed.python3 tools/debt_fold.py --check— passed.git diff --check— passed.Linux was not tested locally (WSL is not installed). The hosted Build workflow is
action_requiredand has no jobs; approving it requires repository admin rights, which are unavailable to the connected account. Hosted Linux and Windows Build checks have therefore not passed yet.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)