fix(libc): compute log with FreeBSD msun's algorithm, as titles' libc.prx does #10245

Merged
JJenkx merged 11 commits from upstream-pr/10245 into main 2026-11-05 18:33:11 +00:00
JJenkx commented 2026-10-23 15:24:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-23T15:24:07Z.


What

log returned the host's log, so its last bit and its errno depended on the host. On Windows (UCRT) it differs from the libc.prx that titles ship on 3,020,553 of 320 million random arguments. For example, log(0x3fcbf0cfff3ac077) is 0xbff859e4e1f045dc in the bundled libc.prx and 0xbff859e4e1f045db here, and log(0x3f08b0c25bca18b0) is 0xc023ed400c16d9ee there and 0xc023ed400c16d9ed here.

The titles' copy (NID rtV7-jWC6Yg) is FreeBSD msun's e_log.c. log now computes it:

  • the subnormal scaling by 2^54;
  • the normalisation of the significand into [√2/2, √2);
  • the |f| < 2^-20 shortcut;
  • the Lg1–Lg7 polynomial, with its two evaluation forms chosen by i | j.

errno: msun sets none, but the titles' copy sets it at exactly msun's two error returns:

  • ERANGE for ±0, which returns -inf;
  • EDOM for every argument with the sign bit set, which returns NaN. This covers the negative numbers, -inf and negative NaNs; a positive NaN or +inf leaves errno alone.

This port sets them there, and keeps the NaN payloads msun's x + x and (x - x) / 0 give. _Log with base 0 calls log, so it gets the same bits and errno; its existing test still passes (log(8) is the same in the bundled libc.prx, here and in UCRT).

Tested

Current-main conflict refresh — 2026-11-04. Head 6d7538e4350f903b4765feed2885a0f11511d407 merges main 9ab6a281ea61c9e62a7eb07eb4cef8f19ede1c5c while retaining the existing public history. The conflict resolution preserves main’s new pow regression functions and calls alongside this PR’s original log checks; both debt entries remain. The production log function is byte-for-byte identical to the previous public head.

Linux x86-64 Release, GCC 16.2.1: built actual libc through its CMake owner and rebuilt guest_math, guest_math_exact, and guest_dinkumware_internals in an isolated scoped harness. Each suite passes three consecutive runs on main and on the change (9 passes per arm, zero skips). Public-header audits and conventions pass. Existing ZArchive/zstd static providers were frozen and reused; this is not a full-project build. The only diff --check warning is the preserved original licence notice’s trailing-space line. No new Windows, bundled-module, physical-console, title, GPU or performance measurement is claimed.

Source preservation proofs, exact pins, build and test logs/JUnit, hashes and scoped CMake recipe, SHA-256 cf1061d3162f13522d79694acfcc9f52fbfcf987f81c3962f329931c0fa80c28 (download verified). AI-assisted: yes (Codex).

Current-main integration — 2026-11-03. Head cf81449bcba54cb715af54fcda9b0bcdc7c8cb3d includes main 4f41f4c375f5abb487dbd184fbc150f31994d762 and retains the prior public history and attribution/licence notices. Main’s newer math implementations and fixtures remain alongside this topic.

Linux x86-64 Release, GCC 16.2.1, Ninja, BUILD_TESTING=ON: rebuilt actual libc and math executables. guest_math, guest_math_exact, and guest_dinkumware_internals each pass 3/3 (9 passes, zero skips); public_headers and conventions pass. The same three groups pass 3/3 plus headers on pinned main. All 34 recursive dependency trees and 31,551 tracked blobs verify with zero errors; the update=none QuickJS test262 corpus is excluded from these library inputs. git diff --check reports the preserved verbatim licence trailing-space line; no other whitespace warnings occur.

Source/parent/gitlink proofs, exact library/test hashes, raw logs/JUnit, and head-leased push receipts: qualification archive, SHA-256 e6a50522bc28e30871fdc2c12a88d2537515914239e8166f6237f48895126a06 (download verified). Older platform/reference reports retain their original pins; no new Windows/macOS, SDK-module, console, title/GPU or performance claim. AI-assisted: yes (Codex).

Earlier dated qualifications below retain their recorded source/platform pins.

