feat(libc): implement abs #2316

Closed
itsbo5 wants to merge 1 commit from upstream-pr/2316 into main
itsbo5 commented 2026-10-09 15:20:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by itsbo5 on 2026-10-09T15:20:02Z.


What

Identifies NID Ye20uNnlglA as abs in libc and implements it under abs_nid_postfix in Math.cpp. Removes the unknown stub from Export.cpp and adds unit tests in GuestMath.cpp.

Tested

GuestMath unit tests covering abs_nid_postfix with positive, negative, zero, and boundary integer values.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4802391246 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2316). Originally posted by [itsbo5](https://github.com/itsbo5) on 2026-10-09T15:20:02Z. --- ### What Identifies NID `Ye20uNnlglA` as `abs` in `libc` and implements it under `abs_nid_postfix` in `Math.cpp`. Removes the unknown stub from `Export.cpp` and adds unit tests in `GuestMath.cpp`. ### Tested GuestMath unit tests covering `abs_nid_postfix` with positive, negative, zero, and boundary integer values. ### 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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [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
github-actions[bot] commented 2026-10-09 15:29:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T15:29:56Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#2301 core/libs/prx/libc/Export.cpp L45-53
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6083999522 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2316#issuecomment-6083999522). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-09T15:29:56Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #2301 | `core/libs/prx/libc/Export.cpp` [L45-53](https://github.com/boykopovar/AnyPS5/blob/8b393b6e9a8ade9188d4f74a0293e0efd9828597/core/libs/prx/libc/Export.cpp#L45-L53) | | |
Kikoarl commented 2026-10-09 18:29:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-09T18:29:53Z.


Tested on Linux (CachyOS x86_64, Intel RPL-S iGPU / Mesa 26.3.0-devel / Vulkan 1.4.363, GCC 16.2.1) at 5ceff58e:

  • Build: Built cleanly in RAM (/tmp/anyps5_build) with zero warnings/errors.
  • Conventions: python3 tools/check_conventions.py --base origin/main --head HEAD -> PASS (0 errors).
  • Verification: Verified GuestMath.cpp tests for abs. Cleanly exposed in libc exports following standard POSIX/C library behavior.

LGTM!

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6086892113 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2316#issuecomment-6086892113). Originally posted by [Kikoarl](https://github.com/Kikoarl) on 2026-10-09T18:29:53Z. --- Tested on Linux (CachyOS x86_64, Intel RPL-S iGPU / Mesa 26.3.0-devel / Vulkan 1.4.363, GCC 16.2.1) at `5ceff58e`: - **Build**: Built cleanly in RAM (`/tmp/anyps5_build`) with zero warnings/errors. - **Conventions**: `python3 tools/check_conventions.py --base origin/main --head HEAD` -> **PASS (0 errors)**. - **Verification**: Verified `GuestMath.cpp` tests for `abs`. Cleanly exposed in libc exports following standard POSIX/C library behavior. LGTM!
popcoder565 commented 2026-10-09 19:03:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T19:03:47Z.


Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head 5ceff58e, merged onto main f8c2f072 in one build with 9 other PRs that had no Windows run.

  • This PR's tests pass: guest_math.
  • Full ctest in that build: 512 of 513. The one failure is agc_driver_depth_fast_clear_submit from #2325, which fails intermittently on its own too. The test comes from #425, where I reported it.

No title was run.

🤖 Addressed by Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6087419336 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2316#issuecomment-6087419336). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-09T19:03:47Z. --- Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head `5ceff58e`, merged onto `main` f8c2f072 in one build with 9 other PRs that had no Windows run. - This PR's tests pass: `guest_math`. - Full ctest in that build: 512 of 513. The one failure is `agc_driver_depth_fast_clear_submit` from #2325, which fails intermittently on its own too. The test comes from #425, where I reported it. No title was run. _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
oneandonlydean commented 2026-10-09 20:11:54 +00:00 (Migrated from github.com)

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


Closing: no title is shown to stop at abs (Ye20uNnlglA) on main, the same reason #1952 and #1981 were closed. Reopen with the not implemented line from main when a title reaches it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6088470093 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2316#issuecomment-6088470093). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T20:11:54Z. --- Closing: no title is shown to stop at `abs` (`Ye20uNnlglA`) on main, the same reason #1952 and #1981 were closed. Reopen with the `not implemented` line from main when a title reaches it.

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