Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The exact-head test is registered and checks the bounded-copy padding, truncation, return value, source preservation, and guarded write extent; no blocking issue was found in the source review.
What I ran
Reviewed PR head 8671223b16d01ad643e993fec0326bbc50fd57f9 against current main 58d5af7daa8087d2ffbdb50ae6e0db3cb6a88e48; the merge preview was clean (tree 0a3636f682677a35e49c006cbcd00607efc0990e). Environment: Debian 12 x86-64, Python 3.11.2, Git 2.39.5, GCC 12.2.0. I did not build or run C++ tests locally. Linux and Windows test results below are author-reported for a combined integration containing this exact topic head, not independently run by me. Hosted PR checks were queued at the final refresh.
git diff --check 58d5af7daa8087d2ffbdb50ae6e0db3cb6a88e48...8671223b16d01ad643e993fec0326bbc50fd57f9
python3 tools/check_conventions.py --base 58d5af7daa8087d2ffbdb50ae6e0db3cb6a88e48 --head 8671223b16d01ad643e993fec0326bbc50fd57f9 --title 'test(libc): guard UTF-16 bounded copy padding and truncation' --body /tmp/pr-13320-body.md
python3 tools/pr_stack_check.py 13320 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-13320-stack-current
python3 tools/pr_test_quality.py --root /tmp/anyps5-review-13320 --json core/libs/prx/libc/CMakeLists.txt core/libs/tests/GuestWcsncpyExtent.cpp
gh pr checks 13320 -R boykopovar/AnyPS5Results
| Check | Result |
|---|---|
| Diff whitespace | Passed; no output from git diff --check. |
| Conventions and PR template | Passed against current main. |
| Current-main merge preview | Passed; clean tree 0a3636f682677a35e49c006cbcd00607efc0990e; no declared dependencies. |
| Test registration/source review | The target and CTest are registered in the changed CMake file. Assertions cover zero, shorter, exact, and longer inputs; destination terminator padding; truncation; return pointer; unchanged source; and eight prefix units. |
| Test-quality heuristic | Reported a possible test registration issue; manual inspection confirmed registration via ${LIBS_INCLUDE_DIR}/tests/GuestWcsncpyExtent.cpp. |
| Author-reported tests | The author reports guest_wcsncpy_extent and a filtered 20-topic CTest set passed 20/20 on Linux and Windows in an integration containing this exact topic head, plus an exact-head intentional-defect control. I did not independently run these. |
| Hosted CI | All six jobs were queued at final refresh; no hosted result is claimed. |
| Build and local C++ execution | Not run locally. |
Unedited local command output
git diff --check produced no output.
Conventions:
All conventions checks passed.
Test-quality heuristic:
{
"findings": [
{
"path": "core/libs/tests/GuestWcsncpyExtent.cpp",
"line": 1,
"kind": "possible-unregistered-cpp-test",
"message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
}
],
"negative_control_candidates": [],
"limits": [
"Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
"A test that passes against base is not by itself proof that the PR test is inadequate.",
"Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
]
}Stack check:
# PR stack check — fresh
Target: https://github.com/boykopovar/AnyPS5/pull/13320
Target branch tip: `58d5af7daa8087d2ffbdb50ae6e0db3cb6a88e48`
All heads unchanged: **True**
Dependency order: #13320
## Individual merge previews
- PR #13320: **clean** against current base; head `8671223b16d01ad643e993fec0326bbc50fd57f9`; changed paths: none reported
## Dependency relationships
No declared PR dependencies were found in the target PR chain.
Hosted checks at final refresh:
conventions pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41056381420/job/124064846097
eligibility pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41056381618/job/124064845389
intake pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41056381457/job/124064845998
labels pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41056381562/job/124064846693
library-portability pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41056381926/job/124064846140
report pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41056381544/job/124064844534
Negative control
| Assertion | Mutation reported by author | Result |
|---|---|---|
| Fixture detects an incorrect bounded-copy implementation | Author reports an intentional production-function defect in the exact-head source-unit control | Author reports the fixture rejected the mutation; I did not independently run this control. |
Findings
Blocking
None found in the reviewed source.
Non-blocking
The C++ test and mutation control were not independently run here; I relied on the author's reported integration results. Hosted PR checks were still queued at the final refresh.
Sources
- Registered
guest_wcsncpy_extenttarget. - Guarded test cases and assertions.
- Production
wcsncpy_nid_postfiximplementation.
Not verified
No local build or C++ execution; no independent Linux/Windows run; no macOS, WASM runtime, title, or console testing. Hosted checks were queued.
|
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.
|
|
Investigated the failed macOS checks on unchanged head Both logs stop in The existing fix is #13220 at The independent functional test scope is unchanged; the remaining macOS CI blocker is the shared registration fix. AI-assisted: yes. |
|
Integrated the existing shared CI fix at new head #13220's original commit Fresh local verification:
Hosted-check snapshot at 2026-10-30T17:36:36+00:00 (UTC): 2 pending. Current-head checks. Earlier red checks belong to heads without the prerequisite; new-head CI remains pending until it completes. Please re-check this integrated head. AI-assisted: yes. |
What
Adds positive-length wcsncpy tests through 128 units with shorter, exact and longer sources. It checks full-unit zero padding, nonterminated truncation, returned base, source preservation and guarded write extents.
Integrate the existing #13220 fix at
e9f09f54fabb6408d3e2711b8df10c10112ab00eand current recorded main. The failed macOS write-watch jobs stopped in CMake configuration because execute-fault and read-fault were each registered twice. This head includes the original prerequisite commit, removing the duplicate block while retaining all 18 distinct tests. No parallel fix is introduced, no test assertion is weakened, and no timeout is changed.This PR's fixture is byte-identical to the previous published head
8671223b16d01ad643e993fec0326bbc50fd57f9. The extra topic-relative CI change is the existing prerequisite's five-line registration deletion. Proposed landing order is #13220 first, then this independent topic. The submitted head already includes the fix, so its new CI can test it while the prerequisite PR remains open.Original topic rationale and earlier overlap evidence (historical snapshots)
Adds positive-length wcsncpy tests through 128 units with shorter, exact and longer sources. It checks full-unit zero padding, nonterminated truncation, returned base, source preservation and guarded write extents.
Implementation basis: Public string/memory contract: https://github.com/freebsd/freebsd-src/blob/833d39bd2e38421a14ea489a956261a0fa993fbc/lib/libc/string/wmemchr.3. The fixture calls the actual production function(s) through the existing public Api.hpp and constructs expected results separately from immutable input snapshots, membership tables or standard C++ range algorithms. No production function body or firmware object is copied into the fixture.
Known limits: Uses char16_t as already declared by the repository; it does not infer console object layouts, validate Unicode, add Annex K policies or replace existing zero-length tests.
Source/schema: core/libs/prx/libc/src/Strings.cpp core/libs/prx/libc/include/Api.hpp
Exact topic head
8671223b16d01ad643e993fec0326bbc50fd57f9is one independent commit on main51c31ea17e9f66cb36fe9655ec31c81610bfcfc9. The current-main repository overlap checker against51c31ea17e9f66cb36fe9655ec31c81610bfcfc9reported 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, #11947, #12688, #12700, #12965. Their shared-file diffs were reviewed separately. 13 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. Functional overlap remains independent; the shared macOS CI prerequisite is #13220. The twenty current topic heads are also merged into tested integrationcedab5157a32822332671c90812c6780d05157e8.Shared CI prerequisite: #13220 fixes main's duplicate write-watch fault-test registration. The macOS write-watch jobs currently fail in CMake configuration before compiling or executing this PR's fixture. This PR needs that existing fix first for the shared macOS checks; no duplicate implementation or unrelated source change is added here.
Tested
Exact submitted head
f27454e88a02dd9c9f0510d3afb0aa72378f7e87. Recorded main6a3afa4deb18ea58a90efb8040fff8c60e4f2aab; prerequisite #13220e9f09f54fabb6408d3e2711b8df10c10112ab00e. Both and the previous published topic head are ancestors. The fixture and topic assertions remain unchanged.Fresh native validation uses combined commit
099d1af76d85818308412d7dd864f8bb4a1cd013, containing all 13 exact submitted heads, on Windows 11 / MinGW GCC 15.2 / CMake 4.3.1 and non-root Ubuntu 26.04 / WSL / GCC 15.2 / CMake 4.2.3. This is explicit combined-commit validation, not 13 separate native product builds. Every individual fixture blob matches that combined tree; pairwise main/prerequisite merges are clean.guest_wcsncpy_extentis included exactly once. No timeout was raised.The combined native target build is not the complete default product build. No local macOS/WASM, PS5/title/GPU or firmware validation is claimed. Old red CI belongs to older heads without the prerequisite; new-head hosted CI starts after publication and remains pending until it actually completes. The prerequisite's external branch is unchanged.
Exact composition of the fresh native validation
#13310
ab8eeea15ea0dcb8aabe95e656a041963f8e4e8a, #133131ec676984f08d1ee65496d0d1c487a9fecb8ec49, #133141c8549945e9657645da7ce5a98693d50e85b5685, #13317442aef391ffaec2c9cfe1d098c84dde5f19cd292, #13319dab492c88b6bd8093c351b1726db02ad91af39ab, #13320f27454e88a02dd9c9f0510d3afb0aa72378f7e87, #133788bb9ed3e152ea1611fe8216f25dd03c7830f2818, #133799b39858ef369da4f3eb01e4137e3f932a478ebd2, #133806083413b06d03a34e498629da942b8ec40ab7a9f, #13381cf303f4142403e370f807813b99fc5aa087ad72b, #1339115fbf68aa97b2617cd03ae94f033020028edeac6, #13394cb3188c2b1f36700f882311191f86b897c4f01cb, #133958165ef480879e5eed57eb8f631abc924aed02ec7Earlier author-reported validation (historical heads; not new results)
Topic head:
8671223b16d01ad643e993fec0326bbc50fd57f9. Combined integration:cedab5157a32822332671c90812c6780d05157e8, based on main51c31ea17e9f66cb36fe9655ec31c81610bfcfc9. 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_wcsncpy_extentpassed 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
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)