Skip to content

feat(libc): implement x87 long-double finite classification - #5599

Merged
adriadam10 merged 5 commits into
boykopovar:mainfrom
JJenkx:feat/libc-isfinitel
Oct 15, 2026
Merged

adriadam10 merged 5 commits into
boykopovar:mainfrom
JJenkx:feat/libc-isfinitel

Conversation

@JJenkx

@JJenkx JJenkx commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What

Implement __isfinitel (NID 3-zCDXatSU4), imported by Astro Bot PPSA21564's bundled PSML module. Classify the x87 exponent directly: return 1 for finite values and 0 for infinities/NaNs, without narrowing to double or performing floating-point comparisons. Require the existing little-endian, 16-byte x87 long-double representation.

The signature/classification follows FreeBSD msun; console behavior is unmeasured and recorded in library debt.

Tested

  • Full standalone Linux/Windows fork CI passes head 665136f53ef5, containing main d1670009fbfd: Linux 1,037 passed / 46 skipped; Windows 714 passed / 389 skipped. Expected skips remain unvalidated.
  • Eighteen guest-ABI cases cover signed zero/subnormals, ordinary and extreme finite values, finite values beyond double's range, infinities, quiet NaNs and signaling NaNs. Existing floating-point exception flags are preserved without adding flags.
  • Ten additional Linux calls through the production patched NID use raw x87 patterns, including a signaling NaN, and preserve errno and floating-point exception flags.
  • Earlier Astro import auditing no longer reports this NID as undefined. This is import/classification coverage, not standalone title-startup or gameplay proof. Native macOS library execution has not been validated.
  • The branch merges cleanly with main ce5c8395333; full CI remains tied to its recorded source/base. Conventions and whitespace checks pass.

Checklist

  • Based on main; current mergeability and tested revisions recorded above
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • No silent stubs added
  • No notes, investigation files or images added to the repository
  • No new third-party code
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA21564 Astro Bot (PPSA21564) #357 (PSML finite-classification import)
  • GPUs tested: n/a; libc classification
  • AI-assisted: yes

Current review refresh: head 2f9d04fb77ffe4880e56e3548d78443c1395ad2b includes upstream main a5f493f90dca348a65561aed4bb325a629d1b668. Conflicts are resolved and current conventions pass. Earlier full-build results describe the earlier head; fresh full Linux/Windows checks for this head are pending.

Verified current full CI: run 38505264035 passes topic 2f9d04fb77ffe4880e56e3548d78443c1395ad2b merged into base a5f493f90dca348a65561aed4bb325a629d1b668. Linux 1059 passed/46 expected skips; Windows 730 passed/397 expected skips. Skipped cases remain unvalidated. The tested source tree matches this published topic head.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Progress report (a5f493f → 2f9d04f)

➖ System libraries: 88.19% (+0.0%, +1 implemented functions)

✅ 1 implemented
Library Name
libc __isfinitel_nid_postfix

@adriadam10

Copy link
Copy Markdown
Collaborator

Checked __isfinitel against FreeBSD msun s_isfinite.c (exp != 32767): same classification. Build and ctest pass on main + PR (guest_math included), and the new test fails to link without the change. Debt line is under Functional. Merging once the full Build is green.

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 3965 docs/dev/debt/libc.md
PR 5303 docs/dev/debt/libc.md
PR 5835 docs/dev/debt/libc.md
PR 6044 core/libs/tests/GuestMath.cpp
PR 6107 docs/dev/debt/libc.md
PR 6222 docs/dev/debt/libc.md
PR 6226 docs/dev/debt/libc.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants