feat(libc): export guest hardware concurrency hint #1814
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1814"
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 Prophet069 on 2026-10-08T20:11:32Z.
What
Implements
std::__sce_v2::_Thrd_hardware_concurrency()inlibcwith NIDdt3C+gjXHKk.The export has the signature
unsigned int () noexcept, usesextern "C",APS5_VABIand the existing_nid_postfixexport mechanism, and returnsstd::thread::hardware_concurrency()unchanged. This preserves the host's hardware-thread hint, including zero when unavailable, without inventing a fallback count. The wrapper adds no shared mutable state or caching.The return type and no-argument signature agree with Microsoft STL's declaration. Zero follows the standard hardware-concurrency contract. The NID agrees with the existing PS5 symbol database.
Based on
mainat4b6ab6bb7371869f85837ff824f409b49f1e8081. A search of all 390 open PRs found no matching implementation. This change is independent of #1806 and contains no mathematics exports or tests.Tested
Windows x86-64, MinGW GCC 15.2.0, CMake/Ninja Release with
BUILD_TESTING=ON:libc,guest_hardware_concurrency_tests,guest_thread_callback_abi_tests,guest_demangle_testsandnid_patcher, with at most four build jobs.guest_hardware_concurrency,guest_thread_callback_abiandguest_demanglethrough CTest, each three times: all passed, with every run below 0.13 seconds.noexceptdeclaration. No host returning zero was available; that path was reviewed, not separately simulated.libc.prxwithnid_patcherand verified the actual NID export usingimport_audit.read_exportsandnid_names.compute_nid.check_test_registration.pypassed: 427 test targets, only the three previously documented exclusions, no new unregistered tests.git diff --checkandtools/check_conventions.py --base origin/mainpassed; the conventions check also validated this PR title and description.Linux compatibility was reviewed at source level: the implementation and test use standard C++ facilities, and
APS5_VABIselects the native ABI on Linux. Linux was not built or executed locally because no usable Linux environment is installed; Linux CI remains required. No full-project build, game or homebrew execution was performed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt (no new stubs).mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T05:32:52Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libc/CMakeLists.txtL48core/libs/prx/libc/CMakeLists.txtL48core/libs/prx/libc/CMakeLists.txtL48core/libs/prx/libc/CMakeLists.txtL48Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T08:57:28Z.
Same as #1806, for
_Thrd_hardware_concurrency.Pull request closed