Repository navigation
feat(libc): export the std::__sce_v2 _Stollx, _Stoullx, _Stolx and _Stoulx parsers - #15683
Conversation
…toulx parsers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Progress report (c2eafe4 → 5aef7e5)📈 System libraries: 26.55% (+0.01%, +4 implemented functions) ✅ 4 implemented
Changed libraries (implemented exports)
|
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run this test on pull requests. On Windows the host
AI-assisted: yes. |
✅ AMD GPU test: passedPR head
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (10, not counted against this PR)Validation IDs already present on main (8 IDs in 799 tests)Skipped (61)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. |
|
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.
|
What
Export the versioned
std::__sce_v2_Stollx,_Stoullx,_Stolxand_Stoulxfrom libc._ZNSt8__sce_v27_StollxEPKcPPciPi9kHKVS+3PzY0x10A7D0_ZNSt8__sce_v28_StoullxEPKcPPciPiXORecIx0t+c0x10A910_ZNSt8__sce_v26_StolxEPKcPPciPibearuT1s7C00xF4090_ZNSt8__sce_v27_StoulxEPKcPPciPil9qFfwjoLF00xF41C0The behavior comes from the
libc.prxbundled with PPSA03671 v01.001.005 (J03848509, SHA-256483961e086b8a1fffa8138b3c0badf798987fb5f35ec908d828946408be2d8a6).They are not forwards to the unversioned
_Stollxfamily. In the module, the versioned calls are the older Dinkumware parser, built on the module's fixed C-locale tables, and they differ from the unversioned ones: an invalid base returns 0 with no error, where the unversioned calls reportEINVAL. #9526 lists these four as left out of that PR. As in the module:0xor0Xprefix for base 16 (base 0 picks 16, 8 or 10 from the prefix);errnotoERANGEand the error to 1, and returns all ones; a negative text is negated otherwise;- 5parses as -5 and--5overflows. A result out of the signed range returns the lowest or highest value withERANGE;_Stolxand_Stoulxwork on 32 bits, with the 32-bit table, and return the value zero-extended to 64 bits, as the module's 32-bit registers do. So_Stolx("-5")returns0xFFFFFFFB.VersionedUnsignedandVersionedSignedsit inDinkumwareInternals.cppbeside the unversioned calls, templated on the 64- or 32-bit unsigned type.Tested
Windows x86-64, WinLibs GCC 15.2.0, Release,
BUILD_TESTING=ON, mainc2eafe4461b. Exact tested commit:5aef7e58920.Built libc, libkernel, their NID-patched production libraries and the related tests. The new
guest_sce_v2_string_to_integer,guest_dinkumware_internals,public_headers,guest_math_exactand the otherguest_dinkumware_*CTests pass, along with the otherguest_sce_v2_*CTests.The new test checks 43 texts through all four calls, with the value, the end, the error and
errno, and again with null end and error pointers: decimal, signed, hexadecimal and octal texts, base 36, bases 1, 37 and -1, empty texts, a sign alone, a space after the sign, two signs, every C space and a no-break space, leading zeros, and the edges of the 64- and 32-bit signed and unsigned ranges in bases 2, 10, 16 and 36. Every expected value was taken from the original module, not from this implementation.The original functions were loaded from the bundled module with their relocations applied. Their imports were bound by NID to this branch's libc and libkernel, with
__stack_chk_guardpointing at a local value; the module's own_Getpctype,_Getptolowerandmemchrran from the module.Side by side with the patched production library, the value, the end, the error, an unchanged text,
errno, MXCSR and the x87 control and status words agree in all 20,020,800 calls over two seeds. The inputs mixed fixed edge texts, random bytes, spaces, one to three signs, prefixes, runs of zeros, digit counts around both overflow limits, mixed-case digits and trailing characters, with bases 0 to 36, invalid and random bases, and null or real end and error pointers.Negative control: five lines were altered one at a time:
The new CTest failed on each, and the side-by-side run reported differences each time. The source was then restored byte for byte (SHA-256 checked) and rebuilt, and the test and side-by-side run passed again.
Code conventions and
git diff --checkpass.tools/pr_overlap.pyread 1,831 open PRs at the tested commit and reports no overlap. It keeps exit 2 for 49 branches that already conflict with main. None of them adds a line naming these exports or helpers; fix(relinker): match AppContent utility import to provider #13486 is a relinker change that also touchesDinkumwareInternals.cpp. Merging each of the 49 with this branch and with main usinggit merge-treegives the same conflict blocks. The branch also merges cleanly with feat(libc): export the std::__sce_v2 extended-precision helpers #15336, feat(libc): export the std::__sce_v2 multiprecision helpers #15471, feat(libc): export the std::__sce_v2 _Poly and _XLgamma helpers #15484, feat(libc): export the std::__sce_v2 _Xtime_diff_to_millis2 helper #15490, feat(libc): export the std::__sce_v2 _Exp and _FExp helpers #15501, feat(libc): export the std::__sce_v2 _Pmsw, _FPmsw and _LPmsw helpers #15519, feat(libc): throw std::bad_cast and the std::__sce_v2 bad_any_cast, format_error and future_error #15552, feat(libc): forward the std::atomic wait and notify helpers to libkernel #15561, feat(libc): count the std::__sce_v2 _Winit and ios_base::Init initializations #15602, feat(libc): export the std::__sce_v2 floating-point constants #15614 and fix(libc): store the std::__sce_v2 _Throw_Cpp_error value in the first code word #15667.Not tested: Linux, macOS, another SDK, a game, GPU or console. No game compatibility claim. No original module, extracted bytes, harness or log is committed or uploaded.
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)🤖 Generated with Claude Code