Repository navigation
feat(libc): implement signed 32-bit minimum value helper - #11309
Conversation
|
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.
|
|
Windows run of head AI-assisted: yes (Claude Code); results above were run on this machine. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed the new export signature, byte-range validation and reduction loop against the stated disassembly evidence. For the supported nonempty 4-byte-aligned span, the first read initializes the result, each subsequent read uses the existing unaligned-safe helper, and the signed comparison preserves INT32_MIN/negative ordering without modifying the input. Null, empty, reversed and partial-element ranges are explicitly outside the established contract and route to the project’s unimplemented path with that gap recorded in libc debt. The focused Windows/WSL differential, boundary/unaligned/canary tests and negative controls are extensive; hosted relinker/ASan, public-header and policy checks pass, while full Linux/Windows product jobs were skipped by path policy. No blocking issue found.
MarcZX10
left a comment
There was a problem hiding this comment.
The exact implementation remains sound on the reviewed head, and the reported Windows/WSL differential, boundary and negative-control evidence is strong. I refreshed branch sync against current upstream/main 204c6747d0a1cbaf932def3dea0778810cc3935e: this head is 1 ahead / 178 behind. The merge preview is clean; docs/dev/debt/libc.md is the only touched PR path changed on main since the base, and the new debt entries merge cleanly. This request is for the repository branch rule to keep PRs current, not a newly found implementation defect. Please rebase, preserve the debt entry, and rerun guest_vector_algorithms and public_headers on the resulting exact head.
937e962 to
ab2c0fa
Compare
Dismissing as non-blocking per the maintainer team's review policy.
ab2c0fa to
e2f17a9
Compare
e2f17a9 to
762556e
Compare
What
Implement libc's
__std_min_4i(lpMzqv5j5HY) for nonempty ranges of signed 32-bit integers. Return the minimum value, allow unaligned input, and leave the range unchanged. Null, empty, reversed and partial-element ranges callNotImplemented_nid_no_patch; the remaining native failure behavior is recorded in libc's debt file. The implementation is a generic scalar reduction using the existing unaligned read helper.Contract evidence: the user's own PPSA03671 v01.001.005 bundled
libc.prx, ELF SHA256483961e086b8a1fffa8138b3c0badf798987fb5f35ec908d828946408be2d8a6, dynamic exportlpMzqv5j5HY, RVA0x624d0, size0x1a2. The entry usesrdi/rsias the range bounds;0x624f3reads one 32-bit value,0x62510usesvpminsd, and the scalar tail at0x62663/0x62665selects with signedcmovl. The result reachesretat0x62671ineax. Complete 16-byte blocks are bounded by the rounded-down byte length, and the remaining reads advance by four to the exclusive end. The function has no stores or calls. Empty input has no separate result path and enters a read. This is disassembly and direct execution on a host, not a console measurement; no original initializer or other original export was executed.The two-pointer signature and
int32_tresult are also corroborated by Microsoft STL at b6f01e438b68ee497f9c08313e49d12bb2f0d8e0. The implementation was written from the module's contract, without copying its SIMD structure. No game files, binary bytes, dumps or keys are included.Tested
Current-main synchronization (27 October 2026). Exact tested/published head:
762556eb2d9f4ca729c00b8d3dedab3fd09e2897. Main base:cb45ae2ddf6e113a4619e8fed91fe7b9333c5c0f.e2f17a9aa59d7400457f980289615fd84eee2294onto the two newer main commits. Main changed only thewindows_crash_stack_wordstest regex incore/libs/prx/libc/CMakeLists.txt(fix(main): windows_crash_stack_words regex crossed by '~' in register dump #11633). The entire four-file contribution patch is byte-identical before and after the rebase; no implementation or regression assertion changed.guest_vector_algorithms_testsin the existing full-project Release configurations.guest_vector_algorithmsandpublic_headerspass 2/2 on Windows 11 / WinLibs GCC 15.2.0 and 2/2 on Ubuntu 24.04 WSL / GCC 13.3.0.7da0577e45f238c6bfa01a818bd7e27f727ebeffalso builds and passes both focused tests on Windows and Ubuntu. This synchronization ran 32 focused checks in total across the seven individual heads and the combined head.a27d73c1f43135378c54ed6477af71273135ec42; only the unrelated upstream CMake regex differs. The previous original-module differential, standalone-header and AddressSanitizer evidence below retains its stated revisions and was not rerun for this synchronization.Earlier implementation validation and provenance
Current-main refresh (27 October 2026). Exact tested/published head:
e2f17a9aa59d7400457f980289615fd84eee2294. Fetched main base:74acfad65b3f0fd4eab653f3a3989d298fba1157.ab2c0faa2ac1c6ea372cef0a9111fdbfd31fa70c. The__std_min_4iproduction body is byte-identical to that head. Every existing main declaration and debt entry is preserved; the patch still changes only the implementation, public declaration, regression cases and debt entry.guest_vector_algorithms_tests;ctest --test-dir build -R "^(guest_vector_algorithms|public_headers)$" -V --output-on-failurepassed 2/2 on this exact head (19.69 s).a27d73c1f43135378c54ed6477af71273135ec42also builds and passes both focused checks on Windows and Ubuntu.92db947130efc9e7e12c492683329f2ebc3e1996merges cleanly with the main base, each individual helper and the seven-helper composition. This is a content-merge check for feat(libc): implement _Thrd_lt #10788; its implementation was not part of the combined runtime run.tools/check_main_sync.py --base origin/main --head e2f17a9aa59d7400457f980289615fd84eee2294 --strictpass. The sync check is one ahead and zero behind the fetched main base above. Bundled dependencies use that base's pinned revisions; no contribution dependency was introduced.public_headersaudits unique declarations and umbrella coverage. Its current upstream 90-second timeout is unchanged. The full set of 64 standalone-header batches and the full CTest suite were not run; the targeted header checks below were added afterward.Additional validation on 27 October 2026, combined revision
a27d73c1f43135378c54ed6477af71273135ec42(the same seven-helper composition described above):include/Api.hpp,include/exceptions/Runtime.hpp,include/exceptions/Unwind.hpp,include/SonyCrt.hpp, andlibc.hpp), plus a compilation unit including all 368 library umbrellas together, pass with C++20 and-Werroron Windows/WinLibs GCC 15.2.0 and Ubuntu/GCC 13.3.0. Every header is included twice, and the existing checker also rejects third-party header dependencies: 6 compilation units per platform, all pass. This is targeted coverage, not the full 64-batch matrix.ANYPS5_ENABLE_ASAN=ON, RelWithDebInfo, rebuilt libc andguest_vector_algorithms_tests.ASAN_OPTIONS=halt_on_error=1:detect_leaks=1 ctest --test-dir build-asan-libc-followup-20261027-a -R '^guest_vector_algorithms$' -V --output-on-failurepassed 1/1, with no AddressSanitizer or LeakSanitizer finding.The earlier differential and negative-control results below belong to their stated heads. The original-module differential was not rerun for this refresh. No console, title or GPU execution and no performance claim.
Earlier implementation validation and provenance
Current-main refresh (26 October 2026), exact published/tested head
ab2c0faa2ac1c6ea372cef0a9111fdbfd31fa70c, main basebf77a9e9cba4b02c358779b35295176dd9cae164:937e9625661a38b25cdad0f97875d9fb86e96f79onto the main base above. All existing main declarations and debt entries are retained. The__std_min_4iproduction function body is byte-identical to the previously reviewed head; the patch still changes only its implementation, public declaration, regression cases and debt entry.guest_vector_algorithms_tests;ctest --test-dir build -R "^(guest_vector_algorithms|public_headers)$" -V --output-on-failurepassed 2/2 on this exact head (18.88 s).public_headersis the unique-declaration and umbrella-coverage audit; standalone-header compilation batches and the full CTest suite were not run in this refresh.tools/check_conventions.py --base origin/main, PR-diff whitespace checks andtools/check_main_sync.py --base origin/main --head ab2c0faa2ac1c6ea372cef0a9111fdbfd31fa70c --strictpass. The sync check reports one commit ahead and zero behind the fetched main base above.The previous baseline, differential and negative-control evidence below belongs to the earlier heads stated there. The original-module comparison was not rerun for this rebase-only refresh, and no console measurement was made.
Earlier implementation validation and provenance
libs,relinkerandguest_vector_algorithms_tests;guest_vector_algorithmsandpublic_headerspassed on the baseline and the change, and again after rebasing onto currentmain.guest_vector_algorithms_tests, and passed the same two tests on the baseline and the final change. WSL reports the existing asynchronoususerfaultfdwrite-watch fallback to memory comparison; this is a host test, not a console measurement.INT32_MIN/INT32_MAX, deterministic random data, 20 lengths from 1 through 257, all 32 byte offsets, repeated values, the minimum at every position, and unchanged inputs and canaries. Unsupported-input throws are not pinned by tests.guest_vector_algorithmsandpublic_headerstogether on Ubuntu. They remain independent contributions.tools/check_conventions.py --base origin/mainpassed.tools/pr_overlap.py --branch feat/libc-signed-min32found no confirmed line, export or new-file overlap after relocating only the additions. Shared-file patches from PRs already conflicting withmainwere checked separately: their existing per-file conflict blocks are unchanged by this patch.Investigation scripts, evidence and logs remain outside the repository. No title bring-up or performance improvement is claimed.
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)