Repository navigation
feat(libSceIcu): implement locale variant and keyword editing - #18344
Conversation
Progress report (324dc5a → ce3032c)📈 System libraries: 41.22% (+0.0025%, +1 implemented, -1 removed functions) ✅ 1 implemented
🗑️ 1 removed
Changed libraries (implemented exports)
|
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
|
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.
|
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 79585147e1:
- Conventions:
tools/check_conventions.pypassed;git diff --checkclean. - Build:
guest_icu_locale_syntax_testsbuilt cleanly. - CTest (
guest_icu_locale_syntax):1/1 Test #3166: guest_icu_locale_syntax .......... Passed 0.00 sec 100% tests passed, 0 tests failed out of 1 - Negative control: with
core/libs/prx/libSceIcu/Export.cpp,core/libs/prx/libSceIcu/LegacyExports.cpp,core/libs/prx/libSceIcu/include/InventoryExports.hpp,core/libs/prx/libSceIcu/include/LegacyExports.hpp,core/libs/prx/libSceIcu/libSceIcu.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass. - Code reading:
- Verified pointer validation in core/libs/prx/libSceIcu/LocaleSyntax.cpp: uloc_getVariant_nid_postfix correctly validates !status, *status > 0, !locale (throwing NotImplemented_nid_no_patch), and !result && capacity > 0 (APS5_INVALID_ARG_EX), correctly permitting null result for capacity <= 0 preflight queries.
- Verified keyword editing bounds and pointer safety in core/libs/prx/libSceIcu/LocaleSyntax.cpp: uloc_setKeywordValue_nid_postfix validates !status, *status > 0, and keyword && *keyword && capacity > 1 && !buffer (APS5_INVALID_ARG_EX), properly delegating capacity <= 1 and null/empty keywords to ICU's U_ILLEGAL_ARGUMENT_ERROR (1) handling.
- Verified test coverage in core/libs/tests/GuestIcuLocaleSyntax.cpp: thoroughly tests variant parsing, capacity boundaries (-1 to expectedLength + 2), buffer canaries ('Q'), keyword insertion/replacement/removal, overflow buffer preservation (U_BUFFER_OVERFLOW_ERROR = 15), warning preservation (U_USING_FALLBACK_WARNING = -127), and exception guards.
- Verified build portability in cmake/Icu.cmake: promoted portable common locale sources (uloc.cpp, locid.cpp, localebuilder.cpp, etc.) from WIN32-only to unconditional compilation across platforms while retaining platform-specific wintz.cpp under the Windows guard.
- Verified AGENTS.md compliance: zero code comments in LocaleSyntax.cpp, LocaleSyntax.hpp, and GuestIcuLocaleSyntax.cpp, unimplemented paths throw NotImplemented_nid_no_patch, and remaining gaps are documented in docs/dev/debt/libSceIcu.md.
- Note: the AI-assisted checkbox can stay.
Looks Good To Me
MarcZX10
left a comment
There was a problem hiding this comment.
feat(libSceIcu): locale variant and keyword editing — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Head 79585147e1c3cbbe84f82597a755c2739860f342, base main. No build, no tests and no git diff --check in this pass. Repository files were read through the reader only:
python3 repo_read.py cat cmake/Icu.cmake 60 110
python3 repo_read.py cat cmake/Icu.cmake 110 132
python3 repo_read.py cat core/libs/prx/libSceIcu/CMakeLists.txt 396 432
python3 repo_read.py search "uscript_props" cmake
python3 repo_read.py search "define APS5_INVALID_ARG_EX" core
python3 repo_read.py search "NotImplemented_nid_no_patch(const char" .
python3 repo_read.py search "NotImplemented_nid_no_patch" core/libs/prx/libSceIcu/Export.cpp
python3 repo_read.py search "uloc_getName" core/libs/prx/libSceIcu
python3 repo_read.py search "uloc_getVariant" core/libsResults
| Check | Result | Note |
|---|---|---|
| Source review of the diff | passed | No defect found in the changed code |
| Removed stubs and declarations | passed | Export.cpp, LegacyExports and headers agree |
| Icu.cmake source list | passed | uscript_props.cpp registered once |
| Whitespace and patch check | not run | Author reports it passed |
| Build and CTest | not run | Author reports 35/35 on Windows, 3/3 on Linux |
| Hosted CI | not run | Not checked from here |
| Overlap check | not run | Author reports the tool exited 2; manual comparison |
Findings
Blocking: none.
Non-blocking: none.
Not verified
- The new test
guest_icu_locale_syntaxwas not run. The Windows and Linux results are the author's report. GuestIcuLocaleSyntax.cpp:79expectsstd::runtime_errorfromNotImplemented_nid_no_patch. The search found only test-local definitions of that helper, so the exception type for this test binary is not verified.GuestIcuLocaleSyntax.cpp:314-315asserts that a capacity below the input length returns status 1 and writes nothing, even when the result would fit. This follows the author's claim about pinned ICU 78.1uloc.cpp, which I did not read.docs/dev/debt/libSceIcu.md:398gives 55 remaining throwing functions.Export.cpphas 82NotImplemented_nid_no_patchcalls at head, and the doc does not state its counting rule, so the figure is not verified.docs/dev/debt/libSceIcu.md:411saysuloc_getNamestays throwing. The definition is atLegacyExports.cpp:9402; its body was not read.- The progress and export figures in the description (192 to 193, 2550 to 2549, 25 / 636 / 0) were not run.
Export.cpp,LegacyExports.cpp,LegacyExports.hpp,InventoryExports.hpp,libSceIcu.hppand the debt doc were reviewed from diff hunks. They were not read in full at head. The NID mapping for the new_nid_postfixnames was not checked.
To get this to a good state
Nothing is required.
Optional:
- Confirm the exception type at
GuestIcuLocaleSyntax.cpp:79and the capacity rule atGuestIcuLocaleSyntax.cpp:314-315when CI runs. - State the counting rule behind the 55 in the debt doc.
7958514 to
b0e3e92
Compare
|
Rebased onto \origin/main\ (\63f37bf00eb, resolved the \cmake/Icu.cmake\ and \docs/dev/debt/libSceIcu.md\ conflicts) and re-verified \guest_icu_locale_syntax, \guest_icu_locale_core, \guest_icu_language_tag, and \check_conventions.py. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head ca7eec16be3ebedce7c2a8ddaec9fa6829d4644d. No commands or tests were run; the supplied description reports Windows and Linux build/test results, which I did not independently verify. Read all changed files marked included: true in manifest.json, including GuestIcuLocaleSyntax.cpp; no changed files were excluded.
Results
| Check | Result | Note |
|---|---|---|
| Changed-file review | passed | All 11 changed files read |
| Build and tests | not run | Author-reported results only |
| Console ABI and behavior | not run | No console execution reported |
Findings
Blocking
None.
Non-blocking
uloc_getVariantanduloc_setKeywordValueare implemented against ICU 78.1, while the PS5 3.20 inventory contains ICU 68 symbols. The debt notes document that console ABI and behavior remain unverified; consider retaining that caveat prominently when describing compatibility. Changed lines:core/libs/prx/libSceIcu/LocaleSyntax.cpp:13,core/libs/prx/libSceIcu/LocaleSyntax.cpp:22.
Not verified
I did not run builds, tests, a negative control, or console behavior checks. Reported Windows and Linux results and overlap checks were not independently verified. The prepared review contains no excluded changed files.
To get this to a good state
Nothing is required. Optional: compare the wrappers with console behavior when a suitable console trace or execution environment is available.
|
The refreshed Windows run reaches the new feature tests successfully, but fails shared tests from the newer main used by CI. For The existing upstream revert #20058 addresses that shared regression and is currently open. No AppContent implementation or weakened test assertion has been added to this feature PR. The AGC failures report AI-assisted: yes. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the source implementation and its focused tests support merging, while console ABI and ICU data-version parity remain unverified.
What I ran
Reviewed head ce3032cc77ff756a218df6b861b250574d0b33ea. No commands or tests were run by me; the Windows 11 / WinLibs GCC 15.2 Release checks in the PR description are author-reported.
Results
| Check | Result | Note |
|---|---|---|
| Source review | passed | Implementation, tests, build wiring and debt fragment read |
| Tests run by reviewer | not run | No local test execution |
| Author-reported checks | passed | Four CTests and maintenance checks reported |
Findings
Blocking
None.
Non-blocking
None.
Not verified
PS5 console ABI and behavior, ICU 68 parity, Linux behavior and hosted checks were not verified. The PR description says hosted checks are pending. All changed files listed in the manifest's reviewed section were read: core/libs/prx/libSceIcu/CMakeLists.txt, core/libs/prx/libSceIcu/Export.cpp, core/libs/prx/libSceIcu/LegacyExports.cpp, core/libs/prx/libSceIcu/LocaleSyntax.cpp, core/libs/prx/libSceIcu/LocaleSyntax.hpp, core/libs/prx/libSceIcu/include/InventoryExports.hpp, core/libs/prx/libSceIcu/include/LegacyExports.hpp, core/libs/prx/libSceIcu/libSceIcu.hpp, core/libs/tests/GuestIcuLocaleSyntax.cpp, and docs/dev/debt/changes/libSceIcu-locale-syntax.md. No files were excluded by the manifest.
To get this to a good state
Nothing is required.
…uage-tag Resolve the adjacent stub removals with boykopovar#18344 by keeping both: the uloc_setKeywordValue and uloc_toLanguageTag stubs are both gone from Export.cpp and InventoryExports.hpp, and uloc_toLanguageTag keeps its typed declaration. The boykopovar#18344 debt fragment no longer lists uloc_toLanguageTag as throwing. The locale getters now shorten three-letter codes as ICU 68.2 does, so the uloc_toLanguageTag debt entry drops that difference and the test pins it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boykopovar#18344's pending fragment rewrites the Additional callable exports entry without a count, and two fragments cannot change the same entry. Keep only this PR's row removals and entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boykopovar#18344's pending fragment rewrites the Additional callable exports entry without a count, and two fragments cannot change the same entry. Keep only this PR's row removals and entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boykopovar#18344's pending fragment rewrites the Additional callable exports entry without a count, and two fragments cannot change the same entry. Keep only this PR's row removals and entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boykopovar#18344's pending fragment rewrites the Additional callable exports entry without a count, and two fragments cannot change the same entry. Keep only this PR's row removals and entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boykopovar#18344's pending fragment rewrites the Additional callable exports entry without a count, and two fragments cannot change the same entry. Keep only this PR's row removals and entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boykopovar#18344's pending fragment rewrites the Additional callable exports entry without a count, and two fragments cannot change the same entry. Keep only this PR's row removals and entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boykopovar#18344's pending fragment rewrites the Additional callable exports entry without a count, and two fragments cannot change the same entry. Keep only this PR's row removals and entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boykopovar#18344's pending fragment rewrites the Additional callable exports entry without a count, and two fragments cannot change the same entry. Keep only this PR's row removals and entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boykopovar#18344's pending fragment rewrites the Additional callable exports entry without a count, and two fragments cannot change the same entry. Keep only this PR's row removals and entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boykopovar#18344's pending fragment rewrites the Additional callable exports entry without a count, and two fragments cannot change the same entry. Keep only this PR's row removals and entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boykopovar#18344's pending fragment rewrites the Additional callable exports entry without a count, and two fragments cannot change the same entry. Keep only this PR's row removals and entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boykopovar#18344's pending fragment rewrites the Additional callable exports entry without a count, and two fragments cannot change the same entry. Keep only this PR's row removals and entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boykopovar#18344's pending fragment rewrites the Additional callable exports entry without a count, and two fragments cannot change the same entry. Keep only this PR's row removals and entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boykopovar#18344's pending fragment rewrites the Additional callable exports entry without a count, and two fragments cannot change the same entry. Keep only this PR's row removals and entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boykopovar#18344's pending fragment rewrites the Additional callable exports entry without a count, and two fragments cannot change the same entry. Keep only this PR's row removals and entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boykopovar#18344's pending fragment rewrites the Additional callable exports entry without a count, and two fragments cannot change the same entry. Keep only this PR's row removals and entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boykopovar#18344's pending fragment rewrites the Additional callable exports entry without a count, and two fragments cannot change the same entry. Keep only this PR's row removals and entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
Implement
uloc_getVariantanduloc_setKeywordValuethrough the existing source-built ICU 78.1 backend. Variant normalization, capacity/termination handling, keyword editing, overflow atomicity and incoming status follow pinned ICU commit049e0d6a420629ac7db77256987d083a563287b5,icu4c/source/common/uloc.cpp. Null guest-default-locale requests remain throwing. This is source-backed behavior; PS5 console ABI and ICU data-version parity remain unverified, including the older ICU 68 symbols in the PS5 3.20 inventory.The branch is based on main
4c0998e1a81and preserves the merged script-property implementation and portable native locale backend. Remaining gaps and inventory changes usedocs/dev/debt/changes/libSceIcu-locale-syntax.md; the canonical debt file is unchanged. No new third-party sources or data are added.Original measurements against
ce111157b8b: implemented 192 → 193, TODO 2550 → 2549, total 2742 unchanged;uloc_getVariantremains TODO-classified because its unknown default-locale path throws. These are historical counts, not a current-main recount.Tested
Windows 11 / WinLibs GCC 15.2 Release at
ce3032cc77ff756a218df6b861b250574d0b33ea: rebuilt affected runtime libraries and test targets; 4/4 CTests passed (guest_icu_locale_syntax,guest_icu_locale_core,guest_icu_language_tag,guest_appcontent). The locale test covers capacities, canaries, variant parsing, keyword insertion/replacement/removal, overflow preservation, status propagation and throwing guards. Current conventions, debt-fragment validation, whitespace and merge-tree checks passed.The AppContent failure from the previous hosted run was independently reproduced at its outdated assertion using the exact CI-main source; main now includes the upstream #20058 revert. No AppContent patch or weakened assertion is part of this PR.
Earlier implementation validation included 35/35 Windows ICU tests and 3/3 native Linux locale tests. Those runs predate the current maintenance merge; no new Linux or console run is claimed. Prior overlap inspection found textual hazards but no competing implementation of these two exports; source behavior is unchanged by maintenance. New hosted checks are pending.
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)