Skip to content

test(libc): bound C locale UTF-16 transformation writes - #13388

Closed
StoneDC wants to merge 1 commit into
boykopovar:mainfrom
StoneDC:b43/wide-transform-boundary
Closed

StoneDC wants to merge 1 commit into
boykopovar:mainfrom
StoneDC:b43/wide-transform-boundary

Conversation

@StoneDC

@StoneDC StoneDC commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

What

Adds independent guarded runtime coverage for C-locale UTF-16 transformation capacities. Capacity-zero, exact/short/larger destinations, returned full unit lengths and complete output when capacity suffices. It does not assert unspecified destination contents when capacity is insufficient.

Implementation basis: Calls the actual production function(s) through the canonical public Api.hpp; expected results derive from constructed inputs, snapshots, membership tables or standard C++ algorithms. Public contract: https://github.com/freebsd/freebsd-src/blob/833d39bd2e38421a14ea489a956261a0fa993fbc/lib/libc/string/wmemchr.3.

Known limits: Tests valid live spans and buffers only; no invalid-pointer or undefined-overlap behavior is added. No PS5/title execution or firmware object layout is inferred. Uses the existing char16_t declaration, not host wchar_t; code units are opaque and this is not Unicode validation or a width measurement. Only the existing/default C-locale contract is exercised, not other locale collation. Insufficient-capacity transformation bytes are not asserted.

Source/schema: core/libs/prx/libc/src/Strings.cpp core/libs/prx/libc/include/Api.hpp

Exact topic head ec2a173edd49e7f8ae7f91429ba04a70bcf2d9af is one independent commit on main da026c70655a132031d45e2008c24f993870d801. The current-main repository overlap checker against da026c70655a132031d45e2008c24f993870d801 reported no confirmed overlap. It could not finish comparisons for these older PRs already conflicting with main: #5021, #6085, #7081, #7447, #7715, #8150, #8965, #11628, #11661, #11689, #11698, #12688, #12700, #12965. Their shared-file diffs were reviewed separately. 12 scoped file changes projected onto main and then combined with this topic without a new conflict; 2 peer file changes already conflict with main and are not claimed automatically mergeable. They do not provide this command or test matrix. Registration uses a separate target/name and there is no landing-order dependency. Changes to shared registration before landing need a refreshed merge/test check. Depends on: none. The twenty current topic heads are also merged into tested integration 3990a2bd7e0abeaaeeef963a30a3d6508d9b5be3.

Tested

Topic head: ec2a173edd49e7f8ae7f91429ba04a70bcf2d9af. Combined integration: 3990a2bd7e0abeaaeeef963a30a3d6508d9b5be3, based on main da026c70655a132031d45e2008c24f993870d801. Ubuntu/WSL GCC 15.2, CMake 4.2.3, Python 3.14.4; Windows MinGW GCC 15.2, CMake 4.3.1, Python 3.14.3.

The registered test calls the actual libc through canonical headers, using OS-protected pages and real input/output buffers. A separate exact-head control compiled the whole relevant production source unit with this fixture: unchanged production code passed, and the fixture rejected an intentional production-function defect. This is a source-unit control, separately from the product build below.

Registered CTest guest_wide_transform_boundary passed on Linux and Windows as part of the filtered twenty-topic run: ctest --test-dir <build> -R <20-topic-pattern> -j 8 -V --output-on-failure, 20/20 passed on each platform, zero skips. cmake --build <linux-full-build> --parallel 8: complete default Linux product build passed. Windows used the full configuration and built the sixteen affected libc test targets plus relinker with --parallel 8; a complete default Windows build is not claimed. Conventions, whitespace, script registration and the public-header declaration/umbrella audit passed. No PS5, title or GPU validation run is claimed. macOS, WASM execution and hosted full-build CI are not reported as passed.

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

@github-actions

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 5021 core/libs/prx/libc/CMakeLists.txt
PR 6085 core/libs/prx/libc/CMakeLists.txt
PR 7081 core/libs/prx/libc/CMakeLists.txt
PR 7447 core/libs/prx/libc/CMakeLists.txt
PR 7715 core/libs/prx/libc/CMakeLists.txt
PR 8150 core/libs/prx/libc/CMakeLists.txt
PR 8965 core/libs/prx/libc/CMakeLists.txt
PR 10324 core/libs/prx/libc/CMakeLists.txt
PR 11628 core/libs/prx/libc/CMakeLists.txt
PR 11661 core/libs/prx/libc/CMakeLists.txt
PR 11689 core/libs/prx/libc/CMakeLists.txt
PR 11698 core/libs/prx/libc/CMakeLists.txt
PR 12688 core/libs/prx/libc/CMakeLists.txt
PR 12700 core/libs/prx/libc/CMakeLists.txt
PR 12965 core/libs/prx/libc/CMakeLists.txt

@adriadam10 adriadam10 self-assigned this Oct 30, 2026
@adriadam10

Copy link
Copy Markdown
Collaborator

Closing: this PR does not match its description, and it duplicates #13387.

The UTF-16 transformation test described here is not in the PR. You are welcome to reopen, or open a new PR, with the test that matches the description.

@adriadam10 adriadam10 closed this Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants