docs(libkernel): record select limits as measured on a PS5 #10310
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10310"
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 orezraey on 2026-10-23T17:18:58Z.
What
selectmeasured on a retail PS5 (firmware 13.60) throughlibkernel_sys.sprxfrom a payload process. The source and console log are in this gist (pselect). The debt entry said the console's answer for a timeout outside the host clock's range was unknown.The console:
INT32_MAX, 2^32 andINT64_MAXseconds (on a descriptor that is already ready, so the wait itself was not observed), and fails a negativetv_secortv_usecand atv_usecof 1000000 or more withEINVAL, as AnyPS5 does;nfdswithEINVAL, as AnyPS5 does;nfdswhen the timeout expires with nothing ready (nfds16, descriptor 16), as FreeBSD writes back whole 64-bitfd_maskwords, as AnyPS5 does since #10777. Withnfds0 the bit stays set on both;nfdsof 1025, where AnyPS5 fails anynfdsabove 1024 withEINVAL, and fails withEBADFwhen a bit above its last open descriptor is set (measured withnfds1000 and descriptor 999, where AnyPS5 also failsEBADF), as FreeBSD 11.4'sselect_check_badfddoes. The probe's sets hold 1024 bits, so the results atnfds1025 and 65536 depend on the bytes past them.Only the debt entry changes: the last difference touches how far the guest's descriptor tables reach (files may go past the 1024 sockets), so it is recorded for a separate change.
Tested
Not tested: documentation only (head
59d248674f, which merges currentmain14c99b52acwith #10501'spselectentry; the entry's "where AnyPS5 keeps it" clause was dropped earlier).tools/check_conventions.pypasses.tools/check_conventions.pypasses.tools/pr_overlap.py: #9389, #10162 edit nearbylibkernel.mdlines; whichever lands second keeps both.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)Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-24T15:44:39Z.
Review: COMMENTED
Checked against main
c9b75825f3and the linked gist (pselect.c/pselect.log), plusSocket.cppandSocketSelectDeadline.hppon main:Socket.cpp:189matches the "as here" parts. The branch still merges cleanly with main.nfds_below_fd(nfds16, fd 16 set, timeout 0) the console returned 0 with the bit cleared (bit=0). Main returns 0 and leaves bit 16 set, because the timeout path (Socket.cpp:319-325) clears only the requested descriptors, all belownfds. FreeBSD'skern_selectseems to copy out wholefd_maskwords, which would explain it (and whynfds_0_readyleft the bit alone). Could this go into the entry, or into a follow-up?EBADFwas measured withnfds1000 and fd 999, where AnyPS5 also givesEBADF; as written it reads like annfds > 1024result. Maybe "accepted 1025, and, like FreeBSD 11.4'sselect_check_badfd, failsEBADFfor a set bit above the last open descriptor (measured withnfds1000)".uint64_t set[16], so withnfds1025 or 65536 the kernel reads bits past the array. "NoEINVALat 1025" stands, but the 1025 return of 1 and the 65536EBADFdepend on whatever stack bytes follow the array, so a re-probe with larger sets would pin them down.Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-24T16:37:23Z.
Review: APPROVED
Re-checked head
9dd91b6f23against mainfeb5059ac4:nfds_below_fddifference (the console cleared descriptor 16 withnfds16 on an expired timeout, where AnyPS5 keeps it;nfds0 leaves it in both), which matches the log and main's timeout path inSocket.cpp.EBADFclause now says it was measured withnfds1000, the probe caveat about 1024-bit sets atnfds1025/65536 is there, and the unknown wait for a saturated timeout is stated plainly.Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T21:14:21Z.
Review: DISMISSED
The PS5 measurements and the limits of the probe are recorded carefully, and the earlier review verified the updated wording against the console log. Before merge, the branch still needs the declared integration work: #9389 and #10162 remain open, and this PR is based on
f57e4ef, 7,503 commits behind currentmain.docs/dev/debt/libkernel.mdhas also changed repeatedly since that base. Please refresh after the two documented merge-order dependencies land, resolve the current-main debt-file edits while preserving thisselectresult, and rerun the conventions/overlap checks on the final head. As a documentation-only PR, no runtime test is needed.