feat(libSceLibcInternal): implement the wchar_t num_get pointer do_get #27885
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27885"
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 nexus1692 on 2026-11-27T18:32:03Z.
AI-assisted: yes (FreeBuff). Implements the wchar_t num_get pointer do_get instead of duplicating main's char parser.
What
Exports
num_get<wchar_t>::do_get(..., void*&)under NIDBNZq-mRvDS8and removes itssceLibcInternalPending3_091_nid_no_patchplaceholder.WcharNumGetPointeris main'sCharNumGetPointerported tostd::uint16_titerators: forced hexadecimal throughParseIntFieldwhatever the stream basefield,failbitwith a null value when conversion fails, theuintptr_twidth check,failbitwith the converted pointer kept when only grouping is invalid,eofbitat the end of input, and guesterrnopreserved.CharNumGetPointer, the char vtable and theVKdXFE7ualwexport are main's and untouched; that export and itsPending3_066placeholder belong to #24748. This PR is therefore independent:Depends on: none. The branch was merged withmainat8037ad561d, and the sharedfeat-libcinternal-num-get-do-get.mdfragment is removed, which was the source of the conflict with #24748.The console module was not read; the slot order and the console ABI remain inferred. The wide entry's behaviour is recorded in
docs/dev/debt/changes/feat-libSceLibcInternal-num-get-void-pointer.md(855 characters, folded bydebt_fold.py).Tested
Windows 11 10.0.26300, Intel Core Ultra 7 265KF, MinGW-w64 GCC 16.2.0 (UCRT), Ninja, Release, BUILD_TESTING=ON. Not tested on a console and no title was seen calling the export.
| IosHexbasefield override) turnsctest -R '^guest_libc_internal_num_get_do_get$'red atwide num_get::get(void*) forces hexadecimal regardless of the base field(ctest exit 8). Restored, the suite passes again.ctest -R '^guest_libc_internal_num_get' -V: 3/3 consecutive runs passed (2 tests each).ctest -R '^guest_libc_internal': 97/97 passed three consecutive times.0x/0Xprefixes withshowbase/uppercase, bare hexadecimal with a decimal basefield, invalid input left unread, bare prefix, empty field, a value aboveuintptr_t,badGroupingwith wide ctype/numpunct,errnopreservation, null arguments.python3 tools/check_conventions.py --base origin/main: all checks passed.python3 tools/debt_fold.py --check: exit 0.python3 tools/pr_overlap.py --names BNZq-mRvDS8: no open PR changes the export.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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-27T18:33:52Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
480f18904d: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/NumGet.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T18:39:06Z.
Review: COMMENTED
9ef9f55d-dd6c-4a87-bf2b-8b6d930d0706Reviewing files that changed from the base of the PR and between
9f12ec0e38and 480f18904d0b957db66cd3dc6088d39ad5438970.core/libs/prx/libSceLibcInternal/Err.cppcore/libs/prx/libSceLibcInternal/NumGet.cppcore/libs/tests/GuestLibcInternalNumGetDoGet.cppdocs/dev/debt/changes/feat-libSceLibcInternal-num-get-void-pointer.mddocs/dev/debt/changes/feat-libcinternal-num-get-do-get.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T18:39:46Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and tests support merging, while console behavior remains unverified.
What I ran
Reviewed head
480f18904d0b957db66cd3dc6088d39ad5438970. I read the prepared description, commits, manifest, complete diff, and the full text of all five changed files throughrepo_read.py. I did not run commands or tests; test results in the description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The console ABI and behavior of the pointer form remain inferred, and PS5/title behavior was not tested. No tests were run during this review. The prepared bundle lists all five changed files as included and reviewed:
Err.cpp,NumGet.cpp,GuestLibcInternalNumGetDoGet.cpp,feat-libSceLibcInternal-num-get-void-pointer.md, andfeat-libcinternal-num-get-do-get.md.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-27T18:44:17Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
5332893723: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/NumGet.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by fromthemoonx on 2026-11-27T19:10:54Z.
Review: APPROVED
Windows run. Setup: Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0 r7 UCRT, Release, full tree.
main(39b3d6bbaf, test file only):guest_libc_internal_num_get_do_getfails withsceLibcInternalPending3_066_nid_no_patch not implemented, which is main's placeholder behindVKdXFE7ualw.5332893723merged intomain9a91e69c9c: it passes, including the new bad-grouping case, and passes again on 3 repeats.tools/debt_fold.py --checkexits 0 on that merge.tools/check_conventions.pypassed on480f18904d.Both placeholders (
Pending3_066forVKdXFE7ualwandPending3_091forBNZq-mRvDS8) are gone fromErr.cpp, so neither NID is exported twice.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T19:22:30Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the behavior and tests inspected support merging, with the console ABI remaining unverified.
What I ran
Reviewed head
533289372346f308b8eb4d8899d109f7d53ea4eausingrepo_read.pytools. No commands or tests were run by me. The description reports Windows build and test results; those were not independently run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The console ABI and pointer parsing behavior on PS5 were not verified. No build, test, negative control, or debt/convention prechecks were run by me. Read all five changed files:
Err.cpp,NumGet.cpp,GuestLibcInternalNumGetDoGet.cpp,feat-libSceLibcInternal-num-get-void-pointer.md, andfeat-libcinternal-num-get-do-get.md. No changed files were excluded inmanifest.json.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T09:18:02Z.
Review: COMMENTED
The Linux
guest_libc_internal_num_get_do_getCTest passed with the normal target loading the patchedlibSceLibcInternalPRX. The new pointer cases check hexadecimal input, invalid and grouped input, wide-character extraction, and errno preservation.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T15:35:34Z.
Review: COMMENTED
Reviewed — no blocking findings
The implementation follows the existing narrow-character pointer parser and has targeted wide-character coverage, but the console ABI remains unconfirmed.
What I ran
Reviewed head
1d9a4f5b7a55d3cb149fd0c8d118921f722bc222using the prepared diff and targeted reads throughrepo_read.py; no tests or builds were run.Files inspected: all five changed paths in the manifest, using changed hunks and relevant source ranges. Excluded: none.
Results
Negative control
Not run in this review. The description reports that forcing decimal made the wide parser test fail; that result was not independently verified.
Findings
Blocking
None.
Non-blocking
None.
Sources
The wide implementation forces hexadecimal parsing, preserves guest
errno, checks pointer width, and sets stream state in NumGet.cpp at the reviewed head. The new export is registered in the same file, and targeted cases are added in GuestLibcInternalNumGetDoGet.cpp.Not verified
The console module was not inspected, so the wide entry's console ABI and vtable slot order remain unconfirmed. Console behavior and the reported test runs were not independently verified.
To get this to a good state
Nothing is required. Optional: confirm the wide entry's ABI and slot order against the console module.
Imported from boykopovar/AnyPS5. Originally posted by fromthemoonx on 2026-12-04T15:42:32Z.
Review: COMMENTED
One thing to fix in
1d9a4f5b7a: it deletesdocs/dev/debt/changes/feat-libcinternal-num-get-do-get.md, which is main's fragment for the already mergednum_getwork and has not been folded yet.Checked on
main2fbf8b4391:removeentries are still listed indocs/dev/debt/libSceLibcInternal.md. None of those 21 NIDs has a placeholder inErr.cppany more; they are implemented inNumGet.cpp.change num_get<char> and num_get<wchar_t> getentry replaces text in the same file that still says nonum_getfacet implementsdo_get.Without the fragment, the next fold leaves those 21 functions documented as unimplemented and keeps the outdated
getentry.debt_fold.py --checkexiting 0 does not cover this.Restoring the file unchanged is enough:
git checkout <main> -- docs/dev/debt/changes/feat-libcinternal-num-get-do-get.md. The deletion is also what the overlap comment reports against #24748 (L1-51), so restoring it should clear that conflict. Your own fragment forBNZq-mRvDS8can stay as it is.I read the code change and found no problem:
WcharNumGetPointermatches main'sCharNumGetPointerapart from the iterator type. My earlier approval was for5332893723. I have no test result for this head: my Windows build was stopped before the tests for lack of memory on my machine.AI-assisted: yes (Claude)
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.