fix(libc): preserve expm1 overflow rounding and exception flags #10510

Merged
JJenkx merged 7 commits from upstream-pr/10510 into main 2026-11-08 18:09:06 +00:00
JJenkx commented 2026-10-24 06:30:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-24T06:30:55Z.


What

Follow-up to #10306. Its expm1 finite-positive-overflow path uses huge * huge. Under downward and toward-zero rounding that returns the maximum finite double and leaves errno unchanged. Under every rounding mode it raises flags only in SSE. The bundled PPSA03766 libc.prx instead returns positive infinity, sets ERANGE, and adds overflow/inexact flags in both x87 and SSE.

Use the existing _Feraise(0x08) helper and return positive infinity for that overflow path. Other paths are unchanged. Positive infinity input still preserves errno and flags.

Tested

Latest integration (2026-11-05): head 45d2748496b7a62f315d36cf41ad850e4a98a508, tested on main 1859e6af1cad6e19e0c79530bca8f4d6c1d43a82. This supersedes the integration pins in earlier reports below. Main now includes the atanh port #10315; its new regressions and the hypot regressions are retained alongside this PR's cases.

Fresh Linux Release qualification: the actual libc CMake owner plus guest_math, guest_math_exact and guest_dinkumware_internals, each repeated three times on main and this head, all pass with zero skips. The frozen branch math fixture fails with the baseline library and passes again with its own restored library. Conventions and whitespace pass; final merge preview against main 6a337633c649805fb469960e53d43ec612e6e6d3 is clean. Fresh validation is CPU-only; earlier Windows/module reports remain at their recorded pins.

Source diffs, exact pins, actual-owner recipe, build/test/JUnit/control logs and binary/provider hashes, SHA-256 ad099369f7cae288f5353e8aeb196df80367b61ddc8454cf939a5dc522dbba1b (download verified). No new SDK-module sampling, whole-project, Windows or title-performance result is claimed.

Current integration — 2026-11-05. Head 1441efcae16a063053c52d5d53769904c6350bc4 includes pinned main 6d173c1a19788ff69d43b3d0ca62833e312ef939 and retains the previous public history, notices, main math implementations and actual prerequisites.

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 3/3 (9 passes, zero skips). The same groups pass 3/3 on pinned main. Source/parent/macro/notice checks and conventions pass. All 34 recursive provider trees / 31,551 tracked blobs verify before and after the gate; QuickJS test262 is excluded as declared update=none test data.

Shared main blocker: public_headers fails on this head and pinned main for the same five missing WKSecurityOrigin declarations. PR #16010 restores them separately; a maintainer needs to merge that fix and rerun required checks. This math branch does not contain the unrelated WebKit patch. Header audits and all required CI are not claimed green.

The older Windows compile failure in DepthSurface.cpp was a shared main API mismatch, fixed upstream by merged PR #15855, already included in this head. Its own hosted Windows compile job passed; this is not a fresh Windows qualification of this math head.

Immutable source/audit/log/JUnit/hash and exact-lease push evidence, SHA-256 ef9e085442553c0fce1a4a6ce15781e4e890dc001a3424e1ef972f9b769f3065 (download and member hashes verified). Earlier dated platform/negative/reference reports retain their original source pins. No new Windows, console/SDK-module, GPU/title, exhaustive or performance result. AI-assisted: yes, Codex Sol6.1 medium.

All earlier qualification text below is historical and retains its recorded source/platform pins, including earlier linear/no-merge descriptions.

Current-main refresh — 2026-11-04. Head 7e8cf24820b56f83726fc3901e9177f0bb405c14 merges main 9ab6a281ea61c9e62a7eb07eb4cef8f19ede1c5c while retaining the prior public head as an ancestor. Main’s newer code, regression fixtures and debt entries are preserved alongside this topic.

Linux x86-64, GCC16.2.1, Ninja Release: actual libc, libkernel and libSceAmpr CMake owners rebuilt coherently. guest_math, guest_math_exact, guest_dinkumware_internals each pass three consecutive runs (9 passes, zero skips). The same groups pass three times on pinned main. Public-header audit and conventions pass. Original licence-notice trailing whitespace is retained where present. The scoped recipe reuses frozen ZArchive/zstd providers; this is not a whole-project build. No new Windows, bundled-SDK, physical-console, title/GPU or FPS measurement is claimed; earlier reports retain their original pins.

Exact source/parent proofs, per-branch patches/input manifests, build and CTest logs/JUnit, library/executable hashes and scoped CMake recipe, SHA-256 97a2377bc996be1690e8853e1ea090a98b5ed808bcc37a15a5cdada5c2e00845 (download verified). AI-assisted: yes (Codex).

Current-main integration — 2026-11-03. Head 1209717011eca23002108b7b612bff7eca85867e 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. Whitespace check passes.

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): 9eb1ee9522c464c8f32d39096d21cf9c8bf9b016 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).

Main conflict refresh, 2026-10-27 10:18 UTC pass: exact head d29ca14dca62846610c1a93209b2c463f14325ac on tested main 3fea2a937ba9fbab2f06c51691fe0c5763659aa3. The topic implementations and fixtures are retained alongside current main's newer math functions and coverage.

Linux Release focused rebuild: guest_math and guest_math_exact each pass three repetitions: 6 passes, zero skips. Conventions, whitespace and merge checks pass. Every refreshed head's submodule pointers match the pinned main; the private dependency checkouts used for the gates are aligned. No new negative-control, Windows, console, title, GPU, full-suite or performance run is claimed. Earlier measurements below retain their original exact pins. Fulfilled merge-order dependencies have been cleared from the checklist; open prerequisites remain.

Exact source/dependency pins, patch-preservation and gitlink proofs, builds, verbose tests, JUnit and lease-push receipts. SHA-256: 702c4110ee9dde421c2dd5e057ed53a2df05e0cf7b01f67e8fb9cb779e332f7c; downloaded copy verified.

Current-main conflict refresh, 2026-10-27 UTC: exact head a67925f66764f51256b04d009ac27362789f8061 on tested main 74acfad65b3f0fd4eab653f3a3989d298fba1157. Resolved overlapping test/debt context while preserving this branch's authored production/test edits and main's nextafter environment implementation and coverage. Existing prerequisite commits remain in their original series order.

Linux focused rebuild of libc and selected test executables passes guest_math and guest_math_exact, each three times: 6 passes, zero skips. Conventions and whitespace checks pass. Final fetched main cb45ae2ddf6e113a4619e8fed91fe7b9333c5c0f merges cleanly; its later change is an unrelated Windows crash-test pattern, and the executed qualification remains pinned to the stated base. No new Windows, console, GPU, title, full-suite or negative-control run is claimed. Earlier reference/Windows evidence keeps its original pins.

Exact pins, branch patches, preservation proofs, build/test logs, JUnit and lease-push receipts for this refresh batch. SHA-256: e33f98cc467f038af662cc5fa491c3acc1806bb47171cf77b748f0d4d052c1f2; downloaded copy verified.

Current Linux refresh: 230d2ddce98099cfd89a189c0ef78c793980a0b9 is refreshed onto main a5a780eaaa7f187fe8f5c7f2ef244f6a6dab2762, with prerequisite authorship retained and no merge commits. The original production and regression function bodies are preserved, along with main's log1p implementation, regression calls and current public declarations. The redundant source declaration of _Feraise is removed; current canonical Api.hpp provides it.

Fresh Linux x86-64 Release: guest_math, guest_math_exact, guest_dinkumware_internals and public_headers each pass3/3 before and after the production-only main-Math negative control. The negative aborts as expected while exact-math/Dinkumware controls pass. Restored libc is byte-identical and sources clean. Conventions, whitespace and merge-tree checks pass.

Exact-head logs, negative/restoration results and preservation proof (SHA-256 f107a42be1dabc4ef72ffddcc6274d35e65ebd40146c811214558b28d4952a90). No fresh original-module matrix, Windows/macOS/title/console or performance measurement is claimed by this refresh. Earlier reports below retain their measured source pins.

