Repository navigation
docs(libc): record std::thread::hardware_concurrency as measured on a PS5 - #11164
adriadam10 merged 1 commit into
Conversation
… PS5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact head a4ef5fd8a9d9cbcc5b0940f369924a5021bbf4c6.
The new entry records the measured system-libc result separately from the host count and distinguishes it from the 16 online/configured CPUs and the available CPU mask. It also preserves the uncertainty around whether the value tracks later affinity changes. I checked the current implementation still returns the host std::thread::hardware_concurrency(), and #9447 remains open with the libkernel affinity path, so this documents an unresolved implementation dependency rather than duplicating its code change.
Checks: git diff --check upstream/main...HEAD passes; the gist URL is reachable; eligibility, conventions, intake and label checks pass. The one-line documentation change conflicts with the existing #10345 edit to the adjacent fmodf entry in docs/dev/debt/libc.md, as declared in the PR body; this is a manual merge-order conflict.
|
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.
|
|
Checked the entry against |
What
This records what
std::thread::hardware_concurrencyreturns on a retail PS5 (firmware 13.60). Onlydocs/dev/debt/libc.mdchanges. The entry said the value a title expects was unverified. Measured with homebrew probes from a payload process; the sources and console logs are in this gist (phwconc,phwconc2).On the console:
libSceLibcInternalreturns 5, on the main thread and on a second thread.scePthreadGetaffinity(scePthreadSelf())gives0xea00on both threads, which has 5 bits set.hw.ncpu,_SC_NPROCESSORS_ONLNand_SC_NPROCESSORS_CONFread 16, andsceKernelGetAvailableCpumaskreads0x1fff(13).So the count is the popcount of the thread's libkernel affinity mask, not a processor count. This is the rule #9447 uses for the versioned
std::__sce_v2::_Thrd_hardware_concurrency, which it read from a title'slibc.prx.Whether the value follows a later affinity change is still open:
scePthreadSetaffinityreturned0x80020001in the payload process, and the POSIXcpuset_getaffinityreturnedERANGE. AnyPS5 still returns the host count, because libc cannot read the libkernel mask yet. #9447 adds that path, and the code change can follow once it lands.Tested
Documentation only. Head
a4ef5fd8a9onmain74ac0e7912.tools/check_conventions.pypasses; the entry is under 1000 characters.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)fmodfentry next to this one; merge order only)