fix(libc): sort like the console's qsort and qsort_s #9688

Merged
JJenkx merged 1202 commits from upstream-pr/9688 into main 2026-11-02 07:58:09 +00:00
JJenkx commented 2026-10-22 08:32:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T08:32:27Z.


What

qsort and qsort_s now sort the way the libc.prx that titles ship does. On main they followed FreeBSD 11's Bentley-McIlroy quicksort; the debt entry already said that "the console's libc uses this FreeBSD code is unverified". It doesn't.

The console's qsort (AEJdIVZTEmo) is a 30-byte wrapper: a null array or comparator returns at once, otherwise it calls an internal sort with (base, n, ideal = n, size, cmp). qsort_s (G7yOZJObV+4) has its own copy of the same sort with a context. That sort is an introsort in the shape of Dinkumware's std::sort:

  • Partition (33 elements and up): a three-way partition with the pivot run grown in both directions. The median is of three, or of nine from 42 elements, with a step of (n - 1) / 8 + 1. The median of three always makes three comparisons. It recurses on the smaller side, the lower one when the sides are equal, and loops on the other.
  • Heap sort: when the division budget runs out. The budget starts at n and is cut to budget / 2 + budget / 4 at each partition. Sift-down always goes to a leaf, followed by a sift-up.
  • Insertion sort below 33 elements. It doesn't check bounds and keeps elements that compare equal in their order.

So on main, elements that compare equal often ended in a different order than on the console, and the comparator saw a different sequence of calls. Whatever a title's sort order affects (draw lists sorted on equal keys, for example) could differ.

How it was checked

I read the code from the disassembly of the decrypted copies of PPSA13934 (internal sort at 0x62130), PPSA07923 (0x64210) and PPSA05916 (0x67960). Then I checked it by running those copies directly: a scratch loader maps the ELF, applies its relocations and calls the internal sort, qsort and qsort_s with a logging comparator. The same runs then go through the port, and the comparator call sequences and the resulting bytes are compared.

  • The port, and then the code exactly as it is in this PR (extracted from FileAndHeap.cpp):
    • 460,000 random sorts across the three copies, about 750 million comparator calls, all identical. Arrays had 0 to 3,000 elements, 1 to 600 bytes each, with 1 to 256 distinct keys in random, ascending, descending and organ-pipe orders.
    • About 56,000 of those sorts call the internal sort with a small ideal, to force the heap sort.
  • A deliberately wrong variant (an STL-style median of three that skips its third comparison) is caught at the third call of the first trial. So the comparison detects differences.
  • main's sort against the console's on 10,022 qsort sorts: the final order differs in 8,340 and the comparator sequence in 9,898.
  • On the console, a zero element size with fewer than 33 elements compares and moves nothing (4 calls for 3 elements). With 33 or more it divides by zero; here it throws.

Tested

Windows 11 Enterprise 10.0.22621, Ryzen 9 5950X, WinLibs GCC 15.2.0 r7 (UCRT), Ninja, Release, -DBUILD_TESTING=ON, main 7e2ba73e4c.

  • guest_qsort:
    • The expected orders come from the bundled binary, and all three copies give the same ones.
    • The cases are:
      • 12 elements, now in stable order, since the console only runs insertion sort there;
      • 48 elements through a median-of-nine partition, for both qsort and qsort_s;
      • 1,000 elements over nested partitions, checked by a hash of the order;
      • a null array, a null comparator, and a zero element size.
    • The qsort_s zero-size case now uses a buffer as large as an Element, because its comparator is now called.
    • On main the new checks fail, starting with insertion sort below 33 elements: element 0 has tag 11, expected 3, and the null array throws. With this change it passes three times out of three.
  • Full suite with the GPU hidden, ctest -j16 --timeout 120: 1889 of 1890 pass. guest_raise_in_host_code times out, as on main here (#9610).
  • python tools/check_conventions.py --base origin/main: passes.
  • tools/pr_overlap.py --branch: text conflicts in libc.md only. One is my own #9613, whose qsort sentence this entry replaces; I'll drop it there. The other is #9087, two lines below in the qsort_s entry.
  • Independent Linux report by jotitadev (review): Ubuntu 26.04, glibc 2.43, x86_64 i7-8700, GCC 15.2.0; PR head b8247ed3b merged with --no-commit onto main 7e2ba73e4.
    • Release: guest_qsort and patched_libraries, 2/2 pass.
    • Negative control using main's FileAndHeap.cpp with this PR's tests fails the insertion-order check for both qsort and qsort_s.
    • ASan+UBSan guest_qsort passes without reports for the 12-, 48- and 1,000-element and null/zero-size cases. This is focused test coverage, not a full Linux suite or title run.
  • Not tested: macOS, a console, a title run.

Linux reviewer follow-up (2026-10-25)

Refreshed to main cceb6c3c41eb6dafd4225562fd09cee8820ad00b, head 03874cf1c5e43c18969364be032dc1e8371fe1c9. Addressed the reachable self-swap report: SwapElements returns immediately when its pointers are equal, before calling std::swap_ranges. The complete sort helper block is otherwise byte-identical to the previous PR head; no comparator or partition traversal changes.

  • Added the reported 33-key input to guest_qsort for both qsort and qsort_s. It checks exact final tag order and comparator sequence (181 calls, pair hash 78b091e1).
  • Independently ran both exports from the supplied FAR PPSA03766 and Tetris PPSA07923 converted libc modules. Both references and the candidate agree on all 33 tags and every one of the 181 comparator pairs for each export.
  • Fresh Linux libc/test build and ctest -R '^guest_qsort$' --repeat until-fail:3 -V: 3 passes. Conventions and diff checks pass; merge-tree with the stated main is clean.
  • An external copy of the exact sort helpers with a swap-range precondition checker rejects the guard-removed version at element 19 and passes with the guard. This demonstrates the invalid self-swap, not a reproduced production crash or a sanitizer failure; ordinary unfixed builds may still sort the input successfully.
  • Review follow-up evidence, SHA-256 a9e64875954a84ddeac539042935f069f5b284800cdff27f2e47f152a585fd05. Original Windows/large reference matrices remain evidence for their original revisions and were not rerun; no new Windows/game/GPU/physical-console result is claimed.

Current Linux qualification — 2026-10-29

Refreshed against main 5454cd2e455994d992aca39335ce60507eeda1eb.

Linux qualification at 1c8ac1874c0ed5ccafef5112d59da6739d4a2fb6 (Arch Linux 7.2.9, Ryzen 9 7950X, GCC 16.2.1, Ninja Release, BUILD_TESTING=ON): guest_qsort, guest_bounds_checking, guest_safe_errors, guest_crt each pass three consecutive runs (12/12, no skips). The public_headers audit passes at this exact head. All tracked public-header files match the pinned main; the affected test targets rebuild against those headers. Conventions and whitespace checks pass. The same focused groups passed three times on the pinned main.

Evidence: immutable Linux qualification bundle. Its SHA-256 is 53b095da2f67f55b8aa56ba273681e0330fb39739be844458038dde410fb8cc4. No fresh Windows runtime execution is claimed; older measurements retain their recorded source pins.

AI-assisted: yes (Codex).

Earlier qualification — 2026-10-30

Integrated current main 08a10d225306ad102b57408e2ef7566bcfb829b2 into this existing topic at ae15d0493797e9d40b2ab2eedbf202abf14c90e3. Current-main functions, fixtures, unrelated debt rows and exact dependency gitlinks are preserved; original topic functions and authored commits are retained.

Rebuilt actual Linux libc and focused test binaries. guest_qsort, guest_bounds_checking, guest_safe_errors, guest_crt each passed three consecutive runs (12 runtime passes), plus public_headers; conventions and whitespace checks pass. Pinned main passed all seven selected runtime suites plus the header audit three times (24 runs). This is focused Linux CPU qualification; prior Windows/reference evidence retains its original pins. No new Windows, console, SDK-module, title, GPU or performance claim. AI-assisted: yes.

Evidence: https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/owned-math6-main08a10-linux-20261030.tar.gz (SHA-256 b984a6334dce65b5c9148e3791ba21605074a5e762ea0f07f96de2f38062ef6e).

Qualification update — 2026-10-30, repeat 2

Integrated pinned main e471817c68d4e1b1e44b0ce369ed88bafe4ae8ed at 1f001f3f23c74bf5dee00803644f2f17c82ac994, retaining original topic commits as ancestors. Main qsort_r retains its full FreeBSD helper/comparator behavior under private Reentrant-prefixed names; both sort implementations and every main qsort_r fixture are retained. Exact rename-normalized helper proof is attached.

Actual Linux libc/focused binaries rebuilt from this final head; guest_qsort, guest_bounds_checking, guest_safe_errors, guest_crt each pass three consecutive runs (12 runtime passes), plus public_headers. Conventions against current origin/main and whitespace pass. Pinned main passed all seven runtime groups plus the header audit three times (24 runs). Full source/function/test/debt/header and 31 recursive dependency / 17,742 tracked-blob proofs are attached. Later main 1c6b316cf762 has 17 off-topic commits, no relevant libc/numeric/qsort/gitlink changes, and all 9 merge previews are clean; those preview trees were not executed.

Focused Linux CPU scope only: prior Windows/SDK/reference reports keep original pins. The Linux portion makes no fresh Windows, console, SDK-module, title/GPU or speed measurement is claimed by this report. AI-assisted: yes. Evidence: https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/owned-math9-maine471-linux-20261030-repeat2.tar.gz (SHA256 5da4ce1732b45bb3fc566c31078c8c9ae8bf0c403654dfc60d15ee28490e20bf).

Actual Windows qualification at exact published 1f001f3f23c74bf5dee00803644f2f17c82ac994: Windows 11 Enterprise 10.0.22621, Ryzen 9 5950X, WinLibs GCC 15.2 UCRT r7, Ninja Release, BUILD_TESTING=ON. Rebuilt patched libc and guest_qsort_tests, then ran guest_qsort three times: 3/3 passes, zero skips. This checks the composed main qsort_r and branch sorting fixtures at the recorded head; no timing, SDK/game/GPU/console/macOS claim. Raw build/CTest/JUnit logs, DLL digest and terminal Windows FIFO receipt are included in https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/owned-current-windows-20261030-repeat2.tar.gz, SHA256 e423c97373758bf59239e02c138b74f35f1a45488793bc92878a4c836f94a584. AI-assisted: yes (Codex).

AI-assisted: yes (Codex).

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); no silent stubs added
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source: none added
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4964471480 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9688). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-22T08:32:27Z. --- ### What `qsort` and `qsort_s` now sort the way the `libc.prx` that titles ship does. On `main` they followed FreeBSD 11's Bentley-McIlroy quicksort; the debt entry already said that "the console's libc uses this FreeBSD code is unverified". It doesn't. The console's `qsort` (`AEJdIVZTEmo`) is a 30-byte wrapper: a null array or comparator returns at once, otherwise it calls an internal sort with `(base, n, ideal = n, size, cmp)`. `qsort_s` (`G7yOZJObV+4`) has its own copy of the same sort with a context. That sort is an introsort in the shape of Dinkumware's `std::sort`: - **Partition** (33 elements and up): a three-way partition with the pivot run grown in both directions. The median is of three, or of nine from 42 elements, with a step of `(n - 1) / 8 + 1`. The median of three always makes three comparisons. It recurses on the smaller side, the lower one when the sides are equal, and loops on the other. - **Heap sort**: when the division budget runs out. The budget starts at `n` and is cut to `budget / 2 + budget / 4` at each partition. Sift-down always goes to a leaf, followed by a sift-up. - **Insertion sort** below 33 elements. It doesn't check bounds and keeps elements that compare equal in their order. So on `main`, elements that compare equal often ended in a different order than on the console, and the comparator saw a different sequence of calls. Whatever a title's sort order affects (draw lists sorted on equal keys, for example) could differ. ### How it was checked I read the code from the disassembly of the decrypted copies of PPSA13934 (internal sort at 0x62130), PPSA07923 (0x64210) and PPSA05916 (0x67960). Then I checked it by running those copies directly: a scratch loader maps the ELF, applies its relocations and calls the internal sort, `qsort` and `qsort_s` with a logging comparator. The same runs then go through the port, and the comparator call sequences and the resulting bytes are compared. - The port, and then the code exactly as it is in this PR (extracted from `FileAndHeap.cpp`): - 460,000 random sorts across the three copies, about 750 million comparator calls, all identical. Arrays had 0 to 3,000 elements, 1 to 600 bytes each, with 1 to 256 distinct keys in random, ascending, descending and organ-pipe orders. - About 56,000 of those sorts call the internal sort with a small `ideal`, to force the heap sort. - A deliberately wrong variant (an STL-style median of three that skips its third comparison) is caught at the third call of the first trial. So the comparison detects differences. - `main`'s sort against the console's on 10,022 `qsort` sorts: the final order differs in 8,340 and the comparator sequence in 9,898. - On the console, a zero element size with fewer than 33 elements compares and moves nothing (4 calls for 3 elements). With 33 or more it divides by zero; here it throws. ### Tested Windows 11 Enterprise 10.0.22621, Ryzen 9 5950X, WinLibs GCC 15.2.0 r7 (UCRT), Ninja, Release, `-DBUILD_TESTING=ON`, `main` 7e2ba73e4c. - `guest_qsort`: - The expected orders come from the bundled binary, and all three copies give the same ones. - The cases are: - 12 elements, now in stable order, since the console only runs insertion sort there; - 48 elements through a median-of-nine partition, for both `qsort` and `qsort_s`; - 1,000 elements over nested partitions, checked by a hash of the order; - a null array, a null comparator, and a zero element size. - The `qsort_s` zero-size case now uses a buffer as large as an `Element`, because its comparator is now called. - On `main` the new checks fail, starting with `insertion sort below 33 elements: element 0 has tag 11, expected 3`, and the null array throws. With this change it passes three times out of three. - Full suite with the GPU hidden, `ctest -j16 --timeout 120`: 1889 of 1890 pass. `guest_raise_in_host_code` times out, as on `main` here (#9610). - `python tools/check_conventions.py --base origin/main`: passes. - `tools/pr_overlap.py --branch`: text conflicts in `libc.md` only. One is my own #9613, whose `qsort` sentence this entry replaces; I'll drop it there. The other is #9087, two lines below in the `qsort_s` entry. - Independent Linux report by jotitadev ([review](https://github.com/boykopovar/AnyPS5/pull/9688#pullrequestreview-5611706775)): Ubuntu 26.04, glibc 2.43, x86_64 i7-8700, GCC 15.2.0; PR head `b8247ed3b` merged with `--no-commit` onto main `7e2ba73e4`. - Release: `guest_qsort` and `patched_libraries`, 2/2 pass. - Negative control using main's `FileAndHeap.cpp` with this PR's tests fails the insertion-order check for both `qsort` and `qsort_s`. - ASan+UBSan `guest_qsort` passes without reports for the 12-, 48- and 1,000-element and null/zero-size cases. This is focused test coverage, not a full Linux suite or title run. - Not tested: macOS, a console, a title run. ### Linux reviewer follow-up (2026-10-25) Refreshed to main `cceb6c3c41eb6dafd4225562fd09cee8820ad00b`, head `03874cf1c5e43c18969364be032dc1e8371fe1c9`. Addressed [the reachable self-swap report](https://github.com/boykopovar/AnyPS5/pull/9688#issuecomment-6402981150): `SwapElements` returns immediately when its pointers are equal, before calling `std::swap_ranges`. The complete sort helper block is otherwise byte-identical to the previous PR head; no comparator or partition traversal changes. - Added the reported 33-key input to `guest_qsort` for both `qsort` and `qsort_s`. It checks exact final tag order and comparator sequence (181 calls, pair hash `78b091e1`). - Independently ran both exports from the supplied FAR PPSA03766 and Tetris PPSA07923 converted libc modules. Both references and the candidate agree on all 33 tags and every one of the 181 comparator pairs for each export. - Fresh Linux libc/test build and `ctest -R '^guest_qsort$' --repeat until-fail:3 -V`: 3 passes. Conventions and diff checks pass; merge-tree with the stated main is clean. - An external copy of the exact sort helpers with a swap-range precondition checker rejects the guard-removed version at element 19 and passes with the guard. This demonstrates the invalid self-swap, not a reproduced production crash or a sanitizer failure; ordinary unfixed builds may still sort the input successfully. - [Review follow-up evidence](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/pr9688-head03874cf1-linux-self-swap-validation.tar.gz), SHA-256 `a9e64875954a84ddeac539042935f069f5b284800cdff27f2e47f152a585fd05`. Original Windows/large reference matrices remain evidence for their original revisions and were not rerun; no new Windows/game/GPU/physical-console result is claimed. <!-- codex-maintenance-20261029-repeat-9688 --> **Current Linux qualification — 2026-10-29** Refreshed against main `5454cd2e455994d992aca39335ce60507eeda1eb`. Linux qualification at `1c8ac1874c0ed5ccafef5112d59da6739d4a2fb6` (Arch Linux 7.2.9, Ryzen 9 7950X, GCC 16.2.1, Ninja Release, BUILD_TESTING=ON): `guest_qsort`, `guest_bounds_checking`, `guest_safe_errors`, `guest_crt` each pass three consecutive runs (12/12, no skips). The `public_headers` audit passes at this exact head. All tracked public-header files match the pinned main; the affected test targets rebuild against those headers. Conventions and whitespace checks pass. The same focused groups passed three times on the pinned main. Evidence: [immutable Linux qualification bundle](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/owned-math10-main5454-linux-20261029-repeat.tar.gz). Its SHA-256 is `53b095da2f67f55b8aa56ba273681e0330fb39739be844458038dde410fb8cc4`. No fresh Windows runtime execution is claimed; older measurements retain their recorded source pins. AI-assisted: yes (Codex). <!-- codex-maintenance-20261030-repeat-9688 --> **Earlier qualification — 2026-10-30** Integrated current main `08a10d225306ad102b57408e2ef7566bcfb829b2` into this existing topic at `ae15d0493797e9d40b2ab2eedbf202abf14c90e3`. Current-main functions, fixtures, unrelated debt rows and exact dependency gitlinks are preserved; original topic functions and authored commits are retained. Rebuilt actual Linux libc and focused test binaries. `guest_qsort`, `guest_bounds_checking`, `guest_safe_errors`, `guest_crt` each passed three consecutive runs (12 runtime passes), plus `public_headers`; conventions and whitespace checks pass. Pinned main passed all seven selected runtime suites plus the header audit three times (24 runs). This is focused Linux CPU qualification; prior Windows/reference evidence retains its original pins. No new Windows, console, SDK-module, title, GPU or performance claim. AI-assisted: yes. Evidence: https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/owned-math6-main08a10-linux-20261030.tar.gz (SHA-256 b984a6334dce65b5c9148e3791ba21605074a5e762ea0f07f96de2f38062ef6e). <!-- codex-maintenance-20261030-repeat2-9688 --> **Qualification update — 2026-10-30, repeat 2** Integrated pinned main `e471817c68d4e1b1e44b0ce369ed88bafe4ae8ed` at `1f001f3f23c74bf5dee00803644f2f17c82ac994`, retaining original topic commits as ancestors. Main qsort_r retains its full FreeBSD helper/comparator behavior under private Reentrant-prefixed names; both sort implementations and every main qsort_r fixture are retained. Exact rename-normalized helper proof is attached. Actual Linux libc/focused binaries rebuilt from this final head; `guest_qsort`, `guest_bounds_checking`, `guest_safe_errors`, `guest_crt` each pass three consecutive runs (12 runtime passes), plus public_headers. Conventions against current origin/main and whitespace pass. Pinned main passed all seven runtime groups plus the header audit three times (24 runs). Full source/function/test/debt/header and 31 recursive dependency / 17,742 tracked-blob proofs are attached. Later main `1c6b316cf762` has 17 off-topic commits, no relevant libc/numeric/qsort/gitlink changes, and all 9 merge previews are clean; those preview trees were not executed. Focused Linux CPU scope only: prior Windows/SDK/reference reports keep original pins. The Linux portion makes no fresh Windows, console, SDK-module, title/GPU or speed measurement is claimed by this report. AI-assisted: yes. Evidence: https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/owned-math9-maine471-linux-20261030-repeat2.tar.gz (SHA256 5da4ce1732b45bb3fc566c31078c8c9ae8bf0c403654dfc60d15ee28490e20bf). Actual Windows qualification at exact published `1f001f3f23c74bf5dee00803644f2f17c82ac994`: Windows 11 Enterprise 10.0.22621, Ryzen 9 5950X, WinLibs GCC 15.2 UCRT r7, Ninja Release, BUILD_TESTING=ON. Rebuilt patched libc and guest_qsort_tests, then ran guest_qsort three times: 3/3 passes, zero skips. This checks the composed main qsort_r and branch sorting fixtures at the recorded head; no timing, SDK/game/GPU/console/macOS claim. Raw build/CTest/JUnit logs, DLL digest and terminal Windows FIFO receipt are included in https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/owned-current-windows-20261030-repeat2.tar.gz, SHA256 e423c97373758bf59239e02c138b74f35f1a45488793bc92878a4c836f94a584. AI-assisted: yes (Codex). AI-assisted: yes (Codex). ### Checklist - [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`); no silent stubs added - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source: none added - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes AI-assisted (Claude Code).
MarcZX10 commented 2026-10-22 08:43:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T08:43:22Z.

