fix(libc): compute cbrtl with FreeBSD msun's ld80 code as the bundled libc.prx does #11632

Merged
AlexFigas merged 7 commits from upstream-pr/11632 into main 2026-11-04 04:49:26 +00:00
AlexFigas commented 2026-10-27 00:09:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlexFigas on 2026-10-27T00:09:55Z.


What

cbrtl returned the host's cbrtl. On 20,000,000 random 80-bit encodings, glibc's result differs from the console's on 2,038,367 of them. For example, cbrtl(0x8659809ec6db32bc:401d) is 0x82151d1b393fd44d:4009 on the console and …44e on the host.

The evidence is the libc.prx bundled with PPSA21564, build J03093718, the library's own code. Its cbrtl (0x42360, no calls) is FreeBSD msun's s_cbrtl.c for ld80, instruction for instruction:

  • Special values. ±∞ and NaN return x + x; ±0 returns x.
  • Subnormals. These are scaled by 2^514 (fmul by 0x6010000000000000) before the exponent is read.
  • Reduction. The mantissa gets exponent 0x3fff. It is doubled or quadrupled by k % 3, with C's truncating % and / (16-bit imul 0x5556 in the binary). The scale v keeps the argument's sign and gets exponent 0x3fff + k / 3.
  • Double-precision estimates.
    • The float conversion (fst dword) gives the 5-bit estimate (hx & 0x7fffffff) / 3 + B1, with B1 = 709958130.
    • Two Newton steps follow, dt * (dx + dx + dr) / (dx + dr + dr), in SSE doubles with no fused operations.
  • Rounding. t = dt + (2^32 + 2^-31) - 2^32 on the x87. The binary adds 2^32 + 2^-31 at run time from two stack doubles, msun's volatile vd2 and vd1, so this port reads them through volatile as well.
  • Final step. One Newton step on the x87, t + t * ((x/t² - t) / (2t + x/t²)), then t * v.

The new JoinExtended builds an 80-bit value from its mantissa and sign-exponent, the counterpart of SplitExtended.

The binary has no control-word instruction, since msun's ENTERI changes the precision only on i386 (math_private.h). It runs at the caller's x87 precision, and so does this port. The precision a guest thread starts with is #11849.

The debt list of host-computed long double functions drops cbrtl. A new entry records what is left: other SDK versions and the system libSceLibcInternal are not compared.

Licence. s_cbrtl.c's notice is copied verbatim at the top of Math.cpp, after the notices #12541 added and before the first #include, behind a Derived from FreeBSD lib/msun/src/s_cbrtl.c (release/11.4.0) line in #12541's form.

Tested

On Ubuntu 24.04 under WSL2 (GCC 13.3, Release). Head b2a99b137f merges main a4eca2a056 into the previous head 5ab9b2926a (main e0caf13600). The merge has one conflict, in docs/dev/debt/libc.md: main has #11849's shorter asinl entry and still lists cbrtl among the host-computed functions, so the resolution keeps main's asinl, drops cbrtl from the list and keeps this PR's cbrtl entry. Before that, 5ab9b2926a merged into 02c58684e5 (main 8a4fc62318), which merged into 77b2461f11, which had merged main f1e340be4a, and 9d91493c28 before it main da026c7065 and with it #12541. The native comparison and precision runs below were first made on the earlier head a180cc03b0, whose cbrtl is the same; the first bullet repeats the comparison with the binary on this head.

  • This head. guest_math and guest_math_exact pass 3 runs each. Its libc.prx gives the binary's result, errno and flags, with the control word unchanged, for 20,000,000 encodings at each of 64, 53 and 24 bits under each rounding mode (240,000,000 in all).

  • Native comparison. I used the harness from #11260, with that libc.prx's segments mapped into a Linux process. It ran the binary's cbrtl next to this one on 20,000,000 encodings:

    • normal values near 1 and across every exponent;
    • subnormals, short mantissas, ±∞, NaNs;
    • random non-canonical encodings (unnormals, pseudo-denormals, pseudo-NaNs).

    This port matches the binary's 80-bit result, NaN bits included, on every argument, and matches its errno and floating-point exception flags too. The host's cbrtl differs on 2,038,367 results and 1,000,487 flag sets.

  • Precision. The same 20,000,000 encodings at 64-, 53- and 24-bit precision, each in all four rounding modes: no difference in result, errno or flags, and the control word is unchanged after every call. Before vd was read at run time, 105 of 2,000,000 results differed at 53 bits.

  • guest_math passes. It gains CheckCbrtlConsoleBits, 17 known-answer pairs from that binary at control word 0x037f:

    • six arguments where glibc is one bit off;
    • ±27 → ±3, 2, 10;
    • the smallest subnormal and the largest normal;
    • ±0, ±∞ and a NaN payload.

    It also runs 8 at 0x027f (53 bits), with the binary's results there: 2, -27, two subnormals, a NaN, and three arguments whose 53-bit result depends on reading vd at run time.

    Each check sets the control word and requires the binary's result and x87 and SSE exception flags, the same control word afterwards, and errno unchanged. With 2^32 + 2^-31 folded at compile time, it fails at 53 bits on 0xd82f8566779298d8:b21c.

  • Whole suite. All 2536 tests passed with #11634 on top of the earlier head a180cc03b0.

  • Conventions. python3 tools/check_conventions.py --base origin/main passes with 0 errors. Its one warning is the length of the host-computed list entry, which is 1446 characters on main and 1439 here.

  • Overlap. python3 tools/pr_overlap.py --branch fix/libc-cbrtl-msun-ld80 reports #11634, which is stacked on this one, and #8417 in docs/dev/debt/libc.md.

    • #11849 has merged, so the asinl line below the entries this PR changes is main's, and the merge kept it.
    • #8417 adds tgamma to the host-computed list line that this PR takes cbrtl out of. It has had changes requested since October 26, so this PR does not wait for it; #8417 will need a one-line merge.
    • #12541, which put the notices of the ported code already on main at the top of Math.cpp, landed first as agreed there. Merging it kept all of its blocks unchanged and put this PR's block after them.
    • The tool could not compare 28 pull requests that conflict with main. Each gives the same git merge-tree conflicts with this head as with main a4eca2a056.
    • The Math.cpp and GuestMath.cpp hunks stay clear of #11260, #11262 and #11266.

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 (#12541 has merged)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5026553321 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11632). Originally posted by [AlexFigas](https://github.com/AlexFigas) on 2026-10-27T00:09:55Z. --- ### What `cbrtl` returned the host's `cbrtl`. On 20,000,000 random 80-bit encodings, glibc's result differs from the console's on 2,038,367 of them. For example, `cbrtl(0x8659809ec6db32bc:401d)` is `0x82151d1b393fd44d:4009` on the console and `…44e` on the host. The evidence is the `libc.prx` bundled with PPSA21564, build `J03093718`, the library's own code. Its `cbrtl` (0x42360, no calls) is FreeBSD msun's [`s_cbrtl.c`](https://github.com/freebsd/freebsd-src/blob/release/11.4.0/lib/msun/src/s_cbrtl.c) for ld80, instruction for instruction: - **Special values.** ±∞ and NaN return `x + x`; ±0 returns `x`. - **Subnormals.** These are scaled by 2^514 (`fmul` by `0x6010000000000000`) before the exponent is read. - **Reduction.** The mantissa gets exponent `0x3fff`. It is doubled or quadrupled by `k % 3`, with C's truncating `%` and `/` (16-bit `imul 0x5556` in the binary). The scale `v` keeps the argument's sign and gets exponent `0x3fff + k / 3`. - **Double-precision estimates.** - The `float` conversion (`fst dword`) gives the 5-bit estimate `(hx & 0x7fffffff) / 3 + B1`, with `B1 = 709958130`. - Two Newton steps follow, `dt * (dx + dx + dr) / (dx + dr + dr)`, in SSE doubles with no fused operations. - **Rounding.** `t = dt + (2^32 + 2^-31) - 2^32` on the x87. The binary adds `2^32 + 2^-31` at run time from two stack doubles, msun's volatile `vd2` and `vd1`, so this port reads them through `volatile` as well. - **Final step.** One Newton step on the x87, `t + t * ((x/t² - t) / (2t + x/t²))`, then `t * v`. The new `JoinExtended` builds an 80-bit value from its mantissa and sign-exponent, the counterpart of `SplitExtended`. The binary has no control-word instruction, since msun's `ENTERI` changes the precision only on i386 ([`math_private.h`](https://github.com/freebsd/freebsd-src/blob/release/11.4.0/lib/msun/src/math_private.h)). It runs at the caller's x87 precision, and so does this port. The precision a guest thread starts with is #11849. The debt list of host-computed long double functions drops `cbrtl`. A new entry records what is left: other SDK versions and the system `libSceLibcInternal` are not compared. **Licence.** `s_cbrtl.c`'s notice is copied verbatim at the top of `Math.cpp`, after the notices #12541 added and before the first `#include`, behind a `Derived from FreeBSD lib/msun/src/s_cbrtl.c (release/11.4.0)` line in #12541's form. ### Tested <!-- 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. --> On Ubuntu 24.04 under WSL2 (GCC 13.3, Release). Head b2a99b137f merges `main` a4eca2a056 into the previous head 5ab9b2926a (`main` e0caf13600). The merge has one conflict, in `docs/dev/debt/libc.md`: `main` has #11849's shorter `asinl` entry and still lists `cbrtl` among the host-computed functions, so the resolution keeps `main`'s `asinl`, drops `cbrtl` from the list and keeps this PR's `cbrtl` entry. Before that, 5ab9b2926a merged into 02c58684e5 (`main` 8a4fc62318), which merged into 77b2461f11, which had merged `main` f1e340be4a, and 9d91493c28 before it `main` da026c7065 and with it #12541. The native comparison and precision runs below were first made on the earlier head a180cc03b0, whose `cbrtl` is the same; the first bullet repeats the comparison with the binary on this head. - **This head.** `guest_math` and `guest_math_exact` pass 3 runs each. Its `libc.prx` gives the binary's result, `errno` and flags, with the control word unchanged, for 20,000,000 encodings at each of 64, 53 and 24 bits under each rounding mode (240,000,000 in all). - **Native comparison.** I used the harness from #11260, with that `libc.prx`'s segments mapped into a Linux process. It ran the binary's `cbrtl` next to this one on 20,000,000 encodings: - normal values near 1 and across every exponent; - subnormals, short mantissas, ±∞, NaNs; - random non-canonical encodings (unnormals, pseudo-denormals, pseudo-NaNs). This port matches the binary's 80-bit result, NaN bits included, on every argument, and matches its `errno` and floating-point exception flags too. The host's `cbrtl` differs on 2,038,367 results and 1,000,487 flag sets. - **Precision.** The same 20,000,000 encodings at 64-, 53- and 24-bit precision, each in all four rounding modes: no difference in result, `errno` or flags, and the control word is unchanged after every call. Before `vd` was read at run time, 105 of 2,000,000 results differed at 53 bits. - **`guest_math` passes.** It gains `CheckCbrtlConsoleBits`, 17 known-answer pairs from that binary at control word `0x037f`: - six arguments where glibc is one bit off; - ±27 → ±3, 2, 10; - the smallest subnormal and the largest normal; - ±0, ±∞ and a NaN payload. It also runs 8 at `0x027f` (53 bits), with the binary's results there: 2, -27, two subnormals, a NaN, and three arguments whose 53-bit result depends on reading `vd` at run time. Each check sets the control word and requires the binary's result and x87 and SSE exception flags, the same control word afterwards, and `errno` unchanged. With `2^32 + 2^-31` folded at compile time, it fails at 53 bits on `0xd82f8566779298d8:b21c`. - **Whole suite.** All 2536 tests passed with #11634 on top of the earlier head a180cc03b0. - **Conventions.** `python3 tools/check_conventions.py --base origin/main` passes with 0 errors. Its one warning is the length of the host-computed list entry, which is 1446 characters on `main` and 1439 here. - **Overlap.** `python3 tools/pr_overlap.py --branch fix/libc-cbrtl-msun-ld80` reports #11634, which is stacked on this one, and #8417 in `docs/dev/debt/libc.md`. - #11849 has merged, so the `asinl` line below the entries this PR changes is `main`'s, and the merge kept it. - #8417 adds `tgamma` to the host-computed list line that this PR takes `cbrtl` out of. It has had changes requested since October 26, so this PR does not wait for it; #8417 will need a one-line merge. - #12541, which put the notices of the ported code already on `main` at the top of `Math.cpp`, landed first as agreed there. Merging it kept all of its blocks unchanged and put this PR's block after them. - The tool could not compare 28 pull requests that conflict with `main`. Each gives the same `git merge-tree` conflicts with this head as with `main` a4eca2a056. - The `Math.cpp` and `GuestMath.cpp` hunks stay clear of #11260, #11262 and #11266. ### 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 (#12541 has merged) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-27 00:13:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T00:13:16Z.

Review: CHANGES_REQUESTED


Reviewed exact head 490bd42d523538b1796a60156b3064d30ba00044. Changes requested for a runtime precision-control mismatch.

[P1] cbrtl_nid_postfix: the console-bit match does not hold under the guest thread’s default x87 precision. The implementation performs its final rounding and Newton step with x87 long double arithmetic, so its result depends on the x87 precision-control field. The PR’s own debt entry says it matches the bundled console code only at 64-bit precision, while Windows guest threads started by _beginthreadex use 53-bit precision (0x027f). This leaves the newly implemented export returning different bits on the normal Windows guest-thread state; the current known-answer tests only exercise the 64-bit state and therefore miss that case. Please make the result match the console independently of the caller’s precision mode (while preserving the caller’s floating-point environment as required), and add a regression that starts from 53-bit precision and verifies both the expected result and the restored control word/status. If this limitation is intentional, it should not be presented as a completed console-compatible implementation without an explicit scope decision.

The PR’s reported 20-million-input native comparison is useful, but it is explicitly at 64-bit precision; the hosted product jobs are skipped by path policy, and the relinker/ASan checks are still running at review time.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5660763866 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11632#pullrequestreview-5660763866). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T00:13:16Z. **Review:** CHANGES_REQUESTED --- Reviewed exact head `490bd42d523538b1796a60156b3064d30ba00044`. Changes requested for a runtime precision-control mismatch. **[P1] `cbrtl_nid_postfix`: the console-bit match does not hold under the guest thread’s default x87 precision.** The implementation performs its final rounding and Newton step with x87 `long double` arithmetic, so its result depends on the x87 precision-control field. The PR’s own debt entry says it matches the bundled console code only at 64-bit precision, while Windows guest threads started by `_beginthreadex` use 53-bit precision (`0x027f`). This leaves the newly implemented export returning different bits on the normal Windows guest-thread state; the current known-answer tests only exercise the 64-bit state and therefore miss that case. Please make the result match the console independently of the caller’s precision mode (while preserving the caller’s floating-point environment as required), and add a regression that starts from 53-bit precision and verifies both the expected result and the restored control word/status. If this limitation is intentional, it should not be presented as a completed console-compatible implementation without an explicit scope decision. The PR’s reported 20-million-input native comparison is useful, but it is explicitly at 64-bit precision; the hosted product jobs are skipped by path policy, and the relinker/ASan checks are still running at review time.
MarcZX10 commented 2026-10-27 11:01:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T11:01:17Z.

Review: COMMENTED


I reviewed the exact head a180cc03b072a0db8d4dbafaca55ef313d447a80. The port follows the stated FreeBSD msun sequence, and the committed known-answer cases exercise positive/negative values, subnormals, non-canonical encodings, infinities, NaNs, and both 64-bit and 53-bit precision. I found no specific arithmetic defect in this pass.

Independent local check: I built the exact guest_math_tests target on Linux with the repository-pinned dependencies and ran it natively; it exited 0. The host cannot run the full product suite because it lacks AVX2/FMA. The hosted Windows check and Ubuntu/Windows relinker plus ASan checks pass; macOS compiler, register-context Debug, and one write-watch job are still queued, while the full Linux product job is skipped by path policy. I am leaving this as a comment review until those macOS jobs finish and the required platform coverage is complete.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5665966527 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11632#pullrequestreview-5665966527). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T11:01:17Z. **Review:** COMMENTED --- I reviewed the exact head a180cc03b072a0db8d4dbafaca55ef313d447a80. The port follows the stated FreeBSD msun sequence, and the committed known-answer cases exercise positive/negative values, subnormals, non-canonical encodings, infinities, NaNs, and both 64-bit and 53-bit precision. I found no specific arithmetic defect in this pass. Independent local check: I built the exact `guest_math_tests` target on Linux with the repository-pinned dependencies and ran it natively; it exited 0. The host cannot run the full product suite because it lacks AVX2/FMA. The hosted Windows check and Ubuntu/Windows relinker plus ASan checks pass; macOS compiler, register-context Debug, and one write-watch job are still queued, while the full Linux product job is skipped by path policy. I am leaving this as a comment review until those macOS jobs finish and the required platform coverage is complete.
MarcZX10 commented 2026-10-27 15:12:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T15:12:31Z.

Review: CHANGES_REQUESTED


I reviewed the exact head a180cc03b072a0db8d4dbafaca55ef313d447a80. The port follows the stated FreeBSD msun sequence, and the committed known-answer cases exercise positive/negative values, subnormals, non-canonical encodings, infinities, NaNs, and both 64-bit and 53-bit precision. I found no specific arithmetic defect in this pass.

Independent local check: I built the exact guest_math_tests target on Linux with the repository-pinned dependencies and ran it natively; it exited 0. The host cannot run the full product suite because it lacks AVX2/FMA. The hosted Windows check and Ubuntu/Windows relinker plus ASan checks pass; macOS compiler, register-context Debug, and one write-watch job are still queued, while the full Linux product job is skipped by path policy. I am leaving this as a comment review until those macOS jobs finish and the required platform coverage is complete.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5669493317 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11632#pullrequestreview-5669493317). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T15:12:31Z. **Review:** CHANGES_REQUESTED --- I reviewed the exact head a180cc03b072a0db8d4dbafaca55ef313d447a80. The port follows the stated FreeBSD msun sequence, and the committed known-answer cases exercise positive/negative values, subnormals, non-canonical encodings, infinities, NaNs, and both 64-bit and 53-bit precision. I found no specific arithmetic defect in this pass. Independent local check: I built the exact `guest_math_tests` target on Linux with the repository-pinned dependencies and ran it natively; it exited 0. The host cannot run the full product suite because it lacks AVX2/FMA. The hosted Windows check and Ubuntu/Windows relinker plus ASan checks pass; macOS compiler, register-context Debug, and one write-watch job are still queued, while the full Linux product job is skipped by path policy. I am leaving this as a comment review until those macOS jobs finish and the required platform coverage is complete.
MarcZX10 commented 2026-10-27 15:12:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T15:12:44Z.

Review: CHANGES_REQUESTED


The arithmetic review did not find a defect in the cbrtl port. I also built and ran guest_math and guest_math_exact three times each using the PR's changed Math.cpp and GuestMath.cpp applied to a clean build based on this PR's original base; the tests passed. The combined build also contained unrelated #11213 exception changes, so this is focused local evidence rather than a build of this exact commit.

I cannot approve the current branch because its contribution/landing coordination is incomplete. A merge preview of the current #11632 and #11849 heads conflicts in docs/dev/debt/libc.md. #11849 narrows the asinl debt entry; this PR reorganizes the same long-double math section to document cbrtl. The PR overlap workflow currently reported only #11634, and this PR's checklist says “Depends on: none,” so the #11849 overlap and landing order are not declared. CONTRIBUTING.md asks authors to agree which overlapping PR goes first and declare that dependency.

Please coordinate the order with #11849 and update the dependency/overlap information, then rebase or otherwise show a clean merge preview against the agreed order. This request concerns the documented debt-file conflict and landing sequence; it is not a request to change the reviewed arithmetic.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5669496825 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11632#pullrequestreview-5669496825). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T15:12:44Z. **Review:** CHANGES_REQUESTED --- The arithmetic review did not find a defect in the `cbrtl` port. I also built and ran `guest_math` and `guest_math_exact` three times each using the PR's changed `Math.cpp` and `GuestMath.cpp` applied to a clean build based on this PR's original base; the tests passed. The combined build also contained unrelated #11213 exception changes, so this is focused local evidence rather than a build of this exact commit. I cannot approve the current branch because its contribution/landing coordination is incomplete. A merge preview of the current #11632 and #11849 heads conflicts in `docs/dev/debt/libc.md`. #11849 narrows the `asinl` debt entry; this PR reorganizes the same long-double math section to document `cbrtl`. The PR overlap workflow currently reported only #11634, and this PR's checklist says “Depends on: none,” so the #11849 overlap and landing order are not declared. `CONTRIBUTING.md` asks authors to agree which overlapping PR goes first and declare that dependency. Please coordinate the order with #11849 and update the dependency/overlap information, then rebase or otherwise show a clean merge preview against the agreed order. This request concerns the documented debt-file conflict and landing sequence; it is not a request to change the reviewed arithmetic.
MarcZX10 commented 2026-10-27 19:10:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T19:10:33Z.

Review: APPROVED


I re-reviewed exact head 77d43c5de51bb0416e7a596e401507df9549a85e after the overlap follow-up. The landing order is now explicit: #11632, then #11634, then #11849; #11849 declares both math PRs as dependencies, and the author documented the one debt-file conflict and how to preserve both entries. This satisfies the repository's overlap-order requirement. The current-main merge preview for this PR is clean.

The focused guest_math build and repeated tests passed in my earlier review. The hosted checks on this head are green apart from the Linux product job being skipped; the author also supplied Windows and binary-comparison evidence. I found no implementation defect in the reviewed cbrtl path. Approved; retain the declared #11077 dependency and the stated landing order.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5672844073 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11632#pullrequestreview-5672844073). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T19:10:33Z. **Review:** APPROVED --- I re-reviewed exact head 77d43c5de51bb0416e7a596e401507df9549a85e after the overlap follow-up. The landing order is now explicit: #11632, then #11634, then #11849; #11849 declares both math PRs as dependencies, and the author documented the one debt-file conflict and how to preserve both entries. This satisfies the repository's overlap-order requirement. The current-main merge preview for this PR is clean. The focused guest_math build and repeated tests passed in my earlier review. The hosted checks on this head are green apart from the Linux product job being skipped; the author also supplied Windows and binary-comparison evidence. I found no implementation defect in the reviewed cbrtl path. Approved; retain the declared #11077 dependency and the stated landing order.
MarcZX10 commented 2026-10-28 16:51:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T16:51:47Z.

Review: APPROVED


Re-reviewed exact current head d842922824753d84a30f90241ca1c10f3fa7068d. The post-approval change adds the s_cbrtl.c copyright and permissive license notice directly above the port; I compared it with FreeBSD release/11.4.0 and it matches verbatim. The implementation/test review and the declared #11632 → #11634 → #11849 landing sequence remain applicable. Hosted Ubuntu, Windows, macOS, ASan, register-context and write-watch checks pass; the Linux product job is skipped by workflow filters. The author reports guest_math and title-binary comparisons rerun on the new heads. No PS5 title run is claimed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5686449114 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11632#pullrequestreview-5686449114). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T16:51:47Z. **Review:** APPROVED --- Re-reviewed exact current head `d842922824753d84a30f90241ca1c10f3fa7068d`. The post-approval change adds the `s_cbrtl.c` copyright and permissive license notice directly above the port; I compared it with FreeBSD release/11.4.0 and it matches verbatim. The implementation/test review and the declared #11632 → #11634 → #11849 landing sequence remain applicable. Hosted Ubuntu, Windows, macOS, ASan, register-context and write-watch checks pass; the Linux product job is skipped by workflow filters. The author reports `guest_math` and title-binary comparisons rerun on the new heads. No PS5 title run is claimed.
MarcZX10 commented 2026-10-29 08:35:08 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


Re-reviewed exact head d842922824753d84a30f90241ca1c10f3fa7068d after the new maintainer comment. The FreeBSD s_cbrtl.c copyright/license notice is currently placed immediately above cbrtl_nid_postfix around line 567. Please move that intact block to the top of Math.cpp, as required for the ported source, without changing its text. Current-main merge preview is clean and git diff --check passes. No arithmetic or test changes are requested.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5694863226 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11632#pullrequestreview-5694863226). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T08:35:08Z. **Review:** CHANGES_REQUESTED --- Re-reviewed exact head `d842922824753d84a30f90241ca1c10f3fa7068d` after the new maintainer comment. The FreeBSD `s_cbrtl.c` copyright/license notice is currently placed immediately above `cbrtl_nid_postfix` around line 567. Please move that intact block to the top of `Math.cpp`, as required for the ported source, without changing its text. Current-main merge preview is clean and `git diff --check` passes. No arithmetic or test changes are requested.
MarcZX10 commented 2026-10-29 11:07:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T11:07:53Z.

Review: CHANGES_REQUESTED


Re-checked — changes requested

The source notice is now placed in the requested form, and the update reports three guest_math runs plus the bundled-libc comparison. That resolves the prior notice-placement finding. However, the branch is based on 1b580f13cf, while current main is ba5b5330b3; current main has changed Math.cpp, GuestMath.cpp and the libc debt file touched by this PR. Please integrate current main and rerun the focused math tests and cbrtl comparison on the resulting exact head. The reported earlier-head results do not cover these intervening code/test changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5696706576 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11632#pullrequestreview-5696706576). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T11:07:53Z. **Review:** CHANGES_REQUESTED --- ## Re-checked — changes requested The source notice is now placed in the requested form, and the update reports three `guest_math` runs plus the bundled-libc comparison. That resolves the prior notice-placement finding. However, the branch is based on `1b580f13cf`, while current `main` is `ba5b5330b3`; current main has changed `Math.cpp`, `GuestMath.cpp` and the libc debt file touched by this PR. Please integrate current main and rerun the focused math tests and `cbrtl` comparison on the resulting exact head. The reported earlier-head results do not cover these intervening code/test changes.
MarcZX10 commented 2026-10-30 10:19:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T10:19:58Z.

Review: CHANGES_REQUESTED


Re-checked — changes requested

Reviewed exact head 554c60b29f5bd03b9b4cee33a653f9960bcd0b91; the remaining blocker is the maintainer-directed landing order with #12541, which is not reflected in this PR's checklist.

What I ran

The PR base is 98ddd9c1792bbab016ceed5db267a93d1d61f00a; current main is 07253ec3794121657a8d9a2229a6224651b0c8f5. The head merges cleanly into current main. Local no-build checks ran on Linux (Debian, Python 3.11.2, GCC 12.2.0); I did not configure or build.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 11632
git diff --check 98ddd9c1792bbab016ceed5db267a93d1d61f00a...554c60b29f5bd03b9b4cee33a653f9960bcd0b91
git merge-tree --write-tree refs/remotes/upstream/main 554c60b29f5bd03b9b4cee33a653f9960bcd0b91

Results

Check Result
Diff check Passed; no whitespace errors.
Conventions Passed with a non-failing debt-length warning on docs/dev/debt/libc.md.
Current-main merge preview Clean despite a current-main change to docs/dev/debt/libc.md.
Hosted CI on this head Relinker and register-context jobs passed; Windows passed; Linux product tests were skipped; two macOS write-watch jobs failed.
guest_math and bundled-libc comparison The author reports three exact-head test runs and 240 million cbrtl comparisons across precisions/rounding modes; I did not independently run them.
Precheck tooling Overall precheck reported failure because the isolated checkout lacks the local ABI/test-quality helper scripts, and its stack parser reports a cycle inconsistent with the live checklist dependencies. The actual declared order is #11632 → #11634.
Selected unedited output
docs/dev/debt/libc.md:158: warning: [debt-length] Technical debt entry over 1000 characters: state the gap first (what differs from the console, what is unverified, what throws) and keep only the behaviour it needs: 1439 characters
1 findings, 0 errors; GitHub shows at most 10 error annotations, the job summary lists all
fb48b8585bbbe74cee5f8582fcc5fca3e07b86b3
- PR #11632: Declared dependency cycle involving PRs [11632, 11634]

Findings

Blocking

The current checklist says Depends on: none, but maintainer direction on #12541 is to land #12541 first and declare Depends on: #12541 on both #11632 and #11634. This PR's FreeBSD license notice shares the top-of-file insertion point with #12541, so the order needs to be recorded before approval. Please update this checklist now; after #12541 merges, rebase this PR onto current main, preserve both notice blocks, and obtain fresh CI.

Non-blocking

The conventions check warns that the modified libc debt entry is 1,439 characters, above its 1,000-character guidance. It is not a conventions error and does not block this review request.

Sources

Not verified

I did not build or run guest_math or the bundled-library comparison locally. The author-reported math runs are on the exact PR head; the physical console was not tested. CI statuses above are from the exact-head snapshot and may change after this review.

To get this to a good state

Update the checklist to Depends on: #12541. Once #12541 merges, rebase this PR onto current main, keep both license blocks at the top of Math.cpp, and rerun fresh CI plus the focused math validation. I will rerun the same available no-build checks and inspect the new head before reviewing again.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5710901009 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11632#pullrequestreview-5710901009). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T10:19:58Z. **Review:** CHANGES_REQUESTED --- # Re-checked — changes requested Reviewed exact head `554c60b29f5bd03b9b4cee33a653f9960bcd0b91`; the remaining blocker is the maintainer-directed landing order with #12541, which is not reflected in this PR's checklist. ## What I ran The PR base is `98ddd9c1792bbab016ceed5db267a93d1d61f00a`; current `main` is `07253ec3794121657a8d9a2229a6224651b0c8f5`. The head merges cleanly into current `main`. Local no-build checks ran on Linux (Debian, Python 3.11.2, GCC 12.2.0); I did not configure or build. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 11632 git diff --check 98ddd9c1792bbab016ceed5db267a93d1d61f00a...554c60b29f5bd03b9b4cee33a653f9960bcd0b91 git merge-tree --write-tree refs/remotes/upstream/main 554c60b29f5bd03b9b4cee33a653f9960bcd0b91 ``` ## Results | Check | Result | |---|---| | Diff check | Passed; no whitespace errors. | | Conventions | Passed with a non-failing debt-length warning on `docs/dev/debt/libc.md`. | | Current-main merge preview | Clean despite a current-`main` change to `docs/dev/debt/libc.md`. | | Hosted CI on this head | Relinker and register-context jobs passed; Windows passed; Linux product tests were skipped; two macOS write-watch jobs failed. | | `guest_math` and bundled-libc comparison | The author reports three exact-head test runs and 240 million `cbrtl` comparisons across precisions/rounding modes; I did not independently run them. | | Precheck tooling | Overall precheck reported failure because the isolated checkout lacks the local ABI/test-quality helper scripts, and its stack parser reports a cycle inconsistent with the live checklist dependencies. The actual declared order is #11632 → #11634. | <details><summary>Selected unedited output</summary> ```text docs/dev/debt/libc.md:158: warning: [debt-length] Technical debt entry over 1000 characters: state the gap first (what differs from the console, what is unverified, what throws) and keep only the behaviour it needs: 1439 characters 1 findings, 0 errors; GitHub shows at most 10 error annotations, the job summary lists all ``` ```text fb48b8585bbbe74cee5f8582fcc5fca3e07b86b3 ``` ```text - PR #11632: Declared dependency cycle involving PRs [11632, 11634] ``` </details> ## Findings ### Blocking The current checklist says `Depends on: none`, but maintainer direction on #12541 is to land #12541 first and declare `Depends on: #12541` on both #11632 and #11634. This PR's FreeBSD license notice shares the top-of-file insertion point with #12541, so the order needs to be recorded before approval. Please update this checklist now; after #12541 merges, rebase this PR onto current `main`, preserve both notice blocks, and obtain fresh CI. ### Non-blocking The conventions check warns that the modified libc debt entry is 1,439 characters, above its 1,000-character guidance. It is not a conventions error and does not block this review request. ## Sources - [Contribution rules at current main](https://github.com/boykopovar/AnyPS5/blob/07253ec3794121657a8d9a2229a6224651b0c8f5/CONTRIBUTING.md#L62-L69) - [Maintainer's landing-order instruction on #12541](https://github.com/boykopovar/AnyPS5/pull/12541#issuecomment-6520110624) - [Current #11632 review request](https://github.com/boykopovar/AnyPS5/pull/11632) ## Not verified I did not build or run `guest_math` or the bundled-library comparison locally. The author-reported math runs are on the exact PR head; the physical console was not tested. CI statuses above are from the exact-head snapshot and may change after this review. ## To get this to a good state Update the checklist to `Depends on: #12541`. Once #12541 merges, rebase this PR onto current `main`, keep both license blocks at the top of `Math.cpp`, and rerun fresh CI plus the focused math validation. I will rerun the same available no-build checks and inspect the new head before reviewing again.
MarcZX10 commented 2026-10-30 14:59:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T14:59:25Z.

Review: CHANGES_REQUESTED


Re-checked — new head, changes requested

The #12541 landing-order finding is resolved and the current-main merge preview is clean, but this branch still does not include current main as required by the repository rules.

What I ran

Reviewed head 9d91493c28768bfaa7e63d5eb6c92263835139f7 against PR base da026c70655a132031d45e2008c24f993870d801 on Debian 12 x86_64, Python 3.11.2, GCC 12.2.0. Current main is ed1e0ed08fc2452192df91793a33dd0cc7ad5212; merging the head into it previews cleanly.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 11632
git diff --check refs/remotes/upstream/main...9d91493c28768bfaa7e63d5eb6c92263835139f7
git merge-tree --write-tree refs/remotes/upstream/main 9d91493c28768bfaa7e63d5eb6c92263835139f7
gh pr checks 11632 --repo boykopovar/AnyPS5

Results

Check Result
Conventions Hosted check passed.
Merge preview Clean onto current main; preview tree 680dae1c5824ce047dab5e6d1300bec736d969e6.
Diff check Reports trailing whitespace in the verbatim Sun Microsystems notice at Math.cpp:61; the hosted conventions check passes.
Math validation The author reports three guest_math runs on this head and 240 million comparisons across precision/rounding combinations; I did not independently run them.
Hosted CI Ubuntu and Windows relinker, Ubuntu register-context, Windows, ASan, conventions, eligibility, library-portability, labels and report passed. Linux product tests were skipped; macOS relinker, register-context and write-watch jobs remain queued.
Precheck helpers ABI audit and test-quality scripts are absent from the isolated PR checkout; the stack checker reports a false-positive dependency cycle despite the live checklist/order being #11632 → #11634.
Selected unedited output
core/libs/prx/libc/src/Math.cpp:61: trailing whitespace.
+ * software is freely granted, provided that this notice 
680dae1c5824ce047dab5e6d1300bec736d969e6
relinker (ubuntu-latest, g++)	pass
relinker (windows-latest, g++)	pass
relinker (macos-latest, clang++)	pending
register-context (ubuntu-latest, Debug)	pass
register-context (macos-15-intel, Debug)	pending
write-watch (macos-15-intel)	pending
linux	skipping
windows	pass

Negative control

Not independently exercised. The author reports CheckCbrtlConsoleBits detects the prior folded-constant regression; I did not build or run the exact-head binary.

Findings

Blocking

The head contains main only through da026c70655a132031d45e2008c24f993870d801, while current main is ed1e0ed08fc2452192df91793a33dd0cc7ad5212. CONTRIBUTING.md requires keeping branches up to date. The changed paths have no later-main edits and the merge preview is clean, but this branch remains behind. Please merge current main into this PR and rerun the focused math tests on the resulting head.

Non-blocking

The copied upstream license notice has one trailing space; the hosted conventions check passes. The precheck's stack-cycle result is inconsistent with the actual checklist and clean dependency preview. MacOS hosted jobs are still pending, and the author-reported comparison runs are not independent verification.

Sources

Not verified

No local build or CTest run; no PS5-console run. The hosted macOS jobs remain queued.

To get this to a good state

Merge current main into #11632, preserve the #11632 → #11634 → #11849 landing order, and rerun the focused math tests on the exact updated head. I will repeat the no-build checks and re-review that head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5714177802 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11632#pullrequestreview-5714177802). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T14:59:25Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, changes requested The #12541 landing-order finding is resolved and the current-main merge preview is clean, but this branch still does not include current `main` as required by the repository rules. ## What I ran Reviewed head `9d91493c28768bfaa7e63d5eb6c92263835139f7` against PR base `da026c70655a132031d45e2008c24f993870d801` on Debian 12 x86_64, Python 3.11.2, GCC 12.2.0. Current `main` is `ed1e0ed08fc2452192df91793a33dd0cc7ad5212`; merging the head into it previews cleanly. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 11632 git diff --check refs/remotes/upstream/main...9d91493c28768bfaa7e63d5eb6c92263835139f7 git merge-tree --write-tree refs/remotes/upstream/main 9d91493c28768bfaa7e63d5eb6c92263835139f7 gh pr checks 11632 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | |---|---| | Conventions | Hosted check passed. | | Merge preview | Clean onto current `main`; preview tree `680dae1c5824ce047dab5e6d1300bec736d969e6`. | | Diff check | Reports trailing whitespace in the verbatim Sun Microsystems notice at `Math.cpp:61`; the hosted conventions check passes. | | Math validation | The author reports three `guest_math` runs on this head and 240 million comparisons across precision/rounding combinations; I did not independently run them. | | Hosted CI | Ubuntu and Windows relinker, Ubuntu register-context, Windows, ASan, conventions, eligibility, library-portability, labels and report passed. Linux product tests were skipped; macOS relinker, register-context and write-watch jobs remain queued. | | Precheck helpers | ABI audit and test-quality scripts are absent from the isolated PR checkout; the stack checker reports a false-positive dependency cycle despite the live checklist/order being #11632 → #11634. | <details><summary>Selected unedited output</summary> ```text core/libs/prx/libc/src/Math.cpp:61: trailing whitespace. + * software is freely granted, provided that this notice ``` ```text 680dae1c5824ce047dab5e6d1300bec736d969e6 ``` ```text relinker (ubuntu-latest, g++) pass relinker (windows-latest, g++) pass relinker (macos-latest, clang++) pending register-context (ubuntu-latest, Debug) pass register-context (macos-15-intel, Debug) pending write-watch (macos-15-intel) pending linux skipping windows pass ``` </details> ## Negative control Not independently exercised. The author reports `CheckCbrtlConsoleBits` detects the prior folded-constant regression; I did not build or run the exact-head binary. ## Findings ### Blocking The head contains `main` only through `da026c70655a132031d45e2008c24f993870d801`, while current `main` is `ed1e0ed08fc2452192df91793a33dd0cc7ad5212`. `CONTRIBUTING.md` requires keeping branches up to date. The changed paths have no later-main edits and the merge preview is clean, but this branch remains behind. Please merge current `main` into this PR and rerun the focused math tests on the resulting head. ### Non-blocking The copied upstream license notice has one trailing space; the hosted conventions check passes. The precheck's stack-cycle result is inconsistent with the actual checklist and clean dependency preview. MacOS hosted jobs are still pending, and the author-reported comparison runs are not independent verification. ## Sources - [Branch synchronization rule at current main](https://github.com/boykopovar/AnyPS5/blob/ed1e0ed08fc2452192df91793a33dd0cc7ad5212/CONTRIBUTING.md#L60) - [Reviewed implementation at this head](https://github.com/boykopovar/AnyPS5/blob/9d91493c28768bfaa7e63d5eb6c92263835139f7/core/libs/prx/libc/src/Math.cpp) - [#12541 landing-order update](https://github.com/boykopovar/AnyPS5/pull/12541) ## Not verified No local build or CTest run; no PS5-console run. The hosted macOS jobs remain queued. ## To get this to a good state Merge current `main` into #11632, preserve the #11632 → #11634 → #11849 landing order, and rerun the focused math tests on the exact updated head. I will repeat the no-build checks and re-review that head.
MarcZX10 commented 2026-10-30 15:00:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T15:00:07Z.

Review: CHANGES_REQUESTED


Re-checked — new head, changes requested

Correction to my preceding review: git diff --check passes for the PR diff against its base; the trailing-space line I reported was from comparing the older reviewed head to the new head. The current-main synchronization finding remains.

What I ran

Reviewed head 9d91493c28768bfaa7e63d5eb6c92263835139f7 against PR base da026c70655a132031d45e2008c24f993870d801 on Debian 12 x86_64, Python 3.11.2, GCC 12.2.0. Current main is ed1e0ed08fc2452192df91793a33dd0cc7ad5212; the merge preview is clean.

git diff --check da026c70655a132031d45e2008c24f993870d801...9d91493c28768bfaa7e63d5eb6c92263835139f7
git merge-tree --write-tree refs/remotes/upstream/main 9d91493c28768bfaa7e63d5eb6c92263835139f7
gh pr checks 11632 --repo boykopovar/AnyPS5

Results

Check Result
Diff check Passed.
Conventions Hosted check passed.
Merge preview Clean onto current main; preview tree 680dae1c5824ce047dab5e6d1300bec736d969e6.
Math validation The author reports three guest_math runs on this head and 240 million comparisons across precision/rounding combinations; I did not independently run them.
Hosted CI Ubuntu and Windows relinker, Ubuntu register-context, Windows, ASan, conventions, eligibility, library-portability, labels and report passed. Linux product tests were skipped; macOS relinker, register-context and write-watch jobs remain queued.
Precheck helpers ABI audit and test-quality scripts are absent from the isolated PR checkout; the stack checker reports a false-positive dependency cycle despite the live checklist/order being #11632 → #11634.
Selected unedited output
exit=0
680dae1c5824ce047dab5e6d1300bec736d969e6
relinker (ubuntu-latest, g++)	pass
relinker (windows-latest, g++)	pass
relinker (macos-latest, clang++)	pending
register-context (ubuntu-latest, Debug)	pass
register-context (macos-15-intel, Debug)	pending
write-watch (macos-15-intel)	pending
linux	skipping
windows	pass

Negative control

Not independently exercised. The author reports CheckCbrtlConsoleBits detects the prior folded-constant regression; I did not build or run the exact-head binary.

Findings

Blocking

The head contains main only through da026c70655a132031d45e2008c24f993870d801, while current main is ed1e0ed08fc2452192df91793a33dd0cc7ad5212. CONTRIBUTING.md requires keeping branches up to date. The changed paths have no later-main edits and the merge preview is clean, but this branch remains behind. Please merge current main into this PR and rerun the focused math tests on the resulting head.

Non-blocking

The precheck's stack-cycle result is inconsistent with the actual checklist and clean dependency preview. MacOS hosted jobs are still pending, and the author-reported comparison runs are not independent verification.

Sources

Not verified

No local build or CTest run; no PS5-console run. The hosted macOS jobs remain queued.

To get this to a good state

Merge current main into #11632, preserve the #11632 → #11634 → #11849 landing order, and rerun the focused math tests on the exact updated head. I will repeat the no-build checks and re-review that head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5714187392 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11632#pullrequestreview-5714187392). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T15:00:07Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, changes requested Correction to my preceding review: `git diff --check` passes for the PR diff against its base; the trailing-space line I reported was from comparing the older reviewed head to the new head. The current-main synchronization finding remains. ## What I ran Reviewed head `9d91493c28768bfaa7e63d5eb6c92263835139f7` against PR base `da026c70655a132031d45e2008c24f993870d801` on Debian 12 x86_64, Python 3.11.2, GCC 12.2.0. Current `main` is `ed1e0ed08fc2452192df91793a33dd0cc7ad5212`; the merge preview is clean. ```sh git diff --check da026c70655a132031d45e2008c24f993870d801...9d91493c28768bfaa7e63d5eb6c92263835139f7 git merge-tree --write-tree refs/remotes/upstream/main 9d91493c28768bfaa7e63d5eb6c92263835139f7 gh pr checks 11632 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | |---|---| | Diff check | Passed. | | Conventions | Hosted check passed. | | Merge preview | Clean onto current `main`; preview tree `680dae1c5824ce047dab5e6d1300bec736d969e6`. | | Math validation | The author reports three `guest_math` runs on this head and 240 million comparisons across precision/rounding combinations; I did not independently run them. | | Hosted CI | Ubuntu and Windows relinker, Ubuntu register-context, Windows, ASan, conventions, eligibility, library-portability, labels and report passed. Linux product tests were skipped; macOS relinker, register-context and write-watch jobs remain queued. | | Precheck helpers | ABI audit and test-quality scripts are absent from the isolated PR checkout; the stack checker reports a false-positive dependency cycle despite the live checklist/order being #11632 → #11634. | <details><summary>Selected unedited output</summary> ```text exit=0 ``` ```text 680dae1c5824ce047dab5e6d1300bec736d969e6 ``` ```text relinker (ubuntu-latest, g++) pass relinker (windows-latest, g++) pass relinker (macos-latest, clang++) pending register-context (ubuntu-latest, Debug) pass register-context (macos-15-intel, Debug) pending write-watch (macos-15-intel) pending linux skipping windows pass ``` </details> ## Negative control Not independently exercised. The author reports `CheckCbrtlConsoleBits` detects the prior folded-constant regression; I did not build or run the exact-head binary. ## Findings ### Blocking The head contains `main` only through `da026c70655a132031d45e2008c24f993870d801`, while current `main` is `ed1e0ed08fc2452192df91793a33dd0cc7ad5212`. `CONTRIBUTING.md` requires keeping branches up to date. The changed paths have no later-main edits and the merge preview is clean, but this branch remains behind. Please merge current `main` into this PR and rerun the focused math tests on the resulting head. ### Non-blocking The precheck's stack-cycle result is inconsistent with the actual checklist and clean dependency preview. MacOS hosted jobs are still pending, and the author-reported comparison runs are not independent verification. ## Sources - [Branch synchronization rule at current main](https://github.com/boykopovar/AnyPS5/blob/ed1e0ed08fc2452192df91793a33dd0cc7ad5212/CONTRIBUTING.md#L60) - [Reviewed implementation at this head](https://github.com/boykopovar/AnyPS5/blob/9d91493c28768bfaa7e63d5eb6c92263835139f7/core/libs/prx/libc/src/Math.cpp) ## Not verified No local build or CTest run; no PS5-console run. The hosted macOS jobs remain queued. ## To get this to a good state Merge current `main` into #11632, preserve the #11632 → #11634 → #11849 landing order, and rerun the focused math tests on the exact updated head. I will repeat the no-build checks and re-review that head.
MarcZX10 commented 2026-11-01 01:11:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T01:11:19Z.

Review: APPROVED


Re-checked — new head, looks good

I found no new blocking issue at head 02c58684e5413be99fbbd9d635c86927db187b9c; the current-main merge preview is clean and the Windows workflow passed.

What I ran

Reviewed head 02c58684e5413be99fbbd9d635c86927db187b9c against base 8a4fc62318a4b73b6895bf20a024c625efeb7c3b on Debian 12 x86_64, Python 3.11.2 and GCC 12.2.0. The preview onto current main (7c4dcf0ad84de7a473ce97bb21644c614f1c3bd3) merged cleanly.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 11632
git diff --check 8a4fc62318a4b73b6895bf20a024c625efeb7c3b...02c58684e5413be99fbbd9d635c86927db187b9c
git merge-tree --write-tree upstream/main refs/anyps5/review/11632
git log --oneline 8a4fc62318a4b73b6895bf20a024c625efeb7c3b..upstream/main -- core/libs/prx/libc/src/Math.cpp core/libs/tests/GuestMath.cpp docs/dev/debt/libc.md
gh pr checks 11632 --repo boykopovar/AnyPS5

Results

Check Result
Diff and current-main preview Passed; preview tree 8713d650d8b51e7fa0af9b0f204a4588a45db36f. No newer main commits touch the changed math, test, or debt paths.
Conventions Hosted check passed. The local precheck also reported a non-blocking debt-entry-length warning.
Hosted CI Windows, Linux/macOS relinker, ASan, and register-context jobs passed. Linux product tests were skipped. Two macOS write-watch jobs failed during CMake configuration because that test project registers duplicate names; the failure is outside this PR's changed paths.
Focused math validation The author reports guest_math and guest_math_exact passing three runs each, plus 12 console-differential cbrtl sweeps of 20 million encodings per sweep across x87 precisions and rounding modes. I did not run these locally.
Precheck tooling The isolated checkout lacks the local-only ABI and test-quality helper scripts; its stack checker reverses the dependency direction. I independently confirmed the declared dependency state and clean preview.
Selected unedited output
8713d650d8b51e7fa0af9b0f204a4588a45db36f
write-watch (macos-15)	fail	42s	https://github.com/boykopovar/AnyPS5/actions/runs/41256620235/job/124701723596
write-watch (macos-15-intel)	fail	51s	https://github.com/boykopovar/AnyPS5/actions/runs/41256620235/job/124701723534
windows	pass	10m12s	https://github.com/boykopovar/AnyPS5/actions/runs/41256620235/job/124701723647
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41256620235/job/124701724802
CMake Error at CMakeLists.txt:42 (add_test):
  add_test given test NAME "write_watch_execute-fault" which already exists
CMake Error at CMakeLists.txt:42 (add_test):
  add_test given test NAME "write_watch_read-fault" which already exists

Sources

Not verified

No local C++ build or CTest run, no Linux product test, and no physical-console run. The extensive console-differential results above are author-reported, not independently reproduced.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5725836247 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11632#pullrequestreview-5725836247). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T01:11:19Z. **Review:** APPROVED --- # Re-checked — new head, looks good I found no new blocking issue at head `02c58684e5413be99fbbd9d635c86927db187b9c`; the current-main merge preview is clean and the Windows workflow passed. ## What I ran Reviewed head `02c58684e5413be99fbbd9d635c86927db187b9c` against base `8a4fc62318a4b73b6895bf20a024c625efeb7c3b` on Debian 12 x86_64, Python 3.11.2 and GCC 12.2.0. The preview onto current `main` (`7c4dcf0ad84de7a473ce97bb21644c614f1c3bd3`) merged cleanly. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 11632 git diff --check 8a4fc62318a4b73b6895bf20a024c625efeb7c3b...02c58684e5413be99fbbd9d635c86927db187b9c git merge-tree --write-tree upstream/main refs/anyps5/review/11632 git log --oneline 8a4fc62318a4b73b6895bf20a024c625efeb7c3b..upstream/main -- core/libs/prx/libc/src/Math.cpp core/libs/tests/GuestMath.cpp docs/dev/debt/libc.md gh pr checks 11632 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | |---|---| | Diff and current-main preview | Passed; preview tree `8713d650d8b51e7fa0af9b0f204a4588a45db36f`. No newer `main` commits touch the changed math, test, or debt paths. | | Conventions | Hosted check passed. The local precheck also reported a non-blocking debt-entry-length warning. | | Hosted CI | Windows, Linux/macOS relinker, ASan, and register-context jobs passed. Linux product tests were skipped. Two macOS `write-watch` jobs failed during CMake configuration because that test project registers duplicate names; the failure is outside this PR's changed paths. | | Focused math validation | The author reports `guest_math` and `guest_math_exact` passing three runs each, plus 12 console-differential `cbrtl` sweeps of 20 million encodings per sweep across x87 precisions and rounding modes. I did not run these locally. | | Precheck tooling | The isolated checkout lacks the local-only ABI and test-quality helper scripts; its stack checker reverses the dependency direction. I independently confirmed the declared dependency state and clean preview. | <details><summary>Selected unedited output</summary> ```text 8713d650d8b51e7fa0af9b0f204a4588a45db36f ``` ```text write-watch (macos-15) fail 42s https://github.com/boykopovar/AnyPS5/actions/runs/41256620235/job/124701723596 write-watch (macos-15-intel) fail 51s https://github.com/boykopovar/AnyPS5/actions/runs/41256620235/job/124701723534 windows pass 10m12s https://github.com/boykopovar/AnyPS5/actions/runs/41256620235/job/124701723647 linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41256620235/job/124701724802 ``` ```text CMake Error at CMakeLists.txt:42 (add_test): add_test given test NAME "write_watch_execute-fault" which already exists CMake Error at CMakeLists.txt:42 (add_test): add_test given test NAME "write_watch_read-fault" which already exists ``` </details> ## Sources - [FreeBSD 11.4 `s_cbrtl.c`](https://github.com/freebsd/freebsd-src/blob/8c639945a44588f6cfdddfb057bb5aad88735da0/lib/msun/src/s_cbrtl.c) - [Reviewed implementation and tests](https://github.com/boykopovar/AnyPS5/blob/02c58684e5413be99fbbd9d635c86927db187b9c/core/libs/prx/libc/src/Math.cpp) ## Not verified No local C++ build or CTest run, no Linux product test, and no physical-console run. The extensive console-differential results above are author-reported, not independently reproduced.
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!11632
No description provided.