feat(libc): implement signed 32-bit maximum value helper #11333

Merged
Danigamer05 merged 1 commit from upstream-pr/11333 into main 2026-10-28 18:27:25 +00:00
Danigamer05 commented 2026-10-26 03:59:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Danigamer05 on 2026-10-26T03:59:27Z.


What

Implement libc's __std_max_4i (GE0yqFd83PA) for nonempty ranges of signed 32-bit integers. Return the maximum value, allow unaligned input, and leave the range unchanged. Null, empty, reversed and partial-element ranges call NotImplemented_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 SHA256 483961e086b8a1fffa8138b3c0badf798987fb5f35ec908d828946408be2d8a6, dynamic export GE0yqFd83PA, RVA 0x63430, size 0x1a2. The entry uses rdi/rsi as the range bounds; 0x63453 reads one 32-bit value, 0x63470 uses vpmaxsd, and the scalar tail at 0x635c3/0x635c5 selects with signed cmovle. The result reaches ret at 0x635d1 in eax. 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_t result 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

Documentation-overlap follow-up (27 October 2026). Exact tested/published head: f139bcf1fc29cca5d3e26c90e7704f9fa04f5298. Main base: f2f759ae31f2e51f767b8eb83c6c7e7132cab6d8.

  • Moved the unchanged __std_max_4i debt entry beside the existing vector-helper entries, away from malloc_stats_fast. Every preexisting byte of main's debt file is preserved; the contribution adds only this one entry there. This removes the documentation collision with #11870 without adding a dependency on it.
  • Rebased from e94b418a71cd4bdcd0c2e547c8d379c15bff2d21 (main base cb45ae2ddf6e113a4619e8fed91fe7b9333c5c0f) onto the main base above. VectorAlgorithms.cpp and GuestVectorAlgorithms.cpp are byte-identical to that previous published head. Main's new API declarations are retained, with the existing unique __std_max_4i declaration preserved. The contribution still changes only its original four files.
  • Windows 11 / WinLibs GCC 15.2.0 and Ubuntu 24.04 WSL / GCC 13.3.0, Release full-project configurations: rebuilt production libc and guest_vector_algorithms_tests on this exact head. ctest --test-dir build -R "^(guest_vector_algorithms|public_headers)$" -V --output-on-failure passes 2/2 on Windows (21.40 s) and 2/2 on Ubuntu (15.15 s). Bundled dependencies use this main base's pinned revisions, including its updated Vorbis pin.
  • Conventions, PR whitespace and strict main synchronization pass on this head (one ahead, zero behind the base above).
  • The required official scan covered 1,316 other open PRs against main f2f759ae31f2e51f767b8eb83c6c7e7132cab6d8 and found no confirmed line, export or new-file overlap. Its comparison with the previous remote revision of #11333 itself was excluded by PR identity; every other PR and its dependency relations were retained. In addition, normalized #11333 and #11870 merge without conflicts in both orders, producing the same tree and retaining both debt entries. This is a content-merge check; #11870 was not part of the runtime test.
  • The scanner could not complete shared-file comparisons for 19 already-conflicting branches: #5021, #6713, #7081, #7386, #7447, #7648, #7715, #8150, #8417, #8937, #9371, #9447, #9526, #9929, #10324, #10433, #10620, #10749, #11332. Their shared-file patches were inspected from their own merge bases; none mentions __std_max_4i or NID GE0yqFd83PA. These stale branches are not claimed merge-clean or runtime-tested together.

The full CTest suite, console, title and GPU execution were not run for this follow-up. The earlier native differential, negative controls and combined-helper evidence below retain their stated historical revisions; they were not rerun for this documentation relocation and rebase. No performance or title-unblock claim.

Earlier validation on historical revisions

Current-main synchronization (27 October 2026). Exact tested/published head: e94b418a71cd4bdcd0c2e547c8d379c15bff2d21. Main base: cb45ae2ddf6e113a4619e8fed91fe7b9333c5c0f.

  • Rebased from 1c8e0b3895ac358e13072881359e012195210c79 onto the two newer main commits. Main changed only the windows_crash_stack_words test regex in core/libs/prx/libc/CMakeLists.txt (#11633). The entire four-file contribution patch is byte-identical before and after the rebase; no implementation or regression assertion changed.
  • On this exact head, rebuilt libc and guest_vector_algorithms_tests in the existing full-project Release configurations. guest_vector_algorithms and public_headers pass 2/2 on Windows 11 / WinLibs GCC 15.2.0 and 2/2 on Ubuntu 24.04 WSL / GCC 13.3.0.
  • All seven synchronized helper PRs still merge cleanly in forward and reverse order, producing the same tree. Their new combined revision 7da0577e45f238c6bfa01a818bd7e27f727ebeff also 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.
  • Conventions, whitespace and strict main-sync checks pass: one commit ahead and zero behind the main base above.
  • The combined production sources, headers and regression sources are byte-identical to the previous combined revision 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.
  • The full CTest suite and all 64 general standalone-header batches were not run. No console, title or GPU run and no performance claim.
Earlier implementation validation and provenance

Current-main refresh (27 October 2026). Exact tested/published head: 1c8e0b3895ac358e13072881359e012195210c79. Fetched main base: 74acfad65b3f0fd4eab653f3a3989d298fba1157.

  • Rebased from fdf8c3f156ab43443871fec3e66548d9a4d6c824. The __std_max_4i production 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.
  • Windows 11 x64, WinLibs GCC 15.2.0, Release, full-project configuration: rebuilt production libc and guest_vector_algorithms_tests; ctest --test-dir build -R "^(guest_vector_algorithms|public_headers)$" -V --output-on-failure passed 2/2 on this exact head (19.34 s).
  • Ubuntu 24.04 under WSL, GCC 13.3.0 and CMake 3.28.3, Release, full-project configuration in a separate native Linux checkout: rebuilt production libc and the focused executable; the same checks passed 2/2 on this exact head (14.61 s). The runtime uses its existing memory-comparison fallback when asynchronous userfaultfd write watching is unavailable.
  • The same focused checks also pass on the unmodified main base on both platforms. All seven remaining vector-helper PRs (#10460, #11295, #11300, #11302, #11304, #11309 and #11333), together with #11289 already in main, merge without content conflicts. Merging the seven in forward and reverse order produces the same tree. That combined revision a27d73c1f43135378c54ed6477af71273135ec42 also builds and passes both focused checks on Windows and Ubuntu.
  • The current #10788 head 92db947130efc9e7e12c492683329f2ebc3e1996 merges cleanly with the main base, each individual helper and the seven-helper composition. This is a content-merge check for #10788; its implementation was not part of the combined runtime run.
  • Conventions, whitespace and tools/check_main_sync.py --base origin/main --head 1c8e0b3895ac358e13072881359e012195210c79 --strict pass. 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_headers audits 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):

  • The five standalone public libc headers (include/Api.hpp, include/exceptions/Runtime.hpp, include/exceptions/Unwind.hpp, include/SonyCrt.hpp, and libc.hpp), plus a compilation unit including all 368 library umbrellas together, pass with C++20 and -Werror on 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.
  • A separate Ubuntu full-project configuration with ANYPS5_ENABLE_ASAN=ON, RelWithDebInfo, rebuilt libc and guest_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-failure passed 1/1, with no AddressSanitizer or LeakSanitizer finding.
  • These added checks ran on the combined revision, not on seven additional individual builds. The individual Windows/Ubuntu Release results above remain associated with their exact published heads.

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 fdf8c3f156ab43443871fec3e66548d9a4d6c824, main base bf77a9e9cba4b02c358779b35295176dd9cae164:

  • Rebased from ba233b8bd27773084ebb9130775eee7d1e8b094c onto the main base above. All existing main declarations and debt entries are retained. The __std_max_4i production function body is byte-identical to the previously reviewed head; the patch still changes only its implementation, public declaration, regression cases and debt entry.
  • Windows 11 x64, WinLibs GCC 15.2.0, Release, full-project configuration: rebuilt libc and guest_vector_algorithms_tests; ctest --test-dir build -R "^(guest_vector_algorithms|public_headers)$" -V --output-on-failure passed 2/2 on this exact head (19.07 s).
  • Ubuntu 24.04 under WSL, GCC 13.3.0 and CMake 3.28.3, Release, full-project configuration in a separate Linux checkout: rebuilt libc and the focused executable, and the same two tests passed 2/2 on this exact head (14.04 s). The runtime reports the existing unavailable asynchronous userfaultfd write-watch path and uses its memory-comparison fallback.
  • The two header audits ran separately after both platform builds completed, with the existing 30-second limit unchanged. public_headers is 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 and tools/check_main_sync.py --base origin/main --head fdf8c3f156ab43443871fec3e66548d9a4d6c824 --strict pass. The sync check reports one commit ahead and zero behind the fetched main base above.
  • A trial merge of all six refreshed PRs together with independent #10460 and #11289 is clean. That composition was checked for content conflicts; the runtime results above are the individual PR runs.

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: 943ea8acb23f0a1b2af35d85393fe6fd5afb7743. Tested/published head: ba233b8bd27773084ebb9130775eee7d1e8b094c.

  • Windows x64, Release, WinLibs GCC 15.2.0: built libs, relinker and guest_vector_algorithms_tests on baseline 33ae5a31469994957f006ccb68dd0c3b9081e42e and initial candidate d368be3e90948cd3537d9b2351fdc04562d5fda3. Both focused tests passed. After rebasing onto current main, rebuilt libc and the focused executable, reran both tests and the original/candidate differential: pass. The rebase only adds upstream shader changes; the libc and vector-test sources are byte-identical to the initial candidate.
  • Ubuntu 24.04 in WSL, GCC 13.3 and CMake 3.28.3: configured the full project in a separate Linux checkout, built libc and guest_vector_algorithms_tests, and passed the same two tests on the baseline and the final change. WSL reports the existing asynchronous userfaultfd write-watch fallback to memory comparison; this is a host test, not a console measurement.
  • Regression assertions cover singleton and pairwise signed boundaries, negative values, INT32_MIN/INT32_MAX, deterministic random data, 20 lengths from 1 through 257, all 32 byte offsets, repeated values, the maximum at every position, and unchanged inputs and canaries. Unsupported-input throws are not pinned by tests.
  • On Windows, 41,796 direct comparisons of the isolated original function, the NID-patched production libc and an independent signed reference passed, including 256 guard-page cases. Original module initialization was never run.
  • Negative controls deliberately changed the production comparison to unsigned, truncated subsequent reads to 16 bits, or skipped the last element; the regression test rejected all three. Sources and affected binaries were restored exactly and their SHA256 hashes checked before rerunning the tests and direct comparison.
  • The combined libc helpers from #10460, #11289, #11295, #11300, #11302, #11304 and #11309 merge without conflicts and pass guest_vector_algorithms and public_headers together on Ubuntu. They remain independent contributions.
  • tools/check_conventions.py --base origin/main passed. tools/pr_overlap.py --branch feat/libc-signed-max32 found no confirmed line, export or new-file overlap. Shared-file patches from 22 PRs already conflicting with main were checked separately: all 24 per-file merges retain exactly the same preexisting conflict blocks with this patch.

public_headers is the unique-declaration and umbrella-coverage audit; standalone-header compilation batches and the full CTest suite were not run.

Investigation scripts, evidence and logs remain outside the repository. No title bring-up or performance improvement is claimed.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5011800866 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11333). Originally posted by [Danigamer05](https://github.com/Danigamer05) on 2026-10-26T03:59:27Z. --- ### What Implement libc's `__std_max_4i` (`GE0yqFd83PA`) for nonempty ranges of signed 32-bit integers. Return the maximum value, allow unaligned input, and leave the range unchanged. Null, empty, reversed and partial-element ranges call `NotImplemented_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 SHA256 `483961e086b8a1fffa8138b3c0badf798987fb5f35ec908d828946408be2d8a6`, dynamic export `GE0yqFd83PA`, RVA `0x63430`, size `0x1a2`. The entry uses `rdi`/`rsi` as the range bounds; `0x63453` reads one 32-bit value, `0x63470` uses `vpmaxsd`, and the scalar tail at `0x635c3`/`0x635c5` selects with signed `cmovle`. The result reaches `ret` at `0x635d1` in `eax`. 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_t` result are also corroborated by [Microsoft STL at b6f01e438b68ee497f9c08313e49d12bb2f0d8e0](https://github.com/microsoft/STL/blob/b6f01e438b68ee497f9c08313e49d12bb2f0d8e0/stl/src/vector_algorithms.cpp). 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 Documentation-overlap follow-up (27 October 2026). Exact tested/published head: `f139bcf1fc29cca5d3e26c90e7704f9fa04f5298`. Main base: `f2f759ae31f2e51f767b8eb83c6c7e7132cab6d8`. - Moved the unchanged `__std_max_4i` debt entry beside the existing vector-helper entries, away from `malloc_stats_fast`. Every preexisting byte of main's debt file is preserved; the contribution adds only this one entry there. This removes the documentation collision with #11870 without adding a dependency on it. - Rebased from `e94b418a71cd4bdcd0c2e547c8d379c15bff2d21` (main base `cb45ae2ddf6e113a4619e8fed91fe7b9333c5c0f`) onto the main base above. `VectorAlgorithms.cpp` and `GuestVectorAlgorithms.cpp` are byte-identical to that previous published head. Main's new API declarations are retained, with the existing unique `__std_max_4i` declaration preserved. The contribution still changes only its original four files. - Windows 11 / WinLibs GCC 15.2.0 and Ubuntu 24.04 WSL / GCC 13.3.0, Release full-project configurations: rebuilt production libc and `guest_vector_algorithms_tests` on this exact head. `ctest --test-dir build -R "^(guest_vector_algorithms|public_headers)$" -V --output-on-failure` passes **2/2 on Windows** (21.40 s) and **2/2 on Ubuntu** (15.15 s). Bundled dependencies use this main base's pinned revisions, including its updated Vorbis pin. - Conventions, PR whitespace and strict main synchronization pass on this head (one ahead, zero behind the base above). - The required official scan covered 1,316 other open PRs against main `f2f759ae31f2e51f767b8eb83c6c7e7132cab6d8` and found no confirmed line, export or new-file overlap. Its comparison with the previous remote revision of #11333 itself was excluded by PR identity; every other PR and its dependency relations were retained. In addition, normalized #11333 and #11870 merge without conflicts in both orders, producing the same tree and retaining both debt entries. This is a content-merge check; #11870 was not part of the runtime test. - The scanner could not complete shared-file comparisons for 19 already-conflicting branches: #5021, #6713, #7081, #7386, #7447, #7648, #7715, #8150, #8417, #8937, #9371, #9447, #9526, #9929, #10324, #10433, #10620, #10749, #11332. Their shared-file patches were inspected from their own merge bases; none mentions `__std_max_4i` or NID `GE0yqFd83PA`. These stale branches are not claimed merge-clean or runtime-tested together. The full CTest suite, console, title and GPU execution were not run for this follow-up. The earlier native differential, negative controls and combined-helper evidence below retain their stated historical revisions; they were not rerun for this documentation relocation and rebase. No performance or title-unblock claim. <details> <summary>Earlier validation on historical revisions</summary> Current-main synchronization (27 October 2026). Exact tested/published head: `e94b418a71cd4bdcd0c2e547c8d379c15bff2d21`. Main base: `cb45ae2ddf6e113a4619e8fed91fe7b9333c5c0f`. - Rebased from `1c8e0b3895ac358e13072881359e012195210c79` onto the two newer main commits. Main changed only the `windows_crash_stack_words` test regex in `core/libs/prx/libc/CMakeLists.txt` (#11633). The entire four-file contribution patch is byte-identical before and after the rebase; no implementation or regression assertion changed. - On this exact head, rebuilt libc and `guest_vector_algorithms_tests` in the existing full-project Release configurations. `guest_vector_algorithms` and `public_headers` pass **2/2 on Windows 11 / WinLibs GCC 15.2.0** and **2/2 on Ubuntu 24.04 WSL / GCC 13.3.0**. - All seven synchronized helper PRs still merge cleanly in forward and reverse order, producing the same tree. Their new combined revision `7da0577e45f238c6bfa01a818bd7e27f727ebeff` also 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. - Conventions, whitespace and strict main-sync checks pass: one commit ahead and zero behind the main base above. - The combined production sources, headers and regression sources are byte-identical to the previous combined revision `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. - The full CTest suite and all 64 general standalone-header batches were not run. No console, title or GPU run and no performance claim. <details> <summary>Earlier implementation validation and provenance</summary> Current-main refresh (27 October 2026). Exact tested/published head: `1c8e0b3895ac358e13072881359e012195210c79`. Fetched main base: `74acfad65b3f0fd4eab653f3a3989d298fba1157`. - Rebased from `fdf8c3f156ab43443871fec3e66548d9a4d6c824`. The `__std_max_4i` production 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. - Windows 11 x64, WinLibs GCC 15.2.0, Release, full-project configuration: rebuilt production libc and `guest_vector_algorithms_tests`; `ctest --test-dir build -R "^(guest_vector_algorithms|public_headers)$" -V --output-on-failure` passed **2/2** on this exact head (19.34 s). - Ubuntu 24.04 under WSL, GCC 13.3.0 and CMake 3.28.3, Release, full-project configuration in a separate native Linux checkout: rebuilt production libc and the focused executable; the same checks passed **2/2** on this exact head (14.61 s). The runtime uses its existing memory-comparison fallback when asynchronous userfaultfd write watching is unavailable. - The same focused checks also pass on the unmodified main base on both platforms. All seven remaining vector-helper PRs (#10460, #11295, #11300, #11302, #11304, #11309 and #11333), together with #11289 already in main, merge without content conflicts. Merging the seven in forward and reverse order produces the same tree. That combined revision `a27d73c1f43135378c54ed6477af71273135ec42` also builds and passes both focused checks on Windows and Ubuntu. - The current #10788 head `92db947130efc9e7e12c492683329f2ebc3e1996` merges cleanly with the main base, each individual helper and the seven-helper composition. This is a content-merge check for #10788; its implementation was not part of the combined runtime run. - Conventions, whitespace and `tools/check_main_sync.py --base origin/main --head 1c8e0b3895ac358e13072881359e012195210c79 --strict` pass. 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_headers` audits 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): - The five standalone public libc headers (`include/Api.hpp`, `include/exceptions/Runtime.hpp`, `include/exceptions/Unwind.hpp`, `include/SonyCrt.hpp`, and `libc.hpp`), plus a compilation unit including all 368 library umbrellas together, pass with C++20 and `-Werror` on 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. - A separate Ubuntu full-project configuration with `ANYPS5_ENABLE_ASAN=ON`, RelWithDebInfo, rebuilt libc and `guest_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-failure` passed **1/1**, with no AddressSanitizer or LeakSanitizer finding. - These added checks ran on the combined revision, not on seven additional individual builds. The individual Windows/Ubuntu Release results above remain associated with their exact published heads. 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. <details> <summary>Earlier implementation validation and provenance</summary> Current-main refresh (26 October 2026), exact published/tested head `fdf8c3f156ab43443871fec3e66548d9a4d6c824`, main base `bf77a9e9cba4b02c358779b35295176dd9cae164`: - Rebased from `ba233b8bd27773084ebb9130775eee7d1e8b094c` onto the main base above. All existing main declarations and debt entries are retained. The `__std_max_4i` production function body is byte-identical to the previously reviewed head; the patch still changes only its implementation, public declaration, regression cases and debt entry. - Windows 11 x64, WinLibs GCC 15.2.0, Release, full-project configuration: rebuilt libc and `guest_vector_algorithms_tests`; `ctest --test-dir build -R "^(guest_vector_algorithms|public_headers)$" -V --output-on-failure` passed **2/2** on this exact head (19.07 s). - Ubuntu 24.04 under WSL, GCC 13.3.0 and CMake 3.28.3, Release, full-project configuration in a separate Linux checkout: rebuilt libc and the focused executable, and the same two tests passed **2/2** on this exact head (14.04 s). The runtime reports the existing unavailable asynchronous userfaultfd write-watch path and uses its memory-comparison fallback. - The two header audits ran separately after both platform builds completed, with the existing 30-second limit unchanged. `public_headers` is 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 and `tools/check_main_sync.py --base origin/main --head fdf8c3f156ab43443871fec3e66548d9a4d6c824 --strict` pass. The sync check reports one commit ahead and zero behind the fetched main base above. - A trial merge of all six refreshed PRs together with independent #10460 and #11289 is clean. That composition was checked for content conflicts; the runtime results above are the individual PR runs. 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. <details> <summary>Earlier implementation validation and provenance</summary> Base: `943ea8acb23f0a1b2af35d85393fe6fd5afb7743`. Tested/published head: `ba233b8bd27773084ebb9130775eee7d1e8b094c`. - Windows x64, Release, WinLibs GCC 15.2.0: built `libs`, `relinker` and `guest_vector_algorithms_tests` on baseline `33ae5a31469994957f006ccb68dd0c3b9081e42e` and initial candidate `d368be3e90948cd3537d9b2351fdc04562d5fda3`. Both focused tests passed. After rebasing onto current main, rebuilt libc and the focused executable, reran both tests and the original/candidate differential: pass. The rebase only adds upstream shader changes; the libc and vector-test sources are byte-identical to the initial candidate. - Ubuntu 24.04 in WSL, GCC 13.3 and CMake 3.28.3: configured the full project in a separate Linux checkout, built libc and `guest_vector_algorithms_tests`, and passed the same two tests on the baseline and the final change. WSL reports the existing asynchronous `userfaultfd` write-watch fallback to memory comparison; this is a host test, not a console measurement. - Regression assertions cover singleton and pairwise signed boundaries, negative values, `INT32_MIN`/`INT32_MAX`, deterministic random data, 20 lengths from 1 through 257, all 32 byte offsets, repeated values, the maximum at every position, and unchanged inputs and canaries. Unsupported-input throws are not pinned by tests. - On Windows, 41,796 direct comparisons of the isolated original function, the NID-patched production libc and an independent signed reference passed, including 256 guard-page cases. Original module initialization was never run. - Negative controls deliberately changed the production comparison to unsigned, truncated subsequent reads to 16 bits, or skipped the last element; the regression test rejected all three. Sources and affected binaries were restored exactly and their SHA256 hashes checked before rerunning the tests and direct comparison. - The combined libc helpers from #10460, #11289, #11295, #11300, #11302, #11304 and #11309 merge without conflicts and pass `guest_vector_algorithms` and `public_headers` together on Ubuntu. They remain independent contributions. - `tools/check_conventions.py --base origin/main` passed. `tools/pr_overlap.py --branch feat/libc-signed-max32` found no confirmed line, export or new-file overlap. Shared-file patches from 22 PRs already conflicting with `main` were checked separately: all 24 per-file merges retain exactly the same preexisting conflict blocks with this patch. `public_headers` is the unique-declaration and umbrella-coverage audit; standalone-header compilation batches and the full CTest suite were not run. Investigation scripts, evidence and logs remain outside the repository. No title bring-up or performance improvement is claimed. </details> </details> </details> <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> </details> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
MarcZX10 commented 2026-10-26 04:13:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T04:13:19Z.

Review: APPROVED


Reviewed the complete diff at ba233b8bd27773084ebb9130775eee7d1e8b094c. The implementation uses signed int32_t comparisons, reads potentially unaligned elements through the existing Read<T> helper, validates the byte range before walking it, and does not modify the input. The regression additions cover signed boundaries, randomized ranges, lengths and offsets, repeated values, max positions, and immutability. I also checked the reported export disassembly and focused Windows/WSL differential evidence in the PR description. Current hosted relinker, ASan, register-context, write-watch, eligibility, intake, conventions, labels and report checks pass; product builds are skipped by path policy. No blocking issue found.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5647307738 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11333#pullrequestreview-5647307738). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T04:13:19Z. **Review:** APPROVED --- Reviewed the complete diff at `ba233b8bd27773084ebb9130775eee7d1e8b094c`. The implementation uses signed `int32_t` comparisons, reads potentially unaligned elements through the existing `Read<T>` helper, validates the byte range before walking it, and does not modify the input. The regression additions cover signed boundaries, randomized ranges, lengths and offsets, repeated values, max positions, and immutability. I also checked the reported export disassembly and focused Windows/WSL differential evidence in the PR description. Current hosted relinker, ASan, register-context, write-watch, eligibility, intake, conventions, labels and report checks pass; product builds are skipped by path policy. No blocking issue found.
MarcZX10 commented 2026-10-26 06:01:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T06:01:36Z.

Review: DISMISSED


The implementation and evidence are otherwise strong: signed comparisons and unaligned reads match the stated range contract; the tests cover boundaries, offsets, lengths, unchanged input and negative controls; hosted checks pass, while full product builds are accurately reported as skipped.

This branch is 1 ahead and 55 behind current main (14c99b52ac), with a clean merge preview. The only changed path also touched on current main is docs/dev/debt/libc.md (from #9269); the implementation, declaration and test files have no intervening changes. Please rebase to resolve that debt-file overlap and rerun guest_vector_algorithms plus public_headers on the refreshed head before merge, as required by the repository's current-main sync rule.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5647966961 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11333#pullrequestreview-5647966961). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T06:01:36Z. **Review:** DISMISSED --- The implementation and evidence are otherwise strong: signed comparisons and unaligned reads match the stated range contract; the tests cover boundaries, offsets, lengths, unchanged input and negative controls; hosted checks pass, while full product builds are accurately reported as skipped. This branch is 1 ahead and 55 behind current `main` (`14c99b52ac`), with a clean merge preview. The only changed path also touched on current `main` is `docs/dev/debt/libc.md` (from #9269); the implementation, declaration and test files have no intervening changes. Please rebase to resolve that debt-file overlap and rerun `guest_vector_algorithms` plus `public_headers` on the refreshed head before merge, as required by the repository's current-main sync rule.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!11333
No description provided.