Repository navigation
Conversation
…ents in the observation log Fixes hub T54
AlxcBTW
marked this pull request as ready for review
October 28, 2026 17:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes hub T54. Games on Mono (Unity) answer
Socket.Poll(0, ...)with a throwaway epoll per call:sceNetEpollCreate,sceNetEpollControlADD,sceNetEpollWaitwith timeout 0, DEL,sceNetEpollDestroy. Seven never-sleeping threads did this about 175 000 times per second in total (1.7 M calls in 15 s) and starved the main thread of a game that then sat on a black screen on loading.What the code showed: readiness and closed descriptors already behave correctly (a fresh epoll reports a writable datagram socket at once; control on a closed descriptor answers EBADF, a closed descriptor leaves the epoll; the resolver reports failure with an error). So the loop is legitimate guest behaviour that nothing slowed down.
sceNetEpollWaitwith a zero timeout paces a thread that polls hot and empty: after 32 empty polls less than 0.5 ms apart it yields, after 256 it sleeps about 1 ms per call. A returned event or a pause in the loop resets the count.sceNetEpollControl(events) and the eventssceNetEpollWaitreturned (ready, as ident to events), which were missing when this was investigated.net_epoll_per_callwith the scenarios udp (writable and readable datagram socket, level triggered), tcp (non-blocking connect then writable, data, peer close), refused (failed connect wakes the poll), closed (closed descriptor), spin (seven spinning threads are paced) and observe (the new log fields).Tested
Not run on a game yet; CI builds and runs the tests, and a Windows toolkit of this head is built from the Nightly workflow for the game test on Windows.
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)