Skip to content

feat(libc): export the std::__sce_v2 _Stollx, _Stoullx, _Stolx and _Stoulx parsers - #15683

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
Danigamer05:feat/libc-sce-v2-string-to-integer-20261104
Nov 7, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
Danigamer05:feat/libc-sce-v2-string-to-integer-20261104

Conversation

@Danigamer05

Copy link
Copy Markdown
Contributor

What

Export the versioned std::__sce_v2 _Stollx, _Stoullx, _Stolx and _Stoulx from libc.

Export NID Original RVA
_ZNSt8__sce_v27_StollxEPKcPPciPi 9kHKVS+3PzY 0x10A7D0
_ZNSt8__sce_v28_StoullxEPKcPPciPi XORecIx0t+c 0x10A910
_ZNSt8__sce_v26_StolxEPKcPPciPi bearuT1s7C0 0xF4090
_ZNSt8__sce_v27_StoulxEPKcPPciPi l9qFfwjoLF0 0xF41C0

The behavior comes from the libc.prx bundled with PPSA03671 v01.001.005 (J03848509, SHA-256 483961e086b8a1fffa8138b3c0badf798987fb5f35ec908d828946408be2d8a6).

They are not forwards to the unversioned _Stollx family. 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 report EINVAL. #9526 lists these four as left out of that PR. As in the module:

  • the unsigned calls skip the C spaces (tab to carriage return and space), take one sign, accept bases 0 and 2 to 36, and skip a 0x or 0X prefix for base 16 (base 0 picks 16, 8 or 10 from the prefix);
  • a text with no digits, a prefix with nothing after it, and an invalid base all return 0 and set the end to the start of the text;
  • overflow is found with the Dinkumware digit-count table, sets errno to ERANGE and the error to 1, and returns all ones; a negative text is negated otherwise;
  • the signed calls skip spaces and their own sign, then call the unsigned one on the rest, so - 5 parses as -5 and --5 overflows. A result out of the signed range returns the lowest or highest value with ERANGE;
  • _Stolx and _Stoulx work 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") returns 0xFFFFFFFB.

VersionedUnsigned and VersionedSigned sit in DinkumwareInternals.cpp beside 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, main c2eafe4461b. Exact tested commit: 5aef7e58920.

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

  • 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 under Silent stubs in their library's technical debt file
  • 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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

…toulx parsers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

Progress report (c2eafe4 → 5aef7e5)

📈 System libraries: 26.55% (+0.01%, +4 implemented functions)

✅ 4 implemented
Library Name
libc _ZNSt8__sce_v26_StolxEPKcPPciPi_nid_postfix
libc _ZNSt8__sce_v27_StollxEPKcPPciPi_nid_postfix
libc _ZNSt8__sce_v27_StoulxEPKcPPciPi_nid_postfix
libc _ZNSt8__sce_v28_StoullxEPKcPPciPi_nid_postfix

Changed libraries (implemented exports)

Library Before After Change
libc 1613/1632 (98.84%) 1617/1636 (98.84%) +0.0028%

@JJenkx

JJenkx commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Windows check of head 5aef7e5892, merged onto main 5b1d381d5a (807c1e0239, clean merge).

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 long is 32-bit. The new parsers use fixed-width types, so that does not affect them.

  • guest_sce_v2_string_to_integer passes in 3 of 3 runs.

AI-assisted: yes.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head 5aef7e5 merged onto main 5b1d381 · tested 2026-11-04 08:33 UTC · 28 min

GPU AMD Radeon RX 6300 (RADV NAVI24), driver Mesa 25.2.8-0ubuntu0.24.04.4, Vulkan 1.4.318
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 3,778 passed · 13 failed (0 new, 10 also fail on main, 3 unstable on main) · 61 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 3,852 of 3,883 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (1381 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.2 s, ⚠️ agc_driver_graphics_maps_fallback 78.1 s, ⚠️ agc_driver_graphics 73.8 s, ⚠️ public_headers 69.9 s, ⚠️ agc_driver_bda_device 42.5 s
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_alpha_to_coverage_sample_mask_export: failed in 4 of the last 10 main runs
agc_driver_pipeline_journal: failed in 8 of the last 10 main runs
agc_driver_two_sample_alpha_to_coverage_sample_mask_export: failed in 3 of the last 10 main runs
Failing on main too (10, not counted against this PR)
agc_driver_guest_memory_lifetime_direct
agc_driver_image_table
agc_driver_job_manager_compute_capacity
agc_driver_native_depth_bda_clear
agc_driver_native_depth_buffer_clear
agc_driver_native_depth_clears
agc_driver_native_multisample_depth
agc_driver_submit_progress
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (8 IDs in 799 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (799 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_passes, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_alpha_to_coverage_sample_mask_export, and 791 more
VUID-vkCmdCopyImage-srcImage-01548 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_partially_unmapped_plane, agc_driver_depth_plane_unmapped_plane, and 3 more
VUID-vkCmdCopyImage-srcImage-01551 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_partially_unmapped_plane, agc_driver_depth_plane_unmapped_plane, and 3 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
VUID-VkSamplerCreateInfo-addressModeU-01079 (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeU-parameter (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeV-parameter (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeW-parameter (1 test): agc_driver_image_gather_volume
Skipped (61)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_copied_writer_label_order: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_copied_writer_label_order_drain: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_float16_unused_nan_payloads: skipped, the device has no native f16 conversions with RTE rounding and kept f16 denormals
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_image_table_vouched_lookups: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a watched imported table cannot be vouched for
agc_driver_linear_target_direct_write_completion: skipped, the device does not keep host imports write-watched, so no completion stamp over the target is tracked
agc_driver_ngg_vertex_wave_reduction: skipped, s3 describes a 32-lane wave only on 32-lane subgroups, and the device has 64 lanes
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_driver_unit_shadow_budget: skipped, the device does not import watched host memory for unit shadows
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_idle_publish_wait: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a forced watch of the import reads its submissions as CPU stores
agc_shadowed_key_stores: skipped, the device imports no watched host memory under a unit shadow
agc_small_tiled_shadow_label: skipped, host imports are unavailable: the test block is not imported and watched
agc_storage_clear_hand_over: skipped, the device imports no watched host memory for the clear-key hand-over
agc_storage_pending_key_refresh: skipped, refreshes over a pending key store are not testable here
agc_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video
Reproduce
git fetch origin 5aef7e589203f64af25fa14d70edd12713e7fa68 5b1d381d5ad5d9f923326b18479c3bd889cdd588
git checkout 5b1d381d5ad5d9f923326b18479c3bd889cdd588 && git merge --no-ff 5aef7e589203f64af25fa14d70edd12713e7fa68
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 12 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 16 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated 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.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 5021 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 6819 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 7081 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 7386 docs/dev/debt/libc.md
PR 7447 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 7715 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8150 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8965 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 9340 docs/dev/debt/libc.md
PR 9371 docs/dev/debt/libc.md
PR 9447 docs/dev/debt/libc.md
PR 9466 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 9526 docs/dev/debt/libc.md
PR 10002 docs/dev/debt/libc.md
PR 10780 core/libs/prx/libc/include/Api.hpp
docs/dev/debt/libc.md
PR 11172 docs/dev/debt/libc.md
PR 11332 docs/dev/debt/libc.md
PR 11661 docs/dev/debt/libc.md
PR 11689 docs/dev/debt/libc.md
PR 11698 docs/dev/debt/libc.md
PR 11726 docs/dev/debt/libc.md
PR 11831 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/include/Api.hpp
docs/dev/debt/libc.md
PR 12518 docs/dev/debt/libc.md
PR 12682 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/include/Api.hpp
docs/dev/debt/libc.md
PR 12688 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/include/Api.hpp
docs/dev/debt/libc.md
PR 12700 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/include/Api.hpp
docs/dev/debt/libc.md
PR 12704 docs/dev/debt/libc.md
PR 12849 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 12965 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/include/Api.hpp
docs/dev/debt/libc.md
PR 13449 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 13794 docs/dev/debt/libc.md
PR 13804 docs/dev/debt/libc.md
PR 13809 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 14212 docs/dev/debt/libc.md
PR 15800 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/include/Api.hpp
docs/dev/debt/libc.md
PR 15801 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/include/Api.hpp
docs/dev/debt/libc.md
PR 15802 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/include/Api.hpp
core/libs/prx/libc/src/DinkumwareInternals.cpp
docs/dev/debt/libc.md
PR 15803 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/include/Api.hpp
core/libs/prx/libc/src/DinkumwareInternals.cpp
docs/dev/debt/libc.md
PR 15804 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/include/Api.hpp
core/libs/prx/libc/src/DinkumwareInternals.cpp
docs/dev/debt/libc.md
PR 15807 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/include/Api.hpp
core/libs/prx/libc/src/DinkumwareInternals.cpp
docs/dev/debt/libc.md
PR 16004 core/libs/prx/libc/include/Api.hpp
docs/dev/debt/libc.md

@oneandonlydean oneandonlydean self-assigned this Nov 7, 2026
@oneandonlydean
oneandonlydean merged commit 88a9af9 into boykopovar:main Nov 7, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants