feat(libSceLibcInternal): parse numbers in num_get::do_get #21894
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/21894"
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 MarrasFederico on 2026-11-16T20:30:25Z.
What
libSceLibcInternalhad parameterless throwing placeholders for the 18 numericstd::num_get::do_getvirtual exports, the two_Getffldhelpers, andnum_get<char>::_Getcat. They now parse integers and floating-point values for bothcharandwchar_tand allocate thenum_get<char>facet.num_get<char>::do_get(double,long double,float,unsigned int,long,unsigned long,unsigned short,long long,unsigned long long) and_Getffld;num_get<wchar_t>::do_getoverloads and_Getffld;num_get<char>::_Getcatreturning4(LC_NUMERIC) and installing a 15-slotGuestLocale::NumGetVtableon guest-heapGuestLocale::Facet.long/unsigned longroute through 64-bit_Stolx/_Stoulx;unsigned intclamps atUINT32_MAXrather than delegating to 64-bitunsigned long;long doubleparses as 80-bit extended precision through_Stoldxwith decimal/hex exponent bounds raised to6000/20000;std::isinf) and underflow checks setfailbit, and classic"C"fallback disables thousands separators so"1,234"stops at',';0in a floating-point field counts as the first digit group, as it already does for integers, instead of failing grouping asxlocnumdoes.core/libs/prx/libSceLibcInternal/NumGet.cppwith typedAPS5_VABIdeclarations inErrExports.hppandInventoryExports6.hpp, and placeholders removed fromErr.cppandInventoryExports6.cpp.bool&andvoid*&do_get,_Getifld,_Getffldx, andnum_get<wchar_t>::_Getcatkeep throwing viaNotImplemented_nid_no_patch(getBool/getPointerslots ing_charNumGetVtablethrow the same way).docs/dev/debt/changes/feat-libcinternal-num-get-do-get.mdremoving the 21 stub entries, updating theNumGet.cppgetentry, and adding an entry for the implemented exports (all under 1000 characters).Tested
Ubuntu 26.04.1 LTS, GCC 15.2.0, Release,
BUILD_TESTING=ON, onmainat207fca028a. The branch merges cleanly withmainatf2a25e5b42.guest_libc_internal_num_get_do_get: New host-executed guest test covering all 18 numericdo_getoverloads (charandwchar_t, buffered anduflow/underflowchunked streambufs), classic"C""1,234", groupednumpunct(valid, bad, multi-byte, open,CHAR_MAX, heap string), customctypewidening, base auto/oct/dec/hex, overflow/underflow, 80-bitlong doublebeyonddoublerange,_GetffldV1/V2/hex/bad grouping, andnum_get<char>::_Getcatvirtual dispatch.Results:
ctest -R "^(guest_libc_internal_(num_get|num_get_do_get|numpunct|wide_numpunct|wide_ctype|ctype|facet_put|facet_queries|locale_objects|ios_base|stream|time_get|money_get_put)|guest_locale|guest_sce_v2_locale|guest_sce_v2_facet_ids|guest_sce_v2_locale_basics)$": 17 of 17 pass. The new test passed 3 runs in a row.Negative controls: Seven single-line fault injections in
NumGet.cpp(uintoverflow clamp, grouping mismatch return,eofbit, 80-bitlong doubleexponent bound, customctype<wchar_t>lookup,_Getcatreturn category,longoverflowfailbit) each failedguest_libc_internal_num_get_do_getat the matching check before exact restoration.Repository checks:
tools/check_conventions.py --base upstream/main: no findings.core/libs/tests/test_public_headers.py --audit-only: 413 libraries, 34651 exports.git diff --check upstream/main...HEAD: clean. Pre-existing unrelateddocs/dev/debt/changes/docs-nkwebkit-drop-readded-count-lines.mdfails globaltools/debt_fold.py --check, while isolated folding of this branch's fragment succeeds cleanly.Independent Windows 11 verification:
guest_libc_internal_num_get_do_getpassed 3/3 oncf7aa63f5652c9f767324621419ff93600f91590merged intomainat56c87adbdc. The reviewer reported no additional build failure from this PR. The baseline build had a separatesetenvcompilation error and Defender quarantined some AGC test executables on both trees.Overlap:
tools/pr_overlap.py --base main --namesshowsopen: noneacross all 21 symbols in 1756 open PRs.tools/pr_overlap.py --base main --branchnotes#17746(num_put) on header include lines ofErrExports.hppand 4 uncompared PRs (#13778,#14834,#17300,#18135), none of which implements these exports (#17300only renames the remainingnum_get<wchar_t>_Getffldx/_Getcatstubs).Checked on November 18, 2026: head
cf7aa63f5652c9f767324621419ff93600f91590has a clean merge withmainat02650d94a5f171dc333d13fc5abed43faf440a1aand passesgit diff --check. The published head retains the GCC 13 test portability fix usingstd::fabs.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)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-16T20:32:21Z.
Review: CHANGES_REQUESTED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
036b4b315e:tools/check_conventions.pypassed.guest_libc_internal_num_get_do_get_testsfailed to build.Requesting changes for the points above.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-16T20:57:08Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
d2b5d909fb:tools/check_conventions.pypassed.guest_libc_internal_num_get_do_get_testsbuilt cleanly.guest_libc_internal_num_get_do_get):core/libs/prx/libSceLibcInternal/Err.cpp,core/libs/prx/libSceLibcInternal/InventoryExports6.cpp,core/libs/prx/libSceLibcInternal/NumGet.cpp,core/libs/prx/libSceLibcInternal/include/ErrExports.hpp,core/libs/prx/libSceLibcInternal/include/InventoryExports6.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-16T22:42:51Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
35ecb7de23:tools/check_conventions.pypassed.guest_libc_internal_num_get_do_get_testsbuilt cleanly.guest_libc_internal_num_get_do_get):core/libs/prx/libSceLibcInternal/Err.cpp,core/libs/prx/libSceLibcInternal/InventoryExports6.cpp,core/libs/prx/libSceLibcInternal/NumGet.cpp,core/libs/prx/libSceLibcInternal/include/ErrExports.hpp,core/libs/prx/libSceLibcInternal/include/InventoryExports6.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me