feat(libc): implement __isinf #2174

Closed
reyani-dev wants to merge 1 commit from upstream-pr/2174 into main
reyani-dev commented 2026-10-09 10:41:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-09T10:41:26Z.


What

Exports __isinf(double) next to __isnan and __isfinite. Like the existing __isinff, it returns 1 for either infinity and 0 otherwise, which is what FreeBSD's lib/libc/gen/isinf.c does. glibc's isinf returns -1 for negative infinity instead, so the test pins the sign behaviour.

Titles: open-source homebrew from the #1578 catalog audit imports it from libSceLibcInternal (resolved through libc.prx): PPSA74126 Stremio Plus, PPSA92280 Capy Mobile, PPSA99003 ProsperoTV, PPSA99039 EVO Player, PPSA99082 OpenNOW, PPSA99169 RetroArch, PPSA99177 PS5VR, PPSA99420 PS5MC, PPSA99505 Jelly5 and PPSA99515 Emby5. I haven't run any of these titles.

Tested

Windows 11, WinLibs GCC 15.2.0 r7, Release, -DBUILD_TESTING=ON:

  • New checks in guest_math_tests, next to the __isinff ones: ±infinity and an overflowed product return 1; NaN, 0 and DBL_MAX return 0.
  • Mutation check: a glibc-style -1 for negative infinity, or x > DBL_MAX (which misses -inf), makes guest_math fail.
  • cmake --build build --target libs: the patched libc.prx exports the NID.
  • tools/check_conventions.py passes, and tools/pr_overlap.py --branch reports no overlap. This branch also merges cleanly with my #2158, #2166, #2167 and #2173.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4799315317 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2174). Originally posted by [reyani-dev](https://github.com/reyani-dev) on 2026-10-09T10:41:26Z. --- ### What Exports `__isinf(double)` next to `__isnan` and `__isfinite`. Like the existing `__isinff`, it returns 1 for either infinity and 0 otherwise, which is what FreeBSD's `lib/libc/gen/isinf.c` does. glibc's `isinf` returns -1 for negative infinity instead, so the test pins the sign behaviour. Titles: open-source homebrew from the #1578 catalog audit imports it from `libSceLibcInternal` (resolved through `libc.prx`): PPSA74126 Stremio Plus, PPSA92280 Capy Mobile, PPSA99003 ProsperoTV, PPSA99039 EVO Player, PPSA99082 OpenNOW, PPSA99169 RetroArch, PPSA99177 PS5VR, PPSA99420 PS5MC, PPSA99505 Jelly5 and PPSA99515 Emby5. I haven't run any of these titles. ### Tested Windows 11, WinLibs GCC 15.2.0 r7, Release, `-DBUILD_TESTING=ON`: - New checks in `guest_math_tests`, next to the `__isinff` ones: ±infinity and an overflowed product return 1; NaN, 0 and `DBL_MAX` return 0. - Mutation check: a glibc-style -1 for negative infinity, or `x > DBL_MAX` (which misses -inf), makes `guest_math` fail. - `cmake --build build --target libs`: the patched `libc.prx` exports the NID. - `tools/check_conventions.py` passes, and `tools/pr_overlap.py --branch` reports no overlap. This branch also merges cleanly with my #2158, #2166, #2167 and #2173. ### 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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-09 10:41:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T10:41:50Z.


Progress report (51f69aa → b791b25)

📈 System libraries: 84.7% (+0.01%, +1 implemented functions)

✅ 1 implemented
Library Name
libc __isinf_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6079276841 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2174#issuecomment-6079276841). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-09T10:41:50Z. --- <!-- progress-report --> ### Progress report (51f69aa → b791b25) 📈 **System libraries**: 84.7% (+0.01%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libc | `__isinf_nid_postfix` | </details>
reyani-dev commented 2026-10-09 11:24:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-09T11:24:42Z.


Full Linux and Windows builds and tests for this head (b791b259), using the project's Build workflow. I can't start the upstream manual run, so I ran the same build.yml in my fork through a mirror PR. Like the upstream run, the jobs check out the PR head merged into current main (d70b8998):

Job Result
linux full build, ctest: 516/516 passed
windows full build, ctest: 507/507 passed
relinker (Linux, Windows, macOS) passed

Run: https://github.com/AchrafReyani/AnyPS5/actions/runs/37920416437

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6079903421 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2174#issuecomment-6079903421). Originally posted by [reyani-dev](https://github.com/reyani-dev) on 2026-10-09T11:24:42Z. --- Full Linux and Windows builds and tests for this head (`b791b259`), using the project's Build workflow. I can't start the upstream manual run, so I ran the same `build.yml` in my fork through a mirror PR. Like the upstream run, the jobs check out the PR head merged into current `main` (`d70b8998`): | Job | Result | |---|---| | [linux](https://github.com/AchrafReyani/AnyPS5/actions/runs/37920416437/job/113786886341) | full build, `ctest`: 516/516 passed | | [windows](https://github.com/AchrafReyani/AnyPS5/actions/runs/37920416437/job/113786886242) | full build, `ctest`: 507/507 passed | | relinker (Linux, Windows, macOS) | passed | Run: https://github.com/AchrafReyani/AnyPS5/actions/runs/37920416437
oneandonlydean commented 2026-10-09 20:09:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T20:09:37Z.


