Repository navigation
feat(libc): implement unsigned 32-bit maximum - #11304
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 implementation directly. Its nonempty uint32_t range check makes the initial read valid under the stated contract; the existing unaligned-safe Read helper and unsigned comparison implement the observed reduction without modifying memory. Unsupported ranges route to NotImplemented_nid_no_patch and the exact remaining failure gap is recorded in libc debt. The direct original-module differential, independent reference, unaligned/canary/boundary coverage and negative controls provide strong evidence. Hosted policy and the Linux/macOS/Windows relinker, ASan, register-context, write-watch and public-header checks pass; 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 differential and regression evidence is strong. I refreshed branch sync against current upstream/main 204c6747d0a1cbaf932def3dea0778810cc3935e: this head is 1 ahead / 185 behind. The merge preview is clean; the only touched PR path changed on main since the base is docs/dev/debt/libc.md, so preserve both entries when rebasing. This request is for the repository branch rule to keep PRs current, not a newly found implementation defect. Please rebase and rerun guest_vector_algorithms and public_headers on the resulting exact head.
b58a62b to
8c42218
Compare
Dismissing as non-blocking per the maintainer team's review policy.
8c42218 to
9989ee7
Compare
9989ee7 to
5f08cbf
Compare
What
Add the missing libc export
__std_max_4u(fxmF53LHALE): return the maximum value in a nonempty range of unsigned 32-bit elements. The existingmemcpyread helper accepts unaligned input and leaves it untouched. The export is declared once in publicApi.hpp, which the tests include. Null, empty, reversed and partial-element ranges callNotImplemented_nid_no_patch; native failure behavior for those cases is not reproduced and is recorded in debt. Tests cover valid inputs without pinning unsupported paths.Contract evidence: the
libc.prxbundled with PPSA03671 v01.001.005 exports this NID at RVA0x635e0, size0x1a2; ELF SHA256483961e086b8a1fffa8138b3c0badf798987fb5f35ec908d828946408be2d8a6. Reading the original confirms range pointers inrdi/rsi, 4-byte elements, unsigned maximum selection (vpmaxudat0x63620andcmovbe %ecx,%eaxat0x63775) and a value returned ineax. It has no calls or image-relative data references. The original function was also run directly from its isolated mapped load segments on this Windows host without relocations, module initializers or other original exports. This is a host differential, not a console measurement. Microsoft STL's public implementation independently corroborates the unsigned 32-bit value-returning signature. The implementation is a generic scalar scan written from that contract.Main (
a3987a1ecad24fd8f3d7b41fdc1fd983e2042a8f) and all 1,377 open PR heads were scanned for the name and raw NID before implementation: no matches. No third-party code, module bytes or title files are added. No current title dependency, title unblock or performance improvement is claimed.Tested
Current-main synchronization (27 October 2026). Exact tested/published head:
5f08cbf1b3d800915add2582a2c8c7ccd3551f36. Main base:cb45ae2ddf6e113a4619e8fed91fe7b9333c5c0f.9989ee731bc66cf1baf5be173b14ee73d4e6bb99onto 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:
9989ee731bc66cf1baf5be173b14ee73d4e6bb99. Fetched main base:74acfad65b3f0fd4eab653f3a3989d298fba1157.8c42218ac3131a214ea38f99b16884d753bfdbb0. The__std_max_4uproduction 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.37 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 9989ee731bc66cf1baf5be173b14ee73d4e6bb99 --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
8c42218ac3131a214ea38f99b16884d753bfdbb0, main basebf77a9e9cba4b02c358779b35295176dd9cae164:b58a62b48b5f845dd4a93420534a767857165cddonto the main base above. All existing main declarations and debt entries are retained. The__std_max_4uproduction 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.85 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 8c42218ac3131a214ea38f99b16884d753bfdbb0 --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
Base:
504ea3b53b237a5ea99e6daeee23b1edf3758368. Tested/published head:b58a62b48b5f845dd4a93420534a767857165cdd.BUILD_TESTING=ON, full-project configuration: built productionlibs,relinkerandguest_vector_algorithms_tests.guest_vector_algorithmsandpublic_headerspassed on unmodified maina3987a1ecad24fd8f3d7b41fdc1fd983e2042a8f. Added regression cases cover single values, all pairs of eight unsigned edge values, sign and 16/32-bit boundaries, 20 lengths through 257 elements, offsets 0–31, unchanged input and surrounding canaries, repeated maxima, all-zero ranges and a unique maximum at every position.ctest --test-dir build -R "^(guest_vector_algorithms|public_headers)$" -V --output-on-failure: both pass on Windows at the published head.public_headersis the unique-declaration and umbrella-coverage audit; standalone-header compilation batches and the full CTest suite were not run.UINT32_MAXand all pairs of eight edge values. Inputs remain unchanged.Overlap: the required
tools/pr_overlap.py --branch feat/libc-unsigned-max32 --repo boykopovar/AnyPS5scan against504ea3b53b237a5ea99e6daeee23b1edf3758368was retained as a full checker snapshot. After rebasing to that main and relocating the debt entry, the branch comparison was rerun with the same checker against the unchanged snapshot: no confirmed overlap. All 50 stale shared-file patches were manually inspected against their merge bases: #5021, #5303, #6713, #7081, #7386, #7447, #7544, #7648, #7715, #8150, #8417, #9269, #9371, #9447, #9526, #9669, #9771, #9863, #9873, #9929, #10007, #10113, #10158, #10200, #10222, #10226, #10229, #10234, #10283, #10315, #10316, #10317, #10321, #10325, #10328, #10345, #10349, #10405, #10467, #10468, #10506, #10510, #10512, #10529, #10565, #10610, #10742, #10788, #10898, #10927. None changes this export or its adjacent declarations/debt entry. Those stale branches are not claimed merge-clean. Trial merges with our independent #10460, #11289, #11295, #11300 and #11302 succeed without content conflicts; no dependency on them.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)