Current-main integration (2026-11-02): 8ef7026499044b4a212edcfa770bc65656c7d5b0 includes main a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8 and retains the existing public commits. Conflicts preserve main’s math implementations, regression checks and debt entries alongside this topic. Linux x86-64 Release, GCC 16.2.1: rebuilt libc and the three math executables; guest_math, guest_math_exact and guest_dinkumware_internals each pass three times (9 passes, zero skips), and public_headers passes. The same baseline groups pass on main; conventions and whitespace pass. Source and dependency blobs, executable/library hashes, raw logs and JUnit are retained. This refresh adds no new console, Windows, title, GPU or numerical-reference measurement. Qualification evidence, SHA-256 22866bd2a060ba69cd4387d471605afe20ed644e3257174b2d1488635f8c9b52 (download verified).

Current Linux refresh: 9184f18ca7fdefc52c014cb7c08e1105acc8d702 on main 6c52b649e7b1592f28db0cb8fe9ac604f0a242e7. Fresh isolated libc/math build passed; guest_math and guest_dinkumware_internals each passed three consecutive runs. Diff and conventions checks pass; Math.cpp and GuestMath.cpp topic changes remain unchanged after rebase. Linux logs and rebase checks.

The Windows module comparisons and negative control below are historical evidence from original head 3a2e66d95d4f001f15adb0875bf5d3d377b2134c; Windows was not rerun on the refreshed commit. Results described as console results mean supplied titles' bundled libraries executed on the Windows host, not measurements on a physical console.

Windows 11 Enterprise 10.0.22621, Ryzen 9 5950X, WinLibs GCC 15.2.0 UCRT r7, Ninja, Release, BUILD_TESTING=ON, main 4997726a5f.

  • Comparison: a scratch loader runs the decrypted libc.prx of PPSA07923, PPSA05916 and PPSA13934 natively and supplies __error. It compared their log with this PR's code, checking result bits (NaN payloads included) and errno, on:

    • 320 million random arguments per title (half random bit patterns, half random significands with exponents 2^-32 to 2^31, plus ±0, -inf and subnormals);
    • 20,159 structured arguments: the integers 1 to 1024 and their reciprocals, the 4,000 floats on each side of ±1, every power of two from 2^-1074 to 2^1023, and the special values.

    Results:

    • PPSA07923 and PPSA05916: identical bits and errno on all of them.
    • PPSA13934: identical errno. The bits differ on 262,780 random arguments, because that copy is an FMA-contracted build.
  • guest_math: the new CheckLogConsoleBits has 26 cases with the bundled library's results and errno: ±0, subnormals, the smallest normal, 1 and its neighbours, both sides of the |f| < 2^-20 and normalisation edges, DBL_MAX, ±inf, −1, −0.5, NaN payloads of both signs, and six arguments where UCRT differs.

    guest_math and guest_dinkumware_internals pass in three runs out of three on the exact head.

  • Negative control: with main's Math.cpp and these tests, guest_math aborts in a Require, while guest_dinkumware_internals still passes.

  • python tools/check_conventions.py --base origin/main and git diff --check pass.

  • Overlap and order: Refreshed as a standalone log topic on main 6c52b649e7b1592f28db0cb8fe9ac604f0a242e7. The old dependencies described series order and shared source/test/debt anchors, rather than required function implementations. This branch contains only its log implementation and tests. The log algorithm is self-contained and does not call the exp port.

  • Not tested: macOS, a physical console, floating-point exception flags, and logl. Original module comparison and negative control were Windows-only; the new Linux build and regression checks are scoped separately above.

Current Linux qualification (2026-10-28)

Rebased onto main 2227f1366188cda5699dd20e2e756a18006a5d4b. Linux CPU validation on 2026-10-28 at 679d90503c143804315cf712b06460140f9fc1e9 (Arch Linux 7.2.9, AMD Ryzen 9 7950X, GCC 16.2.1, Ninja Release, BUILD_TESTING=ON).

libc, guest_math_tests and guest_math_exact_tests rebuilt from this exact source. guest_math and guest_math_exact each passed three consecutive runs (6/6, no skips); the same two suites each passed three runs on the pinned main (6/6). Conventions and whitespace checks pass.

Exact source pins, preservation proofs, dependency checks, build logs and JUnit, SHA-256 1176269c9e6948b5252a5db9e660978d7f978fb2d9f4ed6c68bc050b10b5ae68. This is focused Linux CPU qualification; earlier Windows/title/reference measurements retain their original pins. No new title or performance result is claimed.

Canonical declaration cleanup (2026-10-28)

At c45208322cbd, removed 93 duplicate local export declarations from GuestMath.cpp; its included Api.hpp supplies them. Production code and numeric test bodies are unchanged. Original fails the actual header audit; candidate passes. Per-branch affected-test syntax compilation and conventions/whitespace pass; full standalone-header compilation passed once for the byte-identical header tree shared by the four affected PRs. Source/proofs/logs, SHA256 44f560018e4f6b52e8dda4158383f64fc3059fcdb6444840fe5c04fb2c884f11. No new numerical-runtime/platform claim; earlier runs retain original pins. Normal fast-forward only, no rebase. AI-assisted: Codex.