Previous qualification (historical source pins)

Linux x86-64, GNU C++ 16.2.1, Release; exact head 778251f27a7be7363afdf495ea382641a78e90b6 on dependency #10306 (99abd2604d53b7588b6386de012527c60ad6dcc7). This stack merges cleanly with main b0f57be3c7.

  • Independent full libc/math target builds for the candidate and an old-production control carrying exactly the same new regression test. Candidate guest_math and guest_dinkumware_internals: 3/3 each. Control: guest_math aborts at the named expm1 overflow check; Dinkumware passes 3/3.
  • The new regression makes 240 calls across four rounding modes, four DAZ/FTZ states, three sticky exception seeds, four finite overflowing inputs and positive infinity. It checks result bits, errno, full MXCSR, x87 exception bits and unchanged x87 control; prior state is restored.
  • CPU-only original-module comparison: 872 deterministic structured/random arguments, including 257 neighboring encodings around the overflow threshold, across the same 48 environment combinations: 41,856 calls per arm. The original raw and converted 783-byte expm1 function bodies are byte-identical. The loader installs valid process metadata, loads only the library, rejects Vulkan/AGC/VideoOut mappings, and never calls the title entry point.
  • 9,216 finite positive overflow rows: control differs in all 9,216 (x87 flags), with bits/errno also differing in 4,608. Candidate: zero differences in result bits, errno, x87/SSE flags and control.
  • All other rows: zero candidate/control changes. There are still 492 sampled result-bit differences from the original module outside positive overflow; the debt entry retains this limitation. All compared candidate errno, flag and control fields match the supplied reference in this matrix.
  • Conventions, diff checks and the open-PR overlap scan passed. Shared math/test/debt insertion anchors remain; this is a follow-up to #10306, with no dependency on unrelated math ports.
  • Own source, numeric observations and complete Linux logs, SHA-256 ba190e6f5d8a71d8bfa6428f037f23f532479e2efff1ccece32cabd0690b8733. No game/module binaries are included.
  • Not tested: physical console, other SDK builds, unmasked exception traps, Windows or macOS, game behavior or performance. The reference is a bundled module executed on Linux.

Current Linux qualification (2026-10-28)

