Skip to content

feat(libc): implement the std::__sce_v2 num_get virtuals for wchar_t integers, bool and pointers - #16924

Open
Danigamer05 wants to merge 16 commits into
boykopovar:mainfrom
Danigamer05:feat/libc-sce-v2-num-get-wide-20261107
Open

Danigamer05 wants to merge 16 commits into
boykopovar:mainfrom
Danigamer05:feat/libc-sce-v2-num-get-wide-20261107

Conversation

@Danigamer05

@Danigamer05 Danigamer05 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

What

Builds on #16919: this branch contains its commits, and through it #16560, #16516, #16214, #16178 and #15923, with current main merged in. Until they merge, only the last commit is this PR's change.

Implement the same eight do_get virtuals of std::__sce_v2::num_get<wchar_t> that #16919 implements for char: bool, unsigned short, unsigned int, long, unsigned long, long long, unsigned long long and void*. Before this PR, each of them threw NotImplemented_nid_no_patch. The float, double and long double slots still throw. These slots are not exports, so this PR adds no NID.

The behavior comes from the libc.prx bundled with PPSA03671 v01.001.005 (J03848509, SHA-256 483961e086b8a1fffa8138b3c0badf798987fb5f35ec908d828946408be2d8a6), vtable 0x18CDD0, field reader 0xE3350. The module's wide functions follow the same steps as the char ones, so the code of #16919, already a template on the character type, is now instantiated for 16-bit characters too:

  • The iterator holds a 16-bit character at offset 0xa, reads two bytes from the get area and moves its pointer by two bytes. underflow and uflow end the input only on -1, so U+FFFF is a character.
  • The digits, signs and prefix letters come from ctype<wchar_t>::widen, and every comparison, with them, with the thousands separator and with the bool names, uses all 16 bits.
  • numpunct<wchar_t> gives a 16-bit separator and 16-bit names, while grouping stays narrow.

The _Makeloc and num_get debt entries now cover both facets.

Tested

Windows 11, MinGW GCC 15.2, Release, head on top of #16919. Not run on Linux or macOS, not run in a title.

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: feat(libc): implement the std::__sce_v2 num_get virtuals for char integers, bool and pointers #16919
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

Danigamer05 and others added 13 commits November 5, 2026 21:33
…irtuals for char

The facets built by _Makeloc threw NotImplemented from every virtual
except the lifecycle slots. The char ctype, numpunct and codecvt facets
now answer as the console's libc.prx does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…irtuals for wchar_t

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main removed GuestStringInlineCapacity, GuestStringCapacityMask and
GuestStringLargeAllocation from LocaleSupport.cpp, so the versioned
facets' strings use GuestLocale::StringInlineCapacity,
GuestLocale::StringCapacityMask and GuestStringStorage::Deallocate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…egers, bool and pointers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main removed GuestStringInlineCapacity and GuestStringCapacityMask from
LocaleSupport.cpp, so AssignSceV2String uses
GuestLocale::StringInlineCapacity and GuestLocale::StringCapacityMask.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main removed GuestStringInlineCapacity and GuestStringLargeAllocation
from LocaleSupport.cpp, so TakeSceV2String tests
GuestLocale::StringInlineCapacity and frees through
GuestStringStorage::Deallocate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sce-v2-num-put-wide-20261107

Brings in current main through boykopovar#16516. The templated TakeSceV2String
frees through GuestStringStorage::Deallocate, since main removed
GuestStringLargeAllocation from LocaleSupport.cpp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…integers, bool and pointers

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

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

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 7715 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8965 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 9087 docs/dev/debt/libc.md
PR 11661 docs/dev/debt/libc.md
PR 11689 docs/dev/debt/libc.md
PR 11698 docs/dev/debt/libc.md
PR 12682 core/libs/prx/libc/CMakeLists.txt
PR 12688 core/libs/prx/libc/CMakeLists.txt
PR 12700 core/libs/prx/libc/CMakeLists.txt
PR 12717 core/libs/prx/libc/CMakeLists.txt
PR 12849 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 12965 core/libs/prx/libc/CMakeLists.txt
PR 15973 docs/dev/debt/libc.md
PR 17746 core/libs/prx/libc/include/GuestLocale.hpp
core/libs/prx/libc/src/LocaleSupport.cpp
PR 23395 core/libs/prx/libc/CMakeLists.txt
PR 24907 core/libs/prx/libc/include/GuestLocale.hpp
core/libs/prx/libc/src/LocaleSupport.cpp
PR 25573 core/libs/prx/libc/include/GuestLocale.hpp
core/libs/prx/libc/src/LocaleSupport.cpp
PR 28051 core/libs/prx/libc/CMakeLists.txt
PR 28565 core/libs/prx/libc/CMakeLists.txt
PR 28568 core/libs/prx/libc/include/GuestLocale.hpp
core/libs/prx/libc/src/LocaleSupport.cpp
PR 28709 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/include/GuestLocale.hpp
PR 28808 core/libs/prx/libc/CMakeLists.txt

@JJenkx

JJenkx commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Windows check of head 56966246ae, merged onto main 78976e2657 (c0563aacbe, clean merge).

Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.

  • guest_sce_v2_char_facet_virtuals, guest_sce_v2_facet_ids, guest_sce_v2_makeloc, guest_sce_v2_num_get_char, guest_sce_v2_num_get_wide, guest_sce_v2_num_put_char, guest_sce_v2_num_put_wide pass in 3 of 3 runs, none skipped.

AI-assisted: yes.

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

ycbuzi commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Tested b9402d405f merged into main, with the whole ctest suite on each machine below. Nothing fails that does not also fail on main on the same machine.

  • Windows Server 2022 (GitHub-hosted runner), full build, WinLibs GCC 15.2.0: 99% tests passed, 4 tests failed out of 5497; 99% tests passed, 5 tests failed out of 5497. 4 of the failing tests fail on main too. run
  • Windows Server 2025 (GitHub-hosted runner), full build, WinLibs GCC 15.2.0: 99% tests passed, 2 tests failed out of 5497; 99% tests passed, 2 tests failed out of 5497. 2 of the failing tests fail on main too. run

AI-assisted: yes (Claude Code); the runs are automated, this summary was written from their reports.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 17, 2026
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 20, 2026

@MarcZX10 MarcZX10 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.

Reviewed — no blocking findings

The review artifacts and repository source were not accessible in this session, so the change could not be verified.

What I ran

Not run; repo_read.py was unavailable.

Results

Check Result Note
Change review not run Source could not be read

Findings

Blocking

None verified.

Non-blocking

None.

Not verified

The description, commits, diff, manifest, changed files, and repository context were not read. No checks were run.

To get this to a good state

Nothing is required.

@ligmaSec ligmaSec left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I ran guest_sce_v2_num_get_wide and guest_sce_v2_num_get_char with c95d56ec56 and its prerequisite stack integrated into a Linux release build. Both passed. The wide fixture exercises the integer, boolean and pointer slots added here, and the char fixture checks the stacked implementation alongside it.

AI-assisted: yes.

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.

5 participants