Current Linux qualification — 2026-10-29

Refreshed against main 5454cd2e455994d992aca39335ce60507eeda1eb.

Linux qualification at 911827abb1f536098649cb5f6e1ec199cd48e93d (Arch Linux 7.2.9, Ryzen 9 7950X, GCC 16.2.1, Ninja Release, BUILD_TESTING=ON): guest_math, guest_math_exact, guest_dinkumware_internals each pass three consecutive runs (9/9, 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.

The integrated asinh debt entry now reflects the msun log dependency and the previously reported 100,000-input PPSA07923 comparison. It retains exception-flag/system-module and sampling limits. This documentation correction adds no new measurement claim.

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).

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: none; the msun function is rewritten, as #9668, #5036 and the sinhf entry did
  • 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:4985105959 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10245). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-23T15:24:07Z. --- ### What `log` returned the host's `log`, so its last bit and its `errno` depended on the host. On Windows (UCRT) it differs from the `libc.prx` that titles ship on 3,020,553 of 320 million random arguments. For example, `log(0x3fcbf0cfff3ac077)` is `0xbff859e4e1f045dc` in the bundled `libc.prx` and `0xbff859e4e1f045db` here, and `log(0x3f08b0c25bca18b0)` is `0xc023ed400c16d9ee` there and `0xc023ed400c16d9ed` here. The titles' copy (NID `rtV7-jWC6Yg`) is FreeBSD msun's [`e_log.c`](https://github.com/freebsd/freebsd-src/blob/release/11.4.0/lib/msun/src/e_log.c). `log` now computes it: - the subnormal scaling by 2^54; - the normalisation of the significand into [√2/2, √2); - the `|f| < 2^-20` shortcut; - the `Lg1`–`Lg7` polynomial, with its two evaluation forms chosen by `i | j`. **`errno`:** msun sets none, but the titles' copy sets it at exactly msun's two error returns: - `ERANGE` for ±0, which returns `-inf`; - `EDOM` for every argument with the sign bit set, which returns NaN. This covers the negative numbers, `-inf` and negative NaNs; a positive NaN or `+inf` leaves `errno` alone. This port sets them there, and keeps the NaN payloads msun's `x + x` and `(x - x) / 0` give. `_Log` with base 0 calls `log`, so it gets the same bits and `errno`; its existing test still passes (`log(8)` is the same in the bundled `libc.prx`, here and in UCRT). ### Tested **Current-main conflict refresh — 2026-11-04.** Head `6d7538e4350f903b4765feed2885a0f11511d407` merges main `9ab6a281ea61c9e62a7eb07eb4cef8f19ede1c5c` while retaining the existing public history. The conflict resolution preserves main’s new `pow` regression functions and calls alongside this PR’s original `log` checks; both debt entries remain. The production `log` function is byte-for-byte identical to the previous public head. Linux x86-64 Release, GCC 16.2.1: built actual libc through its CMake owner and rebuilt `guest_math`, `guest_math_exact`, and `guest_dinkumware_internals` in an isolated scoped harness. Each suite passes three consecutive runs on main and on the change (**9 passes per arm, zero skips**). Public-header audits and conventions pass. Existing ZArchive/zstd static providers were frozen and reused; this is not a full-project build. The only `diff --check` warning is the preserved original licence notice’s trailing-space line. No new Windows, bundled-module, physical-console, title, GPU or performance measurement is claimed. [Source preservation proofs, exact pins, build and test logs/JUnit, hashes and scoped CMake recipe](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/pr10245-main9ab-6d7538e4-linux-20261104.tar.gz), SHA-256 `cf1061d3162f13522d79694acfcc9f52fbfcf987f81c3962f329931c0fa80c28` (download verified). AI-assisted: yes (Codex). **Current-main integration — 2026-11-03.** Head `cf81449bcba54cb715af54fcda9b0bcdc7c8cb3d` includes main `4f41f4c375f5abb487dbd184fbc150f31994d762` and retains the prior public history and attribution/licence notices. Main’s newer math implementations and fixtures remain alongside this topic. Linux x86-64 Release, GCC 16.2.1, Ninja, BUILD_TESTING=ON: rebuilt actual libc and math executables. `guest_math`, `guest_math_exact`, and `guest_dinkumware_internals` each pass 3/3 (**9 passes, zero skips**); `public_headers` and conventions pass. The same three groups pass 3/3 plus headers on pinned main. All 34 recursive dependency trees and 31,551 tracked blobs verify with zero errors; the update=none QuickJS test262 corpus is excluded from these library inputs. `git diff --check` reports the preserved verbatim licence trailing-space line; no other whitespace warnings occur. Source/parent/gitlink proofs, exact library/test hashes, raw logs/JUnit, and head-leased push receipts: [qualification archive](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/math15-main4f41-linux-20261103.tar.gz), SHA-256 `e6a50522bc28e30871fdc2c12a88d2537515914239e8166f6237f48895126a06` (download verified). Older platform/reference reports retain their original pins; no new Windows/macOS, SDK-module, console, title/GPU or performance claim. AI-assisted: yes (Codex). Earlier dated qualifications below retain their recorded source/platform pins. **Current-main integration (2026-11-02):** `8ef7026499044b4a212edcfa770bc65656c7d5b0` includes main `a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8` and retains the existing public commits. Conflicts preserve main’s math implementations, regression checks and debt entries alongside this topic. Linux x86-64 Release, GCC 16.2.1: rebuilt libc and the three math executables; `guest_math`, `guest_math_exact` and `guest_dinkumware_internals` each pass three times (9 passes, zero skips), and `public_headers` passes. The same baseline groups pass on main; conventions and whitespace pass. Source and dependency blobs, executable/library hashes, raw logs and JUnit are retained. This refresh adds no new console, Windows, title, GPU or numerical-reference measurement. [Qualification evidence](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/math-root14-maina4eca-linux-20261102-terminal.tar.gz), SHA-256 `22866bd2a060ba69cd4387d471605afe20ed644e3257174b2d1488635f8c9b52` (download verified). Current Linux refresh: `9184f18ca7fdefc52c014cb7c08e1105acc8d702` on main `6c52b649e7b1592f28db0cb8fe9ac604f0a242e7`. Fresh isolated libc/math build passed; `guest_math` and `guest_dinkumware_internals` each passed three consecutive runs. Diff and conventions checks pass; Math.cpp and GuestMath.cpp topic changes remain unchanged after rebase. [Linux logs and rebase checks](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/pr10245-head9184f18c-linux-validation.tar.gz). The Windows module comparisons and negative control below are historical evidence from original head `3a2e66d95d4f001f15adb0875bf5d3d377b2134c`; Windows was not rerun on the refreshed commit. Results described as console results mean supplied titles' bundled libraries executed on the Windows host, not measurements on a physical console. Windows 11 Enterprise 10.0.22621, Ryzen 9 5950X, WinLibs GCC 15.2.0 UCRT r7, Ninja, Release, `BUILD_TESTING=ON`, `main` 4997726a5f. - **Comparison:** a scratch loader runs the decrypted `libc.prx` of PPSA07923, PPSA05916 and PPSA13934 natively and supplies `__error`. It compared their `log` with this PR's code, checking result bits (NaN payloads included) and `errno`, on: - 320 million random arguments per title (half random bit patterns, half random significands with exponents 2^-32 to 2^31, plus ±0, `-inf` and subnormals); - 20,159 structured arguments: the integers 1 to 1024 and their reciprocals, the 4,000 floats on each side of ±1, every power of two from 2^-1074 to 2^1023, and the special values. Results: - PPSA07923 and PPSA05916: identical bits and `errno` on all of them. - PPSA13934: identical `errno`. The bits differ on 262,780 random arguments, because that copy is an FMA-contracted build. - **`guest_math`:** the new `CheckLogConsoleBits` has 26 cases with the bundled library's results and `errno`: ±0, subnormals, the smallest normal, 1 and its neighbours, both sides of the `|f| < 2^-20` and normalisation edges, `DBL_MAX`, ±`inf`, −1, −0.5, NaN payloads of both signs, and six arguments where UCRT differs. `guest_math` and `guest_dinkumware_internals` pass in three runs out of three on the exact head. - **Negative control:** with `main`'s `Math.cpp` and these tests, `guest_math` aborts in a `Require`, while `guest_dinkumware_internals` still passes. - `python tools/check_conventions.py --base origin/main` and `git diff --check` pass. - **Overlap and order:** Refreshed as a standalone log topic on main `6c52b649e7b1592f28db0cb8fe9ac604f0a242e7`. The old dependencies described series order and shared source/test/debt anchors, rather than required function implementations. This branch contains only its log implementation and tests. The log algorithm is self-contained and does not call the exp port. - **Not tested:** macOS, a physical console, floating-point exception flags, and `logl`. Original module comparison and negative control were Windows-only; the new Linux build and regression checks are scoped separately above. <!-- codex-math-refresh-20261028-repeat-pr10245 --> ### Current Linux qualification (2026-10-28) Rebased onto `main` `2227f1366188cda5699dd20e2e756a18006a5d4b`. Linux CPU validation on 2026-10-28 at `679d90503c143804315cf712b06460140f9fc1e9` (Arch Linux 7.2.9, AMD Ryzen 9 7950X, GCC 16.2.1, Ninja Release, BUILD_TESTING=ON). `libc`, `guest_math_tests` and `guest_math_exact_tests` rebuilt from this exact source. `guest_math` and `guest_math_exact` each passed three consecutive runs (6/6, no skips); the same two suites each passed three runs on the pinned main (6/6). Conventions and whitespace checks pass. [Exact source pins, preservation proofs, dependency checks, build logs and JUnit](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/owned-math25-main2227-linux-20261028-repeat.tar.gz), SHA-256 `1176269c9e6948b5252a5db9e660978d7f978fb2d9f4ed6c68bc050b10b5ae68`. This is focused Linux CPU qualification; earlier Windows/title/reference measurements retain their original pins. No new title or performance result is claimed. ### Canonical declaration cleanup (2026-10-28) At `c45208322cbd`, removed 93 duplicate local export declarations from `GuestMath.cpp`; its included `Api.hpp` supplies them. Production code and numeric test bodies are unchanged. Original fails the actual header audit; candidate passes. Per-branch affected-test syntax compilation and conventions/whitespace pass; full standalone-header compilation passed once for the byte-identical header tree shared by the four affected PRs. [Source/proofs/logs](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/math-canonical-declarations-linux-20261028.tar.gz), SHA256 `44f560018e4f6b52e8dda4158383f64fc3059fcdb6444840fe5c04fb2c884f11`. No new numerical-runtime/platform claim; earlier runs retain original pins. Normal fast-forward only, no rebase. AI-assisted: Codex. <!-- codex-maintenance-20261029-repeat-10245 --> **Current Linux qualification — 2026-10-29** Refreshed against main `5454cd2e455994d992aca39335ce60507eeda1eb`. Linux qualification at `911827abb1f536098649cb5f6e1ec199cd48e93d` (Arch Linux 7.2.9, Ryzen 9 7950X, GCC 16.2.1, Ninja Release, BUILD_TESTING=ON): `guest_math`, `guest_math_exact`, `guest_dinkumware_internals` each pass three consecutive runs (9/9, 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. The integrated asinh debt entry now reflects the msun log dependency and the previously reported 100,000-input PPSA07923 comparison. It retains exception-flag/system-module and sampling limits. This documentation correction adds no new measurement claim. 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). ### 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`); 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: none; the msun function is rewritten, as #9668, #5036 and the `sinhf` entry did - [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).
harisibrar1 commented 2026-10-24 12:56:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-24T12:56:19Z.

Review: APPROVED


Checked against main 99feaf0eb8 and FreeBSD release/11.4.0 lib/msun/src/e_log.c:

  • The port matches e_log.c branch for branch, including re-reading the words after the 2^54 subnormal scaling. All 10 constants match msun's hex comments bit for bit.
  • An independent Python version of msun's algorithm reproduces all 26 CheckLogConsoleBits expectations, bits (NaN payloads included) and errno.
  • It still merges cleanly into current main. Main's log is still std::log, and _Log picks this up through log_nid_postfix.
  • FYI: this PR and #10234 add their test, declaration, main() call and debt entry at the same places, so the second one to land will need a trivial additive conflict fix.

Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5638318287 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10245#pullrequestreview-5638318287). Originally posted by [harisibrar1](https://github.com/harisibrar1) on 2026-10-24T12:56:19Z. **Review:** APPROVED --- Checked against main 99feaf0eb8 and FreeBSD release/11.4.0 lib/msun/src/e_log.c: - The port matches `e_log.c` branch for branch, including re-reading the words after the 2^54 subnormal scaling. All 10 constants match msun's hex comments bit for bit. - An independent Python version of msun's algorithm reproduces all 26 `CheckLogConsoleBits` expectations, bits (NaN payloads included) and errno. - It still merges cleanly into current main. Main's `log` is still `std::log`, and `_Log` picks this up through `log_nid_postfix`. - FYI: this PR and #10234 add their test, declaration, `main()` call and debt entry at the same places, so the second one to land will need a trivial additive conflict fix. Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
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!10245
No description provided.