Review: APPROVED


Reviewed the introsort/three-way partition, median-of-nine threshold and step, smaller-side recursion, heap fallback, insertion behavior, null/zero-size edge handling, and the added order/constraint tests. The reported firmware-side comparison methodology is unusually strong for this behavior-sensitive change. I independently ran the current-main conventions check and git diff --check; both passed. The PR's author-reported Windows guest_qsort and suite runs are clearly scoped, and the automatic hosted checks for this PR are green where they ran; Linux/Windows product jobs are skipped by policy. I attempted the documented manual build dispatch to run those suites, but GitHub returned 403 because this account lacks repository admin rights, so I could not start it. I found no code issue requiring changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5611494585 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9688#pullrequestreview-5611494585). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T08:43:22Z. **Review:** APPROVED --- Reviewed the introsort/three-way partition, median-of-nine threshold and step, smaller-side recursion, heap fallback, insertion behavior, null/zero-size edge handling, and the added order/constraint tests. The reported firmware-side comparison methodology is unusually strong for this behavior-sensitive change. I independently ran the current-main conventions check and `git diff --check`; both passed. The PR's author-reported Windows `guest_qsort` and suite runs are clearly scoped, and the automatic hosted checks for this PR are green where they ran; Linux/Windows product jobs are skipped by policy. I attempted the documented manual build dispatch to run those suites, but GitHub returned 403 because this account lacks repository admin rights, so I could not start it. I found no code issue requiring changes.
MarcZX10 commented 2026-10-22 08:47:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T08:47:08Z.

Review: CHANGES_REQUESTED


I’ve noticed that holding this PR because of #5239 isn’t necessary. It’s fine for PRs to keep coming in; they’ll be handled in due course. Please disregard my earlier request to hold or defer it.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5611537542 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9688#pullrequestreview-5611537542). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T08:47:08Z. **Review:** CHANGES_REQUESTED --- I’ve noticed that holding this PR because of #5239 isn’t necessary. It’s fine for PRs to keep coming in; they’ll be handled in due course. Please disregard my earlier request to hold or defer it.
JJenkx commented 2026-10-22 08:59:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T08:59:10Z.


Thanks @MarcZX10, for the review and for checking the intake rule. I can't meet that rule yet. PPSA05916, PPSA13934, PPSA20423, PPSA26528 and PPSA34008 import qsort (AEJdIVZTEmo) from libc.prx. But I have no run showing one of them misbehaving because of the order of equal elements, and an import alone isn't what #5239 asks for. I'm converting this to a draft. I'll mark it ready again when a title run on current main shows the difference, or when the queue is under the threshold.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6336878544 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9688#issuecomment-6336878544). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-22T08:59:10Z. --- Thanks @MarcZX10, for the review and for checking the intake rule. I can't meet that rule yet. PPSA05916, PPSA13934, PPSA20423, PPSA26528 and PPSA34008 import `qsort` (`AEJdIVZTEmo`) from `libc.prx`. But I have no run showing one of them misbehaving because of the order of equal elements, and an import alone isn't what #5239 asks for. I'm converting this to a draft. I'll mark it ready again when a title run on current `main` shows the difference, or when the queue is under the threshold.
jotitadev commented 2026-10-22 09:01:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-22T09:01:47Z.

Review: COMMENTED


First run on Linux (the PR lists Linux as not tested). Ubuntu 26.04, glibc 2.43, x86_64 i7-8700, GCC 15.2.0, head b8247ed3b merged --no-commit onto origin/main 7e2ba73e4.

  • Release: guest_qsort + patched_libraries 2/2 pass.
  • Control (FileAndHeap.cpp from main, test from the PR): guest_qsort aborts with insertion sort below 33 elements: element 0 has tag 11, expected 3 (and the same for qsort_s), as on Windows.
  • ASan+UBSan build (-DANYPS5_ENABLE_ASAN=ON, -fsanitize=address,undefined -fno-sanitize-recover=undefined, -O1): guest_qsort passes with no reports, so the new partition, heap fallback and swaps stay in bounds for the 12, 48 and 1,000 element cases and the null/zero-size ones.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5611706775 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9688#pullrequestreview-5611706775). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-22T09:01:47Z. **Review:** COMMENTED --- First run on Linux (the PR lists Linux as not tested). Ubuntu 26.04, glibc 2.43, x86_64 i7-8700, GCC 15.2.0, head b8247ed3b merged `--no-commit` onto `origin/main` 7e2ba73e4. - Release: `guest_qsort` + `patched_libraries` 2/2 pass. - Control (`FileAndHeap.cpp` from `main`, test from the PR): `guest_qsort` aborts with `insertion sort below 33 elements: element 0 has tag 11, expected 3` (and the same for `qsort_s`), as on Windows. - ASan+UBSan build (`-DANYPS5_ENABLE_ASAN=ON`, `-fsanitize=address,undefined -fno-sanitize-recover=undefined`, `-O1`): `guest_qsort` passes with no reports, so the new partition, heap fallback and swaps stay in bounds for the 12, 48 and 1,000 element cases and the null/zero-size ones. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
