Skip to content

feat(libSceIcu): implement locale_getKeywordsStart - #14050

Open
danielhorngt wants to merge 1 commit into
boykopovar:mainfrom
danielhorngt:feat/icu-locale-keywords-start
Open

danielhorngt wants to merge 1 commit into
boykopovar:mainfrom
danielhorngt:feat/icu-locale-keywords-start

Conversation

@danielhorngt

Copy link
Copy Markdown
Contributor

What

Implements locale_getKeywordsStart (NID wlK146pHnQ4, in the PS5 3.20 inventory), which was a throwing stub. It returns a pointer to the first @ of a locale ID, or null when there is none. A null locale, which ICU dereferences, throws.

The signature needed evidence, because ICU changed it. ICU 65.1, 68.2 and 76.1 take const char*; ICU 77.1 and the 78.1 commit pinned in the debt notes take std::string_view. Firmware 3.20's module is ICU 68: tools-style NID hashing of _ZN6icu_6813BreakIterator23createCharacterInstanceERKNS_6LocaleER10UErrorCode gives BufsAiaX0+s, a 3.20 inventory NID, and the icu_65 spelling does not match. So this uses const char* and follows ICU 68.2 uloc.cpp. The EBCDIC branch there does not apply. The debt entry records that the ICU version of later firmware is unverified.

The stub counts in docs/dev/debt/libSceIcu.md go from 93 to 92 and from 73 to 72.

Tested

Windows 11 Pro, i9-12900K, WinLibs GCC 15.2.0 r7, full build tree. No title or console was used.

Not run: the full test suite, the libs target, Linux, macOS, or the relinker on a module that imports this function.

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

🤖 Generated with Claude Code

Return the first '@' of a locale ID, or null when it has none, as ICU
68.2 does. The firmware 3.20 module is built from ICU 68: the inventory
NID BufsAiaX0+s is the hash of the icu_68 BreakIterator symbol. ICU 77
moved this function to std::string_view, so the const char* signature is
the one that applies. Record that later firmware is unverified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Progress report (474030e → c0bf834)

📈 System libraries: 26.19% (+0.01%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceIcu locale_getKeywordsStart_nid_postfix

Changed libraries (implemented exports)

Library Before After Change
libSceIcu 28/2475 (1.13%) 29/2475 (1.17%) +0.04%

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 14123 core/libs/prx/libSceIcu/Export.cpp L48-91
core/libs/prx/libSceIcu/Identified.hpp L10-15
docs/dev/debt/libSceIcu.md L42-43, L45

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.

Pull request Shared files not compared
PR 10964 core/libs/prx/libSceIcu/CMakeLists.txt
docs/dev/debt/libSceIcu.md
PR 10965 core/libs/prx/libSceIcu/CMakeLists.txt
docs/dev/debt/libSceIcu.md
PR 10966 core/libs/prx/libSceIcu/CMakeLists.txt
docs/dev/debt/libSceIcu.md
PR 10967 core/libs/prx/libSceIcu/CMakeLists.txt
docs/dev/debt/libSceIcu.md
PR 12320 core/libs/prx/libSceIcu/CMakeLists.txt
core/libs/prx/libSceIcu/Export.cpp
docs/dev/debt/libSceIcu.md
PR 12738 core/libs/prx/libSceIcu/CMakeLists.txt
docs/dev/debt/libSceIcu.md
PR 13578 core/libs/prx/libSceIcu/CMakeLists.txt
core/libs/prx/libSceIcu/Export.cpp
docs/dev/debt/libSceIcu.md
PR 14144 core/libs/prx/libSceIcu/CMakeLists.txt
core/libs/prx/libSceIcu/Export.cpp
docs/dev/debt/libSceIcu.md
PR 14212 docs/dev/debt/libSceIcu.md
PR 14340 core/libs/prx/libSceIcu/CMakeLists.txt
core/libs/prx/libSceIcu/Export.cpp
docs/dev/debt/libSceIcu.md
PR 14443 core/libs/prx/libSceIcu/CMakeLists.txt
core/libs/prx/libSceIcu/Export.cpp
docs/dev/debt/libSceIcu.md

@BunnyFl BunnyFl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows 11, WinLibs GCC 15.2.0 r7, Release. Head c0bf834 merged into upstream/main 93dbd0f:

  • All 9 guest_icu_* tests pass, including the new guest_icu_locale.
  • Mutation check: with std::strchr changed to std::strrchr, guest_icu_locale fails (locale "en@a=b@c=d": expected offset 2, got 6).
  • tools/check_conventions.py --base upstream/main --head c0bf834527: passes.

I recomputed the version argument independently. _ZN6icu_6813BreakIterator23createCharacterInstanceERKNS_6LocaleER10UErrorCode hashes to BufsAiaX0+s, which main already exports from libSceIcu, while the icu_65 spelling gives EfNWIZF8McY. And locale_getKeywordsStart hashes to wlK146pHnQ4. So ICU 68's const char* signature and its uprv_strchr(localeID, '@') body are the right reference.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants