Repository navigation
Conversation
AI-assisted: yes. Part of the locally tested library change. Full libs build and six focused Windows tests pass; Linux and games have not been run.
AI-assisted: yes. Part of the locally tested library change. Full libs build and six focused Windows tests pass; Linux and games have not been run.
AI-assisted: yes. Part of the locally tested library change. Full libs build and six focused Windows tests pass; Linux and games have not been run.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed the full diff against the FreeBSD memmem contract. The implementation handles the zero-length needle and too-short haystack before forming/dereferencing ranges, searches bytes (including embedded NULs), and returns the first match. The randomized binary oracle and guard-page cases are useful boundary coverage. I built and ran the exact head on Linux with GCC 12; guest_memmem passed (1/1, 0.02 s). Conventions and diff checks pass. The PR reports Windows builds and tests; upstream currently has no check results for this fork head.
|
Closing: no title is shown to reach |
…time test Harvested from upstream (closed unmerged); library completion 2923/3295 -> 2924/3296. Additive conflicts resolved by keeping both sides: core/libs/prx/libc/CMakeLists.txt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011krDVCnnMQPaEFEqCDnKmA
What
Adds
memmem(AyXlXD4Y3n8) using bounded binary search. Returns the first match, handles embedded NUL bytes, returns the haystack for an empty needle, and rejects a needle longer than the haystack without reading it. No heap allocation or guest errno changes. Reference: FreeBSD memmem.Tested
guest_memmempasses: 5,000 generated cases checked against an independent binary string-search oracle, explicit repeated-prefix and NUL/high-bit inputs, and both buffers positioned immediately before inaccessible pages over multiple lengths.Windows 11, WinLibs MinGW-w64 GCC 15.2.0 r7 UCRT/posix/SEH, Ninja Release,
BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=ON; basef145139676a48306681d3a4d5fabf83938759daf.Combined validation of these three independent branches: full
libstarget built successfully, including NID patching;guest_memmem,guest_bcopy, both line-input tests,guest_standard_streams, andguest_errorspass (6/6). All four NIDs are present in patchedlibc.prx. Conventions, diff whitespace and test registration checks pass. The branches were also built and tested individually before integration.Before publication, actual library diffs of 559 candidate PR heads were checked for these names and NIDs, including broad PRs and newer heads; no other implementation of these four exports was found. The candidates cover the cached open-PR list and every newer PR head; some candidates may have closed since that list was read.
Linux, console behavior, games and the complete CTest suite have not been run. This adds documented libc interfaces; no particular title starting successfully is claimed.
Checklist
main; no other open PR implements the same functions