Repository navigation
docs(libkernel): record select limits as measured on a PS5 - #10310
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.
|
|
@GitamarT045T3R @xXPBSXx: #9389 and #10162 change the same lines as this PR in |
harisibrar1
left a comment
There was a problem hiding this comment.
Checked against main c9b7582 and the linked gist (pselect.c / pselect.log), plus Socket.cpp and SocketSelectDeadline.hpp on main:
- The numbers in the new debt line match the log, and main's validation at
Socket.cpp:189matches the "as here" parts. The branch still merges cleanly with main. - One case in the log differs from AnyPS5, though the description says it matches. In
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? - Small wording point: the
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)". - Probe note: the sets are
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. - Optional: how long the console actually waits on an out-of-range timeout is still unmeasured; keeping a plain "unknown" sentence would leave that open question visible.
Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
… case as measured Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@harisibrar1 thanks, you are right about |
harisibrar1
left a comment
There was a problem hiding this comment.
Re-checked head 9dd91b6 against main feb5059:
- The entry now records the
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. - The
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. - It still merges cleanly into main. Thanks, LGTM.
Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
MarcZX10
left a comment
There was a problem hiding this comment.
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 current main. docs/dev/debt/libkernel.md has 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 this select result, and rerun the conventions/overlap checks on the final head. As a documentation-only PR, no runtime test is needed.
|
@orezraey Thanks for measuring Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine. |
|
@harisibrar1 Thanks. Agreed: if #10777 lands first, I will drop the "where AnyPS5 keeps it" sentence from this entry when I refresh it; if this one lands first, you drop it on yours. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@harisibrar1 #10777 landed first, so as agreed I merged current |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dismissing a stale review: the requested changes were addressed after it (new head) and the merge queue blocks on it. Please request changes again if anything is still open.
|
Checked the new |
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 fix(libkernel): clear select bits from nfds to the end of their word #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: feat(libkernel_sys): implement sigqueue #9389, docs(debt): note how titles call inet_pton #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)