fix(libc): preserve log1p pole and domain exception flags #10512
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10512"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-24T06:45:17Z.
What
Follow-up to #10314. Its
log1p(-1)computes-two54 / vzero, adding a divide-by-zero flag that the bundled PPSA03766libc.prxdoes not raise. Its negative domain path also misses x87 invalid, and negative quiet NaNs miss SSE invalid.Return exact negative infinity at the negative-one pole, preserving errno and existing flags. Use the existing
_Feraise(0x01)helper for the negative domain path, including negative NaNs, to set EDOM and invalid in both x87 and SSE. The numerical approximation and positive-NaN path are unchanged.Tested
Latest integration (2026-11-05): head
b28a53ff14657aba005d91bd3e78f8558f884653, tested on main1859e6af1cad6e19e0c79530bca8f4d6c1d43a82. 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_exactandguest_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 main6a337633c649805fb469960e53d43ec612e6e6d3is 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
b27d5d2d55b68a3d4e5ca96b02ac22653093628fincludes pinned main6d173c1a19788ff69d43b3d0ca62833e312ef939and 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_exactandguest_dinkumware_internalseach 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_headersfails on this head and pinned main for the same five missingWKSecurityOrigindeclarations. 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.cppwas 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
a5bcf0ef7a57036408b0b8d90bf12e60805bac15merges main9ab6a281ea61c9e62a7eb07eb4cef8f19ede1c5cwhile 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_internalseach 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
c069803235701d97ef040c786a838d1626556e78includes main4f41f4c375f5abb487dbd184fbc150f31994d762and 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, andguest_dinkumware_internalseach pass 3/3 (9 passes, zero skips);public_headersand 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):
6fa80d81580e5e7a108e1363c3f0eaa4c2f0f1e0includes maina4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8and 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_exactandguest_dinkumware_internalseach pass three times (9 passes, zero skips), andpublic_headerspasses. 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-25622866bd2a060ba69cd4387d471605afe20ed644e3257174b2d1488635f8c9b52(download verified).Current-main conflict refresh, 2026-10-27 UTC: exact head
89589428ff9d07f992db896a1690d1b72cdcb326on tested main74acfad65b3f0fd4eab653f3a3989d298fba1157. 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
libcand selected test executables passesguest_mathandguest_math_exact, each three times: 6 passes, zero skips. Conventions and whitespace checks pass. Final fetched maincb45ae2ddf6e113a4619e8fed91fe7b9333c5c0fmerges 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.Fresh reviewer cleanup:
d80bae9f614ddd2a25adbc3ebb2ed25927451bd4, one topic commit directly on refreshed #10314185098a39d9179907e11d15fa9a58b27e6aac306, based on main6c7a3256f25d2ea56702d06a2283ecc27ff133b3; no merge commits. Removed the local_Feraise_nid_postfixdeclaration and use the canonical declaration already provided by libc’s publicApi.hpp. The complete log1p implementation and both relevant regression functions remain identical to the previous public head.Linux x86-64 Release: libc and the three math test targets rebuilt;
guest_math,guest_math_exact,guest_dinkumware_internalsandpublic_headerseach pass three repeats. An immediate-parent-Math control fails the intendedlog1p domain:check; exact-math/Dinkumware pass. Restored candidate passes all four groups three times and produces a byte-identical library. Conventions and whitespace checks pass. No new original-library matrix, whole-app, Windows or performance run is claimed.Current-head logs, negative/restoration, source proof, pins and topic patch, SHA-256
b47b7b92d8a0d4fcef6d0875215674aa00a45df73de023554947d905fce01455.Earlier qualification (historical source pins)
Rebased after #10306 merged onto main
1e20650e8458f4e8916a85576ae231b5e144b581; exact tested head199d6366e4d8841f1b0b33606e9f6ebda775191bon refreshed dependency #10314 (f4cb18645cf68340ea4eb28854f6e984a92538d0).Linux x86-64, GNU C++ 16.2.1, Release. Independent full libc/math target build;
guest_mathandguest_dinkumware_internalseach passed 3/3 on this head.489efaec7f020a092f28bec7884e12e3e8a14a541a4dc62866c579afce06baf6). No SDK binaries or code dumps are attached.Earlier-head validation and original same-test negative-control evidence is historical; the current tests and module calls are listed above.
Current Linux qualification (2026-10-28)
Rebased onto
main2227f1366188cda5699dd20e2e756a18006a5d4b. Linux CPU validation on 2026-10-28 atc81cb822ae6c618a0683961b4ff6a4d415f23cce(Arch Linux 7.2.9, AMD Ryzen 9 7950X, GCC 16.2.1, Ninja Release, BUILD_TESTING=ON).libc,guest_math_testsandguest_math_exact_testsrebuilt from this exact source.guest_mathandguest_math_exacteach 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.Independent reports on this head:
6fa80d8158merged ontomaina4eca2a: 3,470 passed · 12 failed (0 new, 11 also fail on main, 1 unstable on main) · 59 skipped (ANYPS5_REQUIRE_VULKAN=1); validation: ✅ no new validation IDs vs main (1306 tests run on the GPU).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)63a863d3b07f; present in audited main3fea2a937ba)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T11:14:51Z.
Review: APPROVED
Reviewed the exact
log1ppath and tests. The numerical core follows the cited FreeBSD msun algorithm; the negative-one branch now returns the measured negative infinity without the divide-by-zero side effect, while the negative domain branch uses the project helper to set EDOM and invalid. Tests pin exact result bits and preserve existing flags across rounding/DAZ/FTZ states, including negative quiet/signaling NaNs. The report is explicit that other SDKs and PS5 are unverified. The reported Linux math targets pass 3/3; hosted relinker jobs are green but do not build this math target. I could not rerun the full local build because this workspace lacks the SDL2 submodule content and XRandR development package.