Repository navigation
fix(libc): preserve Dinkumware zero signs when no conversion occurs - #14595
oneandonlydean merged 2 commits into
Conversation
|
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.
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
When a Dinkumware strtod-family conversion consumes nothing, the change returns a zero whose sign follows the leading - that _Stopfx reports (bit 8). I traced ParsePrefix (FloatingPrefix.cpp lines 29-71) for each row of the test's no-conversion table: -z, - 5, -. and --1 give a negative zero; -i and -n reset the result and give a positive zero; +z and an empty string give a positive zero. The hosted Windows run passed guest_wide_conversion. The debt entry's measurement claims for the wide functions were not verified here.
What I ran
- Head
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. - Read the changed function (
DinkumwareInternals.cpplines 216-223 at head),ParsePrefix(FloatingPrefix.cpplines 29-71 at base), and the no-conversion table in the test. - Registration:
guest_dinkumware_internals_tests(libc/CMakeLists.txtline 795) andguest_wide_conversion_tests(line 452). - Read-only checks from the trusted main checkout (precheck not run: this session does not run code from PR heads): diff check, conventions and the stack check passed; the ABI audit reported 25 symbols with no findings.
- Hosted: the windows CTest run has two cases,
guest_wide_conversion(Passed) and a tool check;guest_dinkumware_internalswas compiled and was not in the run. - No MarcZX10 review at this head.
Results
| Check | Result | Note |
|---|---|---|
| Diff check | passed | |
| Conventions and PR template | passed | conventions check from the main checkout |
| Mergeability and dependencies | passed | depends on none; the stack check passed |
Sign of zero for -z, - 5, -., --1 |
passed | ParsePrefix sets bit 8 from the leading - (line 35), and the result keeps it |
Sign of zero for -i and -n |
passed | the word test fails and resets the result to 0 (lines 52-57 and 40-45) |
+z and the empty string |
passed | no sign bit |
guest_wide_conversion (hosted) |
passed | in the Windows CTest run |
guest_dinkumware_internals (hosted) |
not run | compiled, not in the Windows CTest run |
| Debt-entry measurement claims (wide functions) | not verified | based on SDK 7.00 libc.prx comparisons not repeated here |
| ABI audit (main-checkout tool) | passed | 25 symbols, no findings |
| Build and runtime tests | not run | no local build |
| Negative controls | not run | no local build |
| Hosted CI | passed | windows passed (two CTest cases); linux and relinkers skipped |
Read-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
- Changed function:
AnyPS5/core/libs/prx/libc/src/DinkumwareInternals.cpp
Lines 216 to 223 in 5f320fe
ParsePrefix:AnyPS5/core/libs/prx/libc/src/FloatingPrefix.cpp
Lines 29 to 71 in f2d874c
- Registration: and #L795
AnyPS5/core/libs/prx/libc/CMakeLists.txt
Line 452 in 5f320fe
Not verified
- The debt entry's measurements for the wide functions (SDK 7.00 comparisons) were not repeated.
guest_dinkumware_internalsdid not run hosted.
To get this to a good state
- Nothing blocking. A run of
guest_dinkumware_internalson Windows, or a note of how it was run, would close the hosted gap.
✅ AMD GPU test: passedPR head
Unstable on main (8, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (11, not counted against this PR)Passed on retry (2, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)Validation IDs already present on main (4 IDs in 808 tests)Skipped (69)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
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. fix(libc): set ERANGE for decimal subnormals in wcstod as strtod does #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)