fix(libc): preserve Dinkumware zero signs when no conversion occurs #14595
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14595"
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 Danigamer05 on 2026-11-01T16:14:23Z.
What
When the host parser consumes no characters,
ScaledFloatnow obtains the zero sign from_Stopfx. For example,_Stodx("-z", ...)and_WStod(u"-z", ...)return negative zero while keeping the end pointer at the original input. Incomplete-iand-nprefixes retain positive zero. This changes the shared_Stodx/_Stofx/_Stoldxpath and the wide wrappers added by #11733, without changingstrtodor adding exports.The contract was read and executed from PPSA03671 v01.001.005's bundled
libc.prx(SHA-256483961e086b8a1fffa8138b3c0badf798987fb5f35ec908d828946408be2d8a6). No original binary or extracted bytes are committed. The debt edit removes only the corrected zero-sign gap and retains the other parser qualifications.Tested
Windows x86-64, WinLibs GCC 15.2.0, Release,
BUILD_TESTING=ON, mainf2d874c1fdccf781c0fa5d86619bb5dd8894b958.guest_dinkumware_internals,guest_wide_conversion,guest_math,guest_math_exact,guest_wide_strings,guest_strtod_subnormal, all fourguest_floating_prefix_*cases,public_headersandlibc_floating_point_contraction.guest_dinkumware_internalsandguest_wide_conversion; the other nine selected baseline tests pass.6af78ee89c; the final5f320fed14changes only documentation, with byte-identical C++ sources. Conventions were rerun on the final head: all checks pass.git diff --checkpasses._WStod/_WStof/_WStoldentry. This does not claim those branches merge cleanly. #11892 changeswcstod's subnormal-errno path and does not contain this correction.Not tested: Linux, macOS, unmasked floating exceptions, non-C locales, another SDK, a title or a console. This is not a complete qualification of the wide floating conversions.
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)Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:48:52Z.
Review: COMMENTED
Withdrawn. This review applied a title-ID/log requirement that is not in CONTRIBUTING (
Unblocks: noneis allowed), and it contained no code review.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T04:51:17Z.
Review: COMMENTED
Reviewed — no blocking findings
When a Dinkumware
strtod-family conversion consumes nothing, the change returns a zero whose sign follows the leading-that_Stopfxreports (bit 8). I tracedParsePrefix(FloatingPrefix.cpplines 29-71) for each row of the test's no-conversion table:-z,- 5,-.and--1give a negative zero;-iand-nreset the result and give a positive zero;+zand an empty string give a positive zero. The hosted Windows run passedguest_wide_conversion. The debt entry's measurement claims for the wide functions were not verified here.What I ran
5f320fed149ec62183fba3263bafe94c08754e0a; basef2d874c1fdccf781c0fa5d86619bb5dd8894b958. 4 files, +54/-1:core/libs/prx/libc/src/DinkumwareInternals.cpp(+5),core/libs/tests/GuestDinkumwareInternals.cpp(+24),core/libs/tests/GuestWideConversion.cpp(+24) anddocs/dev/debt/libc.md.DinkumwareInternals.cpplines 216-223 at head),ParsePrefix(FloatingPrefix.cpplines 29-71 at base), and the no-conversion table in the test.guest_dinkumware_internals_tests(libc/CMakeLists.txtline 795) andguest_wide_conversion_tests(line 452).guest_wide_conversion(Passed) and a tool check;guest_dinkumware_internalswas compiled and was not in the run.Results
-z,- 5,-.,--1ParsePrefixsets bit 8 from the leading-(line 35), and the result keeps it-iand-n+zand the empty stringguest_wide_conversion(hosted)guest_dinkumware_internals(hosted)libc.prxcomparisons not repeated hereRead-only check output
Precheck was not run: this session does not run code from PR heads. The two "possible-unregistered" heuristic flags are false positives: both test files are registered (see Results notes). Hosted:
gh api repos/boykopovar/AnyPS5/commits/5f320fed149ec62183fba3263bafe94c08754e0a/check-runs.Negative control
Not run here. A negative control needs a build, and code from this head is not run here.
Findings
Blocking
None.
Non-blocking
None.
Sources
github.com/boykopovar/AnyPS5@5f320fed14/core/libs/prx/libc/src/DinkumwareInternals.cpp (L216-L223)ParsePrefix:github.com/boykopovar/AnyPS5@f2d874c1fd/core/libs/prx/libc/src/FloatingPrefix.cpp (L29-L71)github.com/boykopovar/AnyPS5@5f320fed14/core/libs/prx/libc/CMakeLists.txt (L452)and #L795Not verified
guest_dinkumware_internalsdid not run hosted.To get this to a good state
guest_dinkumware_internalson Windows, or a note of how it was run, would close the hosted gap.