Rebased onto main 2227f1366188cda5699dd20e2e756a18006a5d4b. Linux CPU validation on 2026-10-28 at 8b6da33ff5518d4ee7f1620a5d1aca1e280fbffd (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.

The composition retains current main’s 1 + (x - e) scaling association alongside this topic’s overflow fix; both sets of regression checks remain.

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.

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 (#10306 merged at 1e20650e8458; present in audited main 3fea2a937ba)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4993149815 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10510). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-24T06:30:55Z. --- ### What Follow-up to #10306. Its `expm1` finite-positive-overflow path uses `huge * huge`. Under downward and toward-zero rounding that returns the maximum finite double and leaves errno unchanged. Under every rounding mode it raises flags only in SSE. The bundled PPSA03766 `libc.prx` instead returns positive infinity, sets `ERANGE`, and adds overflow/inexact flags in both x87 and SSE. Use the existing `_Feraise(0x08)` helper and return positive infinity for that overflow path. Other paths are unchanged. Positive infinity input still preserves errno and flags. ### Tested <!-- codex-math-refresh-main1859-20261105-10510 --> **Latest integration (2026-11-05):** head `45d2748496b7a62f315d36cf41ad850e4a98a508`, tested on main `1859e6af1cad6e19e0c79530bca8f4d6c1d43a82`. This supersedes the integration pins in earlier reports below. Main now includes the atanh port #10315; its new regressions and the hypot regressions are retained alongside this PR's cases. Fresh Linux Release qualification: the actual libc CMake owner plus `guest_math`, `guest_math_exact` and `guest_dinkumware_internals`, each repeated three times on main and this head, all pass with zero skips. The frozen branch math fixture fails with the baseline library and passes again with its own restored library. Conventions and whitespace pass; final merge preview against main `6a337633c649805fb469960e53d43ec612e6e6d3` is clean. Fresh validation is CPU-only; earlier Windows/module reports remain at their recorded pins. [Source diffs, exact pins, actual-owner recipe, build/test/JUnit/control logs and binary/provider hashes](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/math-four-main1859-linux-20261105.tar.gz), SHA-256 `ad099369f7cae288f5353e8aeb196df80367b61ddc8454cf939a5dc522dbba1b` (download verified). No new SDK-module sampling, whole-project, Windows or title-performance result is claimed. <!-- /codex-math-refresh-main1859-20261105-10510 --> <!-- codex-numeric-refresh-20261105-10510 --> **Current integration — 2026-11-05.** Head `1441efcae16a063053c52d5d53769904c6350bc4` includes pinned main `6d173c1a19788ff69d43b3d0ca62833e312ef939` and retains the previous public history, notices, main math implementations and actual prerequisites. 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 3/3 (9 passes, zero skips). The same groups pass 3/3 on pinned main. Source/parent/macro/notice checks and conventions pass. All 34 recursive provider trees / 31,551 tracked blobs verify before and after the gate; QuickJS test262 is excluded as declared update=none test data. **Shared main blocker:** `public_headers` fails on this head and pinned main for the same five missing `WKSecurityOrigin` declarations. [PR #16010](https://github.com/boykopovar/AnyPS5/pull/16010) restores them separately; a maintainer needs to merge that fix and rerun required checks. This math branch does not contain the unrelated WebKit patch. Header audits and all required CI are not claimed green. The older Windows compile failure in `DepthSurface.cpp` was a shared main API mismatch, fixed upstream by merged [PR #15855](https://github.com/boykopovar/AnyPS5/pull/15855), already included in this head. Its own [hosted Windows compile job passed](https://github.com/boykopovar/AnyPS5/actions/runs/41901908835/job/126840906295); this is not a fresh Windows qualification of this math head. [Immutable source/audit/log/JUnit/hash and exact-lease push evidence](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/numeric5-main6d-linux-20261105.tar.gz), SHA-256 `ef9e085442553c0fce1a4a6ce15781e4e890dc001a3424e1ef972f9b769f3065` (download and member hashes verified). Earlier dated platform/negative/reference reports retain their original source pins. No new Windows, console/SDK-module, GPU/title, exhaustive or performance result. AI-assisted: yes, Codex Sol6.1 medium. All earlier qualification text below is historical and retains its recorded source/platform pins, including earlier linear/no-merge descriptions. <!-- libc-main9ab-refresh-20261104-10510 --> **Current-main refresh — 2026-11-04.** Head `7e8cf24820b56f83726fc3901e9177f0bb405c14` merges main `9ab6a281ea61c9e62a7eb07eb4cef8f19ede1c5c` while retaining the prior public head as an ancestor. Main’s newer code, regression fixtures and debt entries are preserved alongside this topic. Linux x86-64, GCC16.2.1, Ninja Release: actual libc, libkernel and libSceAmpr CMake owners rebuilt coherently. `guest_math`, `guest_math_exact`, `guest_dinkumware_internals` each pass three consecutive runs (**9 passes, zero skips**). The same groups pass three times on pinned main. Public-header audit and conventions pass. Original licence-notice trailing whitespace is retained where present. The scoped recipe reuses frozen ZArchive/zstd providers; this is not a whole-project build. No new Windows, bundled-SDK, physical-console, title/GPU or FPS measurement is claimed; earlier reports retain their original pins. [Exact source/parent proofs, per-branch patches/input manifests, build and CTest logs/JUnit, library/executable hashes and scoped CMake recipe](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/owned-libc11-main9ab-linux-20261104.tar.gz), SHA-256 `97a2377bc996be1690e8853e1ea090a98b5ed808bcc37a15a5cdada5c2e00845` (download verified). AI-assisted: yes (Codex). **Current-main integration — 2026-11-03.** Head `1209717011eca23002108b7b612bff7eca85867e` 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. Whitespace check passes. 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):** `9eb1ee9522c464c8f32d39096d21cf9c8bf9b016` 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). <!-- codex-main-refresh-20261027-1018-pr10510 --> **Main conflict refresh, 2026-10-27 10:18 UTC pass:** exact head `d29ca14dca62846610c1a93209b2c463f14325ac` on tested main `3fea2a937ba9fbab2f06c51691fe0c5763659aa3`. The topic implementations and fixtures are retained alongside current main's newer math functions and coverage. Linux Release focused rebuild: `guest_math` and `guest_math_exact` each pass three repetitions: 6 passes, zero skips. Conventions, whitespace and merge checks pass. Every refreshed head's submodule pointers match the pinned main; the private dependency checkouts used for the gates are aligned. No new negative-control, Windows, console, title, GPU, full-suite or performance run is claimed. Earlier measurements below retain their original exact pins. Fulfilled merge-order dependencies have been cleared from the checklist; open prerequisites remain. [Exact source/dependency pins, patch-preservation and gitlink proofs, builds, verbose tests, JUnit and lease-push receipts](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/owned-cpu11-main3fea-linux-20261027-1018.tar.gz). SHA-256: `702c4110ee9dde421c2dd5e057ed53a2df05e0cf7b01f67e8fb9cb779e332f7c`; downloaded copy verified. <!-- codex-main-refresh-20261027-pr10510 --> **Current-main conflict refresh, 2026-10-27 UTC:** exact head `a67925f66764f51256b04d009ac27362789f8061` on tested main `74acfad65b3f0fd4eab653f3a3989d298fba1157`. Resolved overlapping test/debt context while preserving this branch's authored production/test edits and main's nextafter environment implementation and coverage. Existing prerequisite commits remain in their original series order. Linux focused rebuild of `libc` and selected test executables passes `guest_math` and `guest_math_exact`, each three times: **6 passes, zero skips**. Conventions and whitespace checks pass. Final fetched main `cb45ae2ddf6e113a4619e8fed91fe7b9333c5c0f` merges cleanly; its later change is an unrelated Windows crash-test pattern, and the executed qualification remains pinned to the stated base. No new Windows, console, GPU, title, full-suite or negative-control run is claimed. Earlier reference/Windows evidence keeps its original pins. [Exact pins, branch patches, preservation proofs, build/test logs, JUnit and lease-push receipts for this refresh batch](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/owned-math14-main74acfad-linux-refresh-20261027.tar.gz). SHA-256: `e33f98cc467f038af662cc5fa491c3acc1806bb47171cf77b748f0d4d052c1f2`; downloaded copy verified. **Current Linux refresh:** `230d2ddce98099cfd89a189c0ef78c793980a0b9` is refreshed onto main `a5a780eaaa7f187fe8f5c7f2ef244f6a6dab2762`, with prerequisite authorship retained and no merge commits. The original production and regression function bodies are preserved, along with main's log1p implementation, regression calls and current public declarations. The redundant source declaration of `_Feraise` is removed; current canonical Api.hpp provides it. Fresh Linux x86-64 Release: `guest_math`, `guest_math_exact`, `guest_dinkumware_internals` and `public_headers` each pass3/3 before and after the production-only main-Math negative control. The negative aborts as expected while exact-math/Dinkumware controls pass. Restored libc is byte-identical and sources clean. Conventions, whitespace and merge-tree checks pass. [Exact-head logs, negative/restoration results and preservation proof](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/pr10510-230d2ddc-pr10506-9c79f0a1-pr10468-946149ed-maina5a7-linux-validation.tar.gz) (SHA-256 `f107a42be1dabc4ef72ffddcc6274d35e65ebd40146c811214558b28d4952a90`). No fresh original-module matrix, Windows/macOS/title/console or performance measurement is claimed by this refresh. Earlier reports below retain their measured source pins. #### Previous qualification (historical source pins) Linux x86-64, GNU C++ 16.2.1, Release; exact head `778251f27a7be7363afdf495ea382641a78e90b6` on dependency #10306 (`99abd2604d53b7588b6386de012527c60ad6dcc7`). This stack merges cleanly with main `b0f57be3c7`. - Independent full libc/math target builds for the candidate and an old-production control carrying exactly the same new regression test. Candidate `guest_math` and `guest_dinkumware_internals`: 3/3 each. Control: `guest_math` aborts at the named `expm1 overflow` check; Dinkumware passes 3/3. - The new regression makes 240 calls across four rounding modes, four DAZ/FTZ states, three sticky exception seeds, four finite overflowing inputs and positive infinity. It checks result bits, errno, full MXCSR, x87 exception bits and unchanged x87 control; prior state is restored. - CPU-only original-module comparison: 872 deterministic structured/random arguments, including 257 neighboring encodings around the overflow threshold, across the same 48 environment combinations: **41,856 calls per arm**. The original raw and converted 783-byte expm1 function bodies are byte-identical. The loader installs valid process metadata, loads only the library, rejects Vulkan/AGC/VideoOut mappings, and never calls the title entry point. - **9,216 finite positive overflow rows:** control differs in all 9,216 (x87 flags), with bits/errno also differing in 4,608. Candidate: **zero differences** in result bits, errno, x87/SSE flags and control. - **All other rows:** zero candidate/control changes. There are still **492 sampled result-bit differences** from the original module outside positive overflow; the debt entry retains this limitation. All compared candidate errno, flag and control fields match the supplied reference in this matrix. - Conventions, diff checks and the open-PR overlap scan passed. Shared math/test/debt insertion anchors remain; this is a follow-up to #10306, with no dependency on unrelated math ports. - [Own source, numeric observations and complete Linux logs](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/libc-expm1-overflow-fenv-head778251f2-linux-validation.tar.gz), SHA-256 `ba190e6f5d8a71d8bfa6428f037f23f532479e2efff1ccece32cabd0690b8733`. No game/module binaries are included. - Not tested: physical console, other SDK builds, unmasked exception traps, Windows or macOS, game behavior or performance. The reference is a bundled module executed on Linux. <!-- 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. --> <!-- codex-math-refresh-20261028-repeat-pr10510 --> ### Current Linux qualification (2026-10-28) Rebased onto `main` `2227f1366188cda5699dd20e2e756a18006a5d4b`. Linux CPU validation on 2026-10-28 at `8b6da33ff5518d4ee7f1620a5d1aca1e280fbffd` (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. The composition retains current main’s `1 + (x - e)` scaling association alongside this topic’s overflow fix; both sets of regression checks remain. [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. ### 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 (#10306 merged at `1e20650e8458`; present in audited main `3fea2a937ba`) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-24 11:15:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T11:15:57Z.

Review: APPROVED


Reviewed exact head 778251f27a7be7363afdf495ea382641a78e90b6. The finite-positive-overflow branch calls the guest floating-point error helper, which sets ERANGE and raises overflow plus inexact in x87 and MXCSR, then returns positive infinity. The wrapper preserves errno for non-finite inputs, and the tests cover threshold neighbors, rounding/DAZ/FTZ modes, seeded sticky flags, control state, and positive infinity. The supplied two-module integration matrix and hosted relinker checks are strong evidence for the stated scope. Physical-console, SDK, Windows/macOS, unmasked-trap, and game behavior remain explicitly untested; I did not independently rerun the Linux artifact.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5638048749 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10510#pullrequestreview-5638048749). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T11:15:57Z. **Review:** APPROVED --- Reviewed exact head 778251f27a7be7363afdf495ea382641a78e90b6. The finite-positive-overflow branch calls the guest floating-point error helper, which sets ERANGE and raises overflow plus inexact in x87 and MXCSR, then returns positive infinity. The wrapper preserves errno for non-finite inputs, and the tests cover threshold neighbors, rounding/DAZ/FTZ modes, seeded sticky flags, control state, and positive infinity. The supplied two-module integration matrix and hosted relinker checks are strong evidence for the stated scope. Physical-console, SDK, Windows/macOS, unmasked-trap, and game behavior remain explicitly untested; I did not independently rerun the Linux artifact.
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!10510
No description provided.