Repository navigation
feat(libc): implement abs - #1097
Closed
fardeen-hash wants to merge 1 commit into
Closed
fardeen-hash wants to merge 1 commit into
fardeen-hash wants to merge 1 commit into
Conversation
Implement standard ISO C/POSIX abs (Ye20uNnlglA), replacing the libcCyberUnknown02 stub imported by Cyberpunk 2077 (PPSA04029) that previously aborted on NotImplemented. Add unit tests in GuestMath.
bfar97
approved these changes
Oct 7, 2026
This was referenced Oct 7, 2026
9 tasks done
Collaborator
|
Does PPSA04029 call |
This was referenced Oct 9, 2026
Contributor
|
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
No title was run. 🤖 Addressed by Claude Code |
adriadam10
requested changes
Oct 9, 2026
adriadam10
left a comment
Collaborator
There was a problem hiding this comment.
Thanks. Two things before this can land:
- @oneandonlydean's question is still open: does PPSA04029 actually call
abs, or only import it? Please post the log line where it stops atYe20uNnlglA(or equivalent evidence from a run). - It now conflicts with
mainincore/libs/prx/libc/Export.cpp(the neighbouring stubs aroundlibcCyberUnknown02changed). Please rebase.
Optional: pin INT_MIN in the test (UB for std::abs; FreeBSD libc returns INT_MIN) or say in the description that it is not covered. The Windows run by @popcoder565 (guest_math passes) is noted.
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implement standard ISO C / POSIX
abs(NIDYe20uNnlglA), replacing thelibcCyberUnknown02stub incore/libs/prx/libc/Export.cppwhich previously aborted onNotImplemented_nid_no_patch("Ye20uNnlglA").PPSA04029), already noted onmainincore/libs/prx/libc/Export.cppamong the Cyberpunk 2077 imports.<stdlib.h>) & POSIX.1 (int abs(int)).libc(/usr/include/stdlib.h), the upstream base for Sony'slibc.prx.aerolib.csv) andtools/nid_names.py, wherecompute_nid("abs")confirms NIDYe20uNnlglA.Tested
Added unit test assertions in
core/libs/tests/GuestMath.cppcovering zero, positive, negative, andINT_MAXcases.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)