JJenkx commented 2026-10-22 12:29:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T12:29:45Z.


Rebased onto main 8b3a6ba88d (head 4f25234ada, no other changes). On Windows (UCRT GCC 15.2, Release), guest_qsort and the libc tests (7 tests) pass in three runs out of three. tools/check_conventions.py passes. It stays a draft under the intake rule.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6340767281 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9688#issuecomment-6340767281). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-22T12:29:45Z. --- Rebased onto `main` 8b3a6ba88d (head 4f25234ada, no other changes). On Windows (UCRT GCC 15.2, Release), `guest_qsort` and the libc tests (7 tests) pass in three runs out of three. `tools/check_conventions.py` passes. It stays a draft under the intake rule.
JJenkx commented 2026-10-22 13:28:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T13:28:50Z.


Marked ready for review. This was a draft only because of the #5239 intake hold, which @MarcZX10 has withdrawn (https://github.com/boykopovar/AnyPS5/pull/9613#issuecomment-6337453028 and on #9596).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6341960184 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9688#issuecomment-6341960184). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-22T13:28:50Z. --- Marked ready for review. This was a draft only because of the #5239 intake hold, which @MarcZX10 has withdrawn (https://github.com/boykopovar/AnyPS5/pull/9613#issuecomment-6337453028 and on #9596).
MarcZX10 commented 2026-10-22 14:31:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T14:31:01Z.

Review: APPROVED


Correction: my earlier changes-requested review was based only on a mistaken queue hold tied to #5239. My review found no code blocker; PRs may continue to be submitted and will be handled in due course.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5615878012 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9688#pullrequestreview-5615878012). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T14:31:01Z. **Review:** APPROVED --- Correction: my earlier changes-requested review was based only on a mistaken queue hold tied to #5239. My review found no code blocker; PRs may continue to be submitted and will be handled in due course.
MarcZX10 commented 2026-10-29 06:27:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T06:27:38Z.

Review: CHANGES_REQUESTED


Re-checked — changes requested for integration

The author’s test-only follow-up adds the null-comparator/zero-size edge assertions and reports guest_qsort passing on the Linux exact head; the production implementation is unchanged from my prior review. I still find no code blocker in the reviewed algorithm.

The branch is not mergeable with current main. The merge preview conflicts in docs/dev/debt/libc.md, and both FileAndHeap.cpp and GuestQsort.cpp changed on main since this branch’s base. Please reconcile those changes on the current branch and rerun the focused qsort tests; the Windows evidence is pinned to the earlier production head. This is an integration conflict, not an intake or queue hold.

The hosted policy, relinker, conventions, and report checks pass; Linux/Windows product jobs are skipped. I did not run the sort tests locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5693708695 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9688#pullrequestreview-5693708695). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T06:27:38Z. **Review:** CHANGES_REQUESTED --- ## Re-checked — changes requested for integration The author’s test-only follow-up adds the null-comparator/zero-size edge assertions and reports `guest_qsort` passing on the Linux exact head; the production implementation is unchanged from my prior review. I still find no code blocker in the reviewed algorithm. The branch is not mergeable with current main. The merge preview conflicts in `docs/dev/debt/libc.md`, and both `FileAndHeap.cpp` and `GuestQsort.cpp` changed on main since this branch’s base. Please reconcile those changes on the current branch and rerun the focused qsort tests; the Windows evidence is pinned to the earlier production head. This is an integration conflict, not an intake or queue hold. The hosted policy, relinker, conventions, and report checks pass; Linux/Windows product jobs are skipped. I did not run the sort tests locally.
MarcZX10 commented 2026-10-29 13:37:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T13:37:43Z.

Review: APPROVED


Re-checked — new head, looks good

The new head is cleanly integrated with current main, and the author supplied the requested exact-head Windows qsort rerun with a failing negative control.

What I ran

  • Reviewed head 1c8ac1874c0ed5ccafef5112d59da6739d4a2fb6 against current main dfcc0e17cb254d08fec9ec120e362620795d59a0; the merge preview is clean.
  • Compared current-main changes since the author's integrated base 95137178d026 with the PR file list; none of the PR files changed in that interval.
  • Ran git diff --check upstream/main...refs/remotes/review/pr-9688; it passed with no output.
  • Read the author's Windows 11 focused guest_qsort rerun and negative-control report. I did not run a local C++ compiler or qsort test.
git fetch upstream main
git merge-tree --write-tree upstream/main refs/remotes/review/pr-9688
git diff --name-only 95137178d026..upstream/main
gh pr view 9688 -R boykopovar/AnyPS5 --json files --jq '.files[].path'
git diff --check upstream/main...refs/remotes/review/pr-9688
gh pr checks 9688 -R boykopovar/AnyPS5

Results

Check Result
Merge preview against current main Pass; clean tree 7a506cfabdacf52a5e8af6cc802a9c52e1cf4f4c
Main-path comparison since the reported test base No PR files changed
Diff check Pass; no output
Hosted conventions, eligibility, labels, report, Ubuntu register-context/relinker/ASan, Windows product check Pass
Author-reported exact-head Windows guest_qsort Pass 3/3
Negative control restoring main's qsort implementation Test fails, author-reported
Hosted macOS jobs and Windows relinker Pending; hosted Linux product job is skipped
Unedited command output
7a506cfabdacf52a5e8af6cc802a9c52e1cf4f4c
conventions	pass	17s	https://github.com/boykopovar/AnyPS5/actions/runs/40879860581/job/123468179757
eligibility	pass	9s	https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123468207396
labels	pass	9s	https://github.com/boykopovar/AnyPS5/actions/runs/40879860659/job/123468184591
register-context (ubuntu-latest, Debug)	pass	26s	https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310505
register-context (ubuntu-latest, Release)	pass	34s	https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310411
relinker (ubuntu-latest, g++)	pass	3m23s	https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310572
relinker-asan	pass	2m31s	https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310765
report	pass	43s	https://github.com/boykopovar/AnyPS5/actions/runs/40879868859/job/123468208152
windows	pass	4m41s	https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310429
register-context (macos-15-intel, Debug)	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310834
register-context (macos-15-intel, Release)	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310496
relinker (macos-latest, clang++)	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310448
relinker (macos-latest, clang++, x86_64)	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310362
write-watch (macos-15)	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310205
write-watch (macos-15-intel)	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310442
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475313596
relinker (windows-latest, g++)	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310538

Negative control

Assertion Change made to code under test New test failed?
New qsort behavior differs from main as required by covered cases Replaced this PR's qsort source with main's implementation, keeping the tests Yes; author-reported

Findings

Blocking

None found in the reviewed exact head.

Non-blocking

The Windows test and negative control are author-reported, not independently reproduced. The hosted macOS checks remain pending and Linux product tests are skipped.

Sources

Not verified

I did not independently run Linux, macOS, or console qsort tests. The earlier Linux report is from an older head; current-main changes since the reported integrated base do not touch the PR's files.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5698595562 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9688#pullrequestreview-5698595562). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T13:37:43Z. **Review:** APPROVED --- # Re-checked — new head, looks good The new head is cleanly integrated with current `main`, and the author supplied the requested exact-head Windows qsort rerun with a failing negative control. ## What I ran - Reviewed head `1c8ac1874c0ed5ccafef5112d59da6739d4a2fb6` against current `main` `dfcc0e17cb254d08fec9ec120e362620795d59a0`; the merge preview is clean. - Compared current-main changes since the author's integrated base `95137178d026` with the PR file list; none of the PR files changed in that interval. - Ran `git diff --check upstream/main...refs/remotes/review/pr-9688`; it passed with no output. - Read the author's Windows 11 focused `guest_qsort` rerun and negative-control report. I did not run a local C++ compiler or qsort test. ```sh git fetch upstream main git merge-tree --write-tree upstream/main refs/remotes/review/pr-9688 git diff --name-only 95137178d026..upstream/main gh pr view 9688 -R boykopovar/AnyPS5 --json files --jq '.files[].path' git diff --check upstream/main...refs/remotes/review/pr-9688 gh pr checks 9688 -R boykopovar/AnyPS5 ``` ## Results | Check | Result | |---|---| | Merge preview against current `main` | Pass; clean tree `7a506cfabdacf52a5e8af6cc802a9c52e1cf4f4c` | | Main-path comparison since the reported test base | No PR files changed | | Diff check | Pass; no output | | Hosted conventions, eligibility, labels, report, Ubuntu register-context/relinker/ASan, Windows product check | Pass | | Author-reported exact-head Windows `guest_qsort` | Pass 3/3 | | Negative control restoring main's qsort implementation | Test fails, author-reported | | Hosted macOS jobs and Windows relinker | Pending; hosted Linux product job is skipped | <details><summary>Unedited command output</summary> ```text 7a506cfabdacf52a5e8af6cc802a9c52e1cf4f4c conventions pass 17s https://github.com/boykopovar/AnyPS5/actions/runs/40879860581/job/123468179757 eligibility pass 9s https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123468207396 labels pass 9s https://github.com/boykopovar/AnyPS5/actions/runs/40879860659/job/123468184591 register-context (ubuntu-latest, Debug) pass 26s https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310505 register-context (ubuntu-latest, Release) pass 34s https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310411 relinker (ubuntu-latest, g++) pass 3m23s https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310572 relinker-asan pass 2m31s https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310765 report pass 43s https://github.com/boykopovar/AnyPS5/actions/runs/40879868859/job/123468208152 windows pass 4m41s https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310429 register-context (macos-15-intel, Debug) pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310834 register-context (macos-15-intel, Release) pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310496 relinker (macos-latest, clang++) pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310448 relinker (macos-latest, clang++, x86_64) pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310362 write-watch (macos-15) pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310205 write-watch (macos-15-intel) pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310442 linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475313596 relinker (windows-latest, g++) pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/40879868780/job/123475310538 ``` </details> ## Negative control | Assertion | Change made to code under test | New test failed? | |---|---|---| | New qsort behavior differs from main as required by covered cases | Replaced this PR's qsort source with main's implementation, keeping the tests | Yes; author-reported | ## Findings ### Blocking None found in the reviewed exact head. ### Non-blocking The Windows test and negative control are author-reported, not independently reproduced. The hosted macOS checks remain pending and Linux product tests are skipped. ## Sources - [qsort implementation and tests at the reviewed head](https://github.com/boykopovar/AnyPS5/tree/1c8ac1874c0ed5ccafef5112d59da6739d4a2fb6/core/libs) - [Author's exact-head Windows rerun and negative control](https://github.com/boykopovar/AnyPS5/pull/9688#issuecomment-6497937262) - [Contribution and test requirements at current main](https://github.com/boykopovar/AnyPS5/blob/dfcc0e17cb254d08fec9ec120e362620795d59a0/CONTRIBUTING.md) ## Not verified I did not independently run Linux, macOS, or console qsort tests. The earlier Linux report is from an older head; current-main changes since the reported integrated base do not touch the PR's files.
MarcZX10 commented 2026-10-30 04:10:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T04:10:28Z.

Review: APPROVED


Re-checked — new head, looks good

This exact head carries the reviewed qsort change through the current-main integration, with fresh focused Linux results and no remaining integration blocker.

What I ran

  • PR head ae15d0493797e9d40b2ab2eedbf202abf14c90e3; base upstream/main 5ecef095b61e7a406b279c97896f3a8a6fbd6353.
  • Merge preview: clean, tree d41c67a124b550c3841f8df76943827d3f0632a6.
  • Checked files changed on current main since integration base 08a10d225306ad102b57408e2ef7566bcfb829b2; none overlap this PR’s paths.
  • Commands:
git merge-tree --write-tree upstream/main upstream/pr/9688
git diff --check upstream/main...upstream/pr/9688
python3 tools/check_conventions.py --base upstream/main --head upstream/pr/9688

Results

Check Result
Merge preview Pass; clean tree d41c67a124b550c3841f8df76943827d3f0632a6.
Diff check Pass; no output.
Conventions Pass; All conventions checks passed.
Focused Linux validation Author reports guest_qsort, guest_bounds_checking, guest_safe_errors, and guest_crt each passed three times, plus public_headers; the pinned main suites also passed. Exact-head report
Hosted CI Windows and relinker Ubuntu/Windows, ASan, register-context, conventions, and policy checks pass. macOS jobs remain queued; product Linux is skipped.
Unedited local command output

git merge-tree --write-tree upstream/main upstream/pr/9688

d41c67a124b550c3841f8df76943827d3f0632a6

git diff --check upstream/main...upstream/pr/9688 exited 0 and produced no output.

