Repository navigation
Conversation
sceNetGetSockInfo always reported 0 in recv_queue_length, so a title that reads a socket only when its record shows queued data never reads. The record now carries the host's FIONREAD count; a socket the host refuses FIONREAD for keeps 0, the value a PS4 Pro on firmware 10.71 reports for an empty queue. The datagram difference between hosts and the other measured values of the record are recorded as technical debt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…unts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rooklz
left a comment
There was a problem hiding this comment.
Ran the host side on macOS and Linux, which the body lists as not run. I used a plain C probe of the same calls fill_sock_info now makes (ioctl(FIONREAD)), plus the SO_NREAD path that sceNetIoctl uses on macOS. I did not build guest_sce_net on either host.
Stream sockets (what the new test checks): matches on both hosts.
| socket | macOS 26.2 arm64 FIONREAD |
Ubuntu 24.04 x86_64 glibc 2.39 FIONREAD |
|---|---|---|
| accepted, empty | 0 | 0 |
accepted, 7 bytes queued ("queued" + NUL) |
7 | 7 |
| accepted, 7 bytes + peer FIN | 7 | 7 |
| listener | 0 | fails EINVAL → record keeps 0 |
So the new rows should pass on macOS and Linux as well, and the Linux listener case goes through the "host refuses FIONREAD keeps 0" branch as the body describes. This matters because the PR's linux CI lane is skipped.
Datagram sockets: one correction to the new debt line, and the follow-up the body left open is now measured.
macOS, one bound UDP socket, loopback sends, FIONREAD after each step (SO_NREAD in brackets):
fresh socket : send 10 -> 26 [10] send 30 -> 88 [10] recv -> 62 [30] recv -> 0
same socket : send 10 -> 42 send 30 -> 104 recv -> 62 recv -> 0
: send 0 -> 32 send 5 -> 69 recv -> 37 recv -> 0
: send 1 x4 -> 33 66 99 132 recv x4 -> 99 66 33 0
The debt line says "macOS adds 16 bytes for the first datagram and 32 for each later one". That only holds for the first datagram a socket ever receives. Once that socket's queue has drained, every datagram adds 32, including the first one queued afterwards (10 → 42, 0 → 32). Suggested wording: "macOS adds 16 bytes for the first datagram a socket receives and 32 for every other". Linux in the same sequence: 10, 10, 30, 0 and 0 → 0 for the empty-first case, which matches the line.
On macOS, sceNetIoctl(FIONREAD) (the #10628 SO_NREAD path) and this record now disagree on the same datagram socket: 10 vs 26, then 10 vs 88 in the first row above. On stream sockets they agree, since both use FIONREAD. The body leaves the macOS difference unmeasured, and the numbers above settle it. Neither host value is the PS4 Pro's payload+16 count, so I would not block on it. Two ways to close it: one shared pending bytes helper so the two exports can't drift apart, or a sentence in the new debt line saying the record and sceNetIoctl disagree on macOS datagrams.
No change requested to the code. The stream path is right on macOS and Linux here, and on Windows in your runs.
|
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.
|
|
Windows run of this head (
AI-assisted: yes (Claude Code). |
|
@xXPBSXx reviewed at b6d748c: a faithful carry of #9932. ntamas94's three commits keep their authorship and the net diff matches #9932 (bar the @adriadam10 we'll merge this once exact-head CI is green, unless you'd rather merge it yourself. |
|
Cross-posting a duplicate-PR notice (produced by Possible duplicate of #9932 (ntamas94, opened 2026-10-22) — "fix(libSceNet): report the receive queue length in sceNetGetSockInfo". Both PRs implement the same Not making a judgement call on which should land — flagging so the two of you and a maintainer can decide before both reviewers' time is spent twice. Happy to re-verify whichever is chosen. |
|
Closing: this carried #9932, which was merged on 2026-11-02 at 07:59 UTC, so this pull request is no longer needed. AI-assisted (Claude Code). |
What
Carries #9932 (ntamas94, head
641b92a91c; its three commits keep their authorship, the four merge commits of that branch are not carried), rebased onto currentmain. The maintainer asked on that PR to mergemain, keep its socket-option wording and combine thesceNetGetSockInfoentries indocs/dev/debt/libSceNet.md; the author has not answered since 23 October, and the hand-off was offered there on 27 October.sceNetGetSockInfoalways reported 0 inrecv_queue_length(offset 0x2c), so a title that polls the record and reads only when the queue is not empty never reads. The record now carries the host'sFIONREADcount for the socket; a socket where the host refusesFIONREADkeeps 0.guest_sce_netgains rows that queue bytes on a connected TCP pair, wait for the receiver's record to report them and check that a receive empties it.The only conflict was in
docs/dev/debt/libSceNet.md. After the rebase thesceNetGetSockInfoentry ofmainkeeps its wording except that "queue lengths" now reads "send queue length", and a new entry below it records the receive queue: the host count, the datagram-socket differences between hosts, and the author's PS4 Pro readings. Those readings are the author's report and were not measured here.The read goes through the host's
FIONREADdirectly, so on macOS it does not follow the datagram counting that #10628 gavesceNetIoctl; that difference is not measured here and is left to a follow-up.Tested
Windows 10 Pro (19045), WinLibs GCC 15.2.0 r7, Ninja Release,
BUILD_TESTING=ON, onmain3a2b919816with this branch on top (ninja exit code 0), 3 runs each:guest_sce_netpasses in all three runs, and again in three runs after the changed files were restored.mainwithlibSceNet/Export.cppreverted and the test kept:guest_sce_netaborts in all three runs (exit code0xc0000409). A one-off build that printed the failing line showed it stops at the new check that the receive queue length equals the seven bytes queued (GuestSceNet.cpp, three runs); that build carried a temporary change to the test'sRequireand is not part of this branch.python tools/check_conventions.py --base upstream/mainpasses,git diff --checkis clean, andgit merge-treeagainst currentmainis clean.Overlap
I took the changed files of each of the 1379 open pull requests from
git diff --name-onlyagainst its merge base withmain(3a2b919816; every ref was fetched): 20 of them, this one's source #9932 included, change at least one oflibSceNet/Export.cpp,GuestSceNet.cppanddocs/dev/debt/libSceNet.md.git merge-treeof this branch with each of the other 19, each on the merge base git finds, reports a conflict for 6 (#5836, #9948, #11134, #11272, #11872, #11969). Four of those already conflict withmainon their own, so this change adds no landing order for them. #9948 (by the same author, whose description says it depends on #9932) and #11272 (Queuse, "keep TCP option state") conflict only with this branch. #9948 follows this pull request and rebases onto it. For #11272, whichever lands second rebases and keeps both changes; which of the two lands first is open, and this pull request does not fix the order.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)Co-authored by the original author of #9932.
AI-assisted (Claude Code).
🤖 Generated with Claude Code