Same as #2167, for __isinf.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6088436341 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2174#issuecomment-6088436341). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T20:09:37Z. --- Same as #2167, for `__isinf`.
babyhuey commented 2026-10-10 02:16:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-10T02:16:34Z.


This is now a title's next stop on current main, so here is the log line the close note asked for, plus a check of this branch.

Checked b791b259 merged onto main c963432d (clean), Linux (Ubuntu 24.04, GCC 13) and Windows 11 (MinGW-w64 GCC from WinLibs), Release.

  • guest_math passes 5/5 on both (--repeat until-fail:5); no CRT assertion dialog on Windows.
  • On main (catalog runs on 2edaf7f4 Linux and 0c0dc1e9 Windows) and with this branch:
Title main with this branch (Linux and Windows)
ProsperoTV (PPSA99003) undefined symbol: V02oFv+-JzA (__isinf) ZjtRqSMJwdw (sinh)
Jelly5 (PPSA99505) undefined symbol: V02oFv+-JzA (__isinf) PhnNN0UEV6Y (sceAudioOutExGetMonitorInfo)
Emby5 (PPSA99515) undefined symbol: V02oFv+-JzA (__isinf) PhnNN0UEV6Y (sceAudioOutExGetMonitorInfo)

Example lines for ProsperoTV (PPSA99003): main Windows FAIL: unresolved ELF import V02oFv+-JzA (__isinf) from libSceLibcInternal.prx; with this branch, Linux app.elf: symbol lookup error: app.elf: undefined symbol: ZjtRqSMJwdw, Windows FAIL: unresolved ELF import ZjtRqSMJwdw from libSceLibcInternal.prx.

OpenNOW (PPSA99082) also reaches __isinf once cpuset_getaffinity exists (#1578).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6092621912 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2174#issuecomment-6092621912). Originally posted by [babyhuey](https://github.com/babyhuey) on 2026-10-10T02:16:34Z. --- This is now a title's next stop on current `main`, so here is the log line the close note asked for, plus a check of this branch. Checked b791b259 merged onto `main` c963432d (clean), Linux (Ubuntu 24.04, GCC 13) and Windows 11 (MinGW-w64 GCC from WinLibs), Release. - `guest_math` passes 5/5 on both (`--repeat until-fail:5`); no CRT assertion dialog on Windows. - On `main` (catalog runs on 2edaf7f4 Linux and 0c0dc1e9 Windows) and with this branch: | Title | `main` | with this branch (Linux and Windows) | |---|---|---| | ProsperoTV (PPSA99003) | `undefined symbol: V02oFv+-JzA` (`__isinf`) | `ZjtRqSMJwdw` (`sinh`) | | Jelly5 (PPSA99505) | `undefined symbol: V02oFv+-JzA` (`__isinf`) | `PhnNN0UEV6Y` (`sceAudioOutExGetMonitorInfo`) | | Emby5 (PPSA99515) | `undefined symbol: V02oFv+-JzA` (`__isinf`) | `PhnNN0UEV6Y` (`sceAudioOutExGetMonitorInfo`) | Example lines for ProsperoTV (PPSA99003): `main` Windows `FAIL: unresolved ELF import V02oFv+-JzA (__isinf) from libSceLibcInternal.prx`; with this branch, Linux `app.elf: symbol lookup error: app.elf: undefined symbol: ZjtRqSMJwdw`, Windows `FAIL: unresolved ELF import ZjtRqSMJwdw from libSceLibcInternal.prx`. OpenNOW (PPSA99082) also reaches `__isinf` once `cpuset_getaffinity` exists (#1578).
reyani-dev commented 2026-10-10 02:25:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-10T02:25:32Z.


@oneandonlydean this now has the evidence the close note asked for, thanks to @babyhuey's run above: ProsperoTV (PPSA99003), Jelly5 and Emby5 stop at __isinf (V02oFv+-JzA) on current main and move on with this branch. Could you reopen it? GitHub doesn't let me reopen a PR a maintainer closed. I also rechecked this branch merged onto current main on Windows: guest_math passes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6092704906 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2174#issuecomment-6092704906). Originally posted by [reyani-dev](https://github.com/reyani-dev) on 2026-10-10T02:25:32Z. --- @oneandonlydean this now has the evidence the close note asked for, thanks to @babyhuey's run above: ProsperoTV (PPSA99003), Jelly5 and Emby5 stop at `__isinf` (`V02oFv+-JzA`) on current `main` and move on with this branch. Could you reopen it? GitHub doesn't let me reopen a PR a maintainer closed. I also rechecked this branch merged onto current `main` on Windows: `guest_math` passes.
reyani-dev commented 2026-10-10 18:34:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-10T18:34:32Z.


Resubmitted as #2931 now that intake allows it, rebased onto current main with the title evidence above.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6100847737 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2174#issuecomment-6100847737). Originally posted by [reyani-dev](https://github.com/reyani-dev) on 2026-10-10T18:34:32Z. --- Resubmitted as #2931 now that intake allows it, rebased onto current `main` with the title evidence above.

Pull request closed

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!2174
No description provided.