python3 tools/check_conventions.py --base upstream/main --head upstream/pr/9688

All conventions checks passed.

Not verified

  • I did not build or run qsort tests locally; the focused test results are author-reported.
  • macOS and console behavior were not verified in this review.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5707982343 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9688#pullrequestreview-5707982343). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T04:10:28Z. **Review:** APPROVED --- # Re-checked — new head, looks good This exact head carries the reviewed qsort change through the current-main integration, with fresh focused Linux results and no remaining integration blocker. ## What I ran - PR head `ae15d0493797e9d40b2ab2eedbf202abf14c90e3`; base `upstream/main` `5ecef095b61e7a406b279c97896f3a8a6fbd6353`. - Merge preview: clean, tree `d41c67a124b550c3841f8df76943827d3f0632a6`. - Checked files changed on current main since integration base `08a10d225306ad102b57408e2ef7566bcfb829b2`; none overlap this PR’s paths. - Commands: ```sh git merge-tree --write-tree upstream/main upstream/pr/9688 git diff --check upstream/main...upstream/pr/9688 python3 tools/check_conventions.py --base upstream/main --head upstream/pr/9688 ``` ## Results | Check | Result | |---|---| | Merge preview | Pass; clean tree `d41c67a124b550c3841f8df76943827d3f0632a6`. | | Diff check | Pass; no output. | | Conventions | Pass; `All conventions checks passed.` | | Focused Linux validation | Author reports `guest_qsort`, `guest_bounds_checking`, `guest_safe_errors`, and `guest_crt` each passed three times, plus `public_headers`; the pinned main suites also passed. [Exact-head report](https://github.com/boykopovar/AnyPS5/pull/9688#issuecomment-6514580663) | | Hosted CI | Windows and relinker Ubuntu/Windows, ASan, register-context, conventions, and policy checks pass. macOS jobs remain queued; product Linux is skipped. | <details> <summary>Unedited local command output</summary> `git merge-tree --write-tree upstream/main upstream/pr/9688` ```text d41c67a124b550c3841f8df76943827d3f0632a6 ``` `git diff --check upstream/main...upstream/pr/9688` exited 0 and produced no output. `python3 tools/check_conventions.py --base upstream/main --head upstream/pr/9688` ```text All conventions checks passed. ``` </details> ## Not verified - I did not build or run qsort tests locally; the focused test results are author-reported. - macOS and console behavior were not verified in this review.
MarcZX10 commented 2026-10-30 12:32:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T12:32:22Z.

Review: APPROVED


Re-checked — new head, looks good

The exact head keeps the measured console ordering for qsort/qsort_s, preserves qsort_r’s FreeBSD implementation, and merges cleanly with current main.

What I ran

  • Reviewed head 1f001f3f23c74bf5dee00803644f2f17c82ac994 against fetched upstream/main 42d009f5f37c8f388b01fbfe38d2e704c792c46f.
  • The GitHub pull-request metadata still reported base 157b02c4f1803e9d2cd757677b9a805961203fc4; the live main...head comparison reports three changed files. I used fetched main for the current-base checks below.
  • Merge preview was clean: tree dea0c2db93033c2c242c1a67879cb5fd0b394a85.
  • Environment: Debian Linux, Python 3.11.2, Git 2.39.5, GCC 12.2.0. I did not build or compile locally.
  • Commands:
git fetch upstream main
gh api repos/boykopovar/AnyPS5/compare/main...1f001f3f23c74bf5dee00803644f2f17c82ac994 --jq '{status:.status,ahead_by:.ahead_by,behind_by:.behind_by,total_commits:.total_commits,files:(.files|length),names:[.files[].filename]}'
git merge-tree --write-tree 42d009f5f37c8f388b01fbfe38d2e704c792c46f 1f001f3f23c74bf5dee00803644f2f17c82ac994
git diff --check 42d009f5f37c8f388b01fbfe38d2e704c792c46f...1f001f3f23c74bf5dee00803644f2f17c82ac994
python3 tools/check_conventions.py --base 42d009f5f37c8f388b01fbfe38d2e704c792c46f --head 1f001f3f23c74bf5dee00803644f2f17c82ac994 --title 'fix(libc): sort like the console qsort and qsort_s' --body /tmp/9688-pr-body.md
gh pr checks 9688 --repo boykopovar/AnyPS5

Results

Check Result
Live changed-file comparison Three files: FileAndHeap.cpp, GuestQsort.cpp, and docs/dev/debt/libc.md. The branch is 129 commits behind current main.
Current-main merge preview Pass; clean tree dea0c2db93033c2c242c1a67879cb5fd0b394a85.
Diff whitespace check Pass; no output.
Conventions and PR template Pass; All conventions checks passed.
Hosted Windows Pass on this exact head (job).
Hosted Ubuntu relinker, ASan, and register-context jobs Pass (relinker, ASan, Debug, Release).
Hosted Linux product job Skipped by workflow policy.
Hosted macOS jobs Pending at the last check snapshot.
Hosted labels, conventions, eligibility, and report Pass (labels, conventions, eligibility, report).
Focused Linux runtime and public-header checks The author reports 12 focused runtime passes plus public_headers at this exact head; not independently run here.
Focused Windows guest_qsort The author reports 3/3 passes at this exact head; hosted Windows also passes.
Local PR precheck Its PR API snapshot used base 157b02c rather than fetched current main, so it evaluated a stale, 100-file comparison and reported unrelated whitespace/convention findings. I did not treat those as findings on the live three-file diff. Its isolated snapshot also lacks pr_abi_audit.py and pr_test_quality.py; those two checks were unavailable there.
Unedited output from current-base checks

gh api repos/boykopovar/AnyPS5/compare/main...1f001f3f23c74bf5dee00803644f2f17c82ac994 ...

{"ahead_by":5,"behind_by":129,"files":3,"names":["core/libs/prx/libc/src/FileAndHeap.cpp","core/libs/tests/GuestQsort.cpp","docs/dev/debt/libc.md"],"status":"diverged","total_commits":5}

git merge-tree --write-tree 42d009f5f37c8f388b01fbfe38d2e704c792c46f 1f001f3f23c74bf5dee00803644f2f17c82ac994

dea0c2db93033c2c242c1a67879cb5fd0b394a85

git diff --check 42d009f5f37c8f388b01fbfe38d2e704c792c46f...1f001f3f23c74bf5dee00803644f2f17c82ac994 exited 0 and produced no output.

python3 tools/check_conventions.py ...

All conventions checks passed.

Findings

Blocking

None found in the reviewed head.

Non-blocking

