feat(libc): implement wide string modifiers and narrow insert #17668

Merged
B-Howell merged 5 commits from upstream-pr/17668 into main 2026-11-12 04:23:38 +00:00
B-Howell commented 2026-11-09 08:48:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by B-Howell on 2026-11-09T08:48:13Z.


What

Implement seven wide basic_string modifiers and narrow insert in libSceLibcInternal. The guest layouts, allocation rules and error behavior follow the pinned SDK libc ELF described in the library's technical debt. The guest test exercises inline and heap strings, growth, overlapping source ranges, range errors and allocation failure. Native console parity remains unverified. The same eight NIDs are retained and no exports are added.

Tested

On 4e2b02176aa2a4581a5c8522c931f4f4a31945fe, Windows 11 with WinLibs GCC 15.2.0 UCRT passed the basic-string and ConstantMembers guest tests 3/3 each and all 65 public-header checks. Ubuntu WSL2 with GCC 11.4 passed both guest tests 3/3 each and all 65 public-header checks. Both build checkouts restored cleanly. The Windows negative control over 75c65bf retained the behavior assertions and used test-local bridges to call the existing named stubs. The focused target built successfully. CTest exited 8 and reported all eight expected throwing stubs on c611532e.

Conventions passed. The overlap scan screened 1,956 open PRs, with exact patch checks for all 12 skipped comparisons and eight new or moved heads. #17300 renames three of these throwing stubs and leaves their bodies unchanged. See the coordination comment. If that PR lands first, the three renamed stubs need to be replaced by these implementations. This branch retains #15696's six landed providers and tests.

The pinned tools/progress.py collector counts 12,680 of 37,899 implemented library functions (33.46%), up from 12,672 (33.44%) on 75c65bf. libSceLibcInternal rises from 299 to 307 of 1,137.

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 Codex

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5221185899 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17668). Originally posted by [B-Howell](https://github.com/B-Howell) on 2026-11-09T08:48:13Z. --- ### What Implement seven wide basic_string modifiers and narrow insert in libSceLibcInternal. The guest layouts, allocation rules and error behavior follow the pinned SDK libc ELF described in the library's technical debt. The guest test exercises inline and heap strings, growth, overlapping source ranges, range errors and allocation failure. Native console parity remains unverified. The same eight NIDs are retained and no exports are added. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> On `4e2b02176aa2a4581a5c8522c931f4f4a31945fe`, Windows 11 with WinLibs GCC 15.2.0 UCRT passed the basic-string and ConstantMembers guest tests 3/3 each and all 65 public-header checks. Ubuntu WSL2 with GCC 11.4 passed both guest tests 3/3 each and all 65 public-header checks. Both build checkouts restored cleanly. The Windows negative control over 75c65bf retained the behavior assertions and used test-local bridges to call the existing named stubs. The focused target built successfully. CTest exited 8 and reported all eight expected throwing stubs on `c611532e`. Conventions passed. The overlap scan screened 1,956 open PRs, with exact patch checks for all 12 skipped comparisons and eight new or moved heads. #17300 renames three of these throwing stubs and leaves their bodies unchanged. See the [coordination comment](https://github.com/boykopovar/AnyPS5/pull/17300#issuecomment-6733753107). If that PR lands first, the three renamed stubs need to be replaced by these implementations. This branch retains #15696's six landed providers and tests. The pinned tools/progress.py collector counts 12,680 of 37,899 implemented library functions (33.46%), up from 12,672 (33.44%) on 75c65bf. libSceLibcInternal rises from 299 to 307 of 1,137. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes 🤖 Generated with [Codex](https://openai.com/codex)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!17668
No description provided.