The branch is behind main, but the current-base merge preview is clean. Linux results are author-reported, and macOS, console behavior, and a current-head negative control were not independently tested.

Sources

Not verified

I did not compile locally or independently run the C++ tests, macOS jobs, a physical-console test, or a current-head negative control. The reported CI and author runs are distinguished above from checks I ran locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5712275951 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9688#pullrequestreview-5712275951). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T12:32:22Z. **Review:** APPROVED --- # Re-checked — new head, looks good The exact head keeps the measured console ordering for `qsort`/`qsort_s`, preserves `qsort_r`’s FreeBSD implementation, and merges cleanly with current `main`. ## What I ran - Reviewed head `1f001f3f23c74bf5dee00803644f2f17c82ac994` against fetched `upstream/main` `42d009f5f37c8f388b01fbfe38d2e704c792c46f`. - The GitHub pull-request metadata still reported base `157b02c4f1803e9d2cd757677b9a805961203fc4`; the live `main...head` comparison reports three changed files. I used fetched `main` for the current-base checks below. - Merge preview was clean: tree `dea0c2db93033c2c242c1a67879cb5fd0b394a85`. - Environment: Debian Linux, Python 3.11.2, Git 2.39.5, GCC 12.2.0. I did not build or compile locally. - Commands: ```sh git fetch upstream main gh api repos/boykopovar/AnyPS5/compare/main...1f001f3f23c74bf5dee00803644f2f17c82ac994 --jq '{status:.status,ahead_by:.ahead_by,behind_by:.behind_by,total_commits:.total_commits,files:(.files|length),names:[.files[].filename]}' git merge-tree --write-tree 42d009f5f37c8f388b01fbfe38d2e704c792c46f 1f001f3f23c74bf5dee00803644f2f17c82ac994 git diff --check 42d009f5f37c8f388b01fbfe38d2e704c792c46f...1f001f3f23c74bf5dee00803644f2f17c82ac994 python3 tools/check_conventions.py --base 42d009f5f37c8f388b01fbfe38d2e704c792c46f --head 1f001f3f23c74bf5dee00803644f2f17c82ac994 --title 'fix(libc): sort like the console qsort and qsort_s' --body /tmp/9688-pr-body.md gh pr checks 9688 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | |---|---| | Live changed-file comparison | Three files: `FileAndHeap.cpp`, `GuestQsort.cpp`, and `docs/dev/debt/libc.md`. The branch is 129 commits behind current `main`. | | Current-main merge preview | Pass; clean tree `dea0c2db93033c2c242c1a67879cb5fd0b394a85`. | | Diff whitespace check | Pass; no output. | | Conventions and PR template | Pass; `All conventions checks passed.` | | Hosted Windows | Pass on this exact head ([job](https://github.com/boykopovar/AnyPS5/actions/runs/41049902653/job/124046765471)). | | Hosted Ubuntu relinker, ASan, and register-context jobs | Pass ([relinker](https://github.com/boykopovar/AnyPS5/actions/runs/41049902653/job/124046765468), [ASan](https://github.com/boykopovar/AnyPS5/actions/runs/41049902653/job/124046765400), [Debug](https://github.com/boykopovar/AnyPS5/actions/runs/41049902653/job/124046765426), [Release](https://github.com/boykopovar/AnyPS5/actions/runs/41049902653/job/124046765521)). | | Hosted Linux product job | Skipped by workflow policy. | | Hosted macOS jobs | Pending at the last check snapshot. | | Hosted labels, conventions, eligibility, and report | Pass ([labels](https://github.com/boykopovar/AnyPS5/actions/runs/41053729145/job/124055901287), [conventions](https://github.com/boykopovar/AnyPS5/actions/runs/41053728853/job/124055900315), [eligibility](https://github.com/boykopovar/AnyPS5/actions/runs/41049902653/job/124043079419), [report](https://github.com/boykopovar/AnyPS5/actions/runs/41049902671/job/124043078982)). | | Focused Linux runtime and public-header checks | The author reports 12 focused runtime passes plus `public_headers` at this exact head; not independently run here. | | Focused Windows `guest_qsort` | The author reports 3/3 passes at this exact head; hosted Windows also passes. | | Local PR precheck | Its PR API snapshot used base `157b02c` rather than fetched current `main`, so it evaluated a stale, 100-file comparison and reported unrelated whitespace/convention findings. I did not treat those as findings on the live three-file diff. Its isolated snapshot also lacks `pr_abi_audit.py` and `pr_test_quality.py`; those two checks were unavailable there. | <details> <summary>Unedited output from current-base checks</summary> `gh api repos/boykopovar/AnyPS5/compare/main...1f001f3f23c74bf5dee00803644f2f17c82ac994 ...` ```text {"ahead_by":5,"behind_by":129,"files":3,"names":["core/libs/prx/libc/src/FileAndHeap.cpp","core/libs/tests/GuestQsort.cpp","docs/dev/debt/libc.md"],"status":"diverged","total_commits":5} ``` `git merge-tree --write-tree 42d009f5f37c8f388b01fbfe38d2e704c792c46f 1f001f3f23c74bf5dee00803644f2f17c82ac994` ```text dea0c2db93033c2c242c1a67879cb5fd0b394a85 ``` `git diff --check 42d009f5f37c8f388b01fbfe38d2e704c792c46f...1f001f3f23c74bf5dee00803644f2f17c82ac994` exited 0 and produced no output. `python3 tools/check_conventions.py ...` ```text All conventions checks passed. ``` </details> ## Findings ### Blocking None found in the reviewed head. ### Non-blocking The branch is behind `main`, but the current-base merge preview is clean. Linux results are author-reported, and macOS, console behavior, and a current-head negative control were not independently tested. ## Sources - [Implementation at the reviewed commit](https://github.com/boykopovar/AnyPS5/blob/1f001f3f23c74bf5dee00803644f2f17c82ac994/core/libs/prx/libc/src/FileAndHeap.cpp) - [Ordering and validation tests at the reviewed commit](https://github.com/boykopovar/AnyPS5/blob/1f001f3f23c74bf5dee00803644f2f17c82ac994/core/libs/tests/GuestQsort.cpp) - [Author’s exact-head Linux and Windows qualification report](https://github.com/boykopovar/AnyPS5/pull/9688#issuecomment-6522545602) and [qsort/qsort_r preservation explanation](https://github.com/boykopovar/AnyPS5/pull/9688#issuecomment-6522655609) ## Not verified I did not compile locally or independently run the C++ tests, macOS jobs, a physical-console test, or a current-head negative control. The reported CI and author runs are distinguished above from checks I ran locally.
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!9688
No description provided.