Repository navigation
fix(net): use native Windows condition waits for empty epoll - #1588
Merged
adriadam10 merged 2 commits intoOct 10, 2026
Merged
Conversation
9 tasks done
9 tasks done
8 of 9 tasks
Collaborator
9 tasks done
9 tasks done
Collaborator
|
Rebased onto current Added one commit of our own: Checked: build + the 11 tests in the touched directories pass on Linux. The 1 ms latency check only runs under Merging once CI is green. |
adriadam10
force-pushed
the
fix/net-epoll-precise-timeout
branch
from
October 10, 2026 00:17
a006569 to
bb54bff
Compare
SleglJan
pushed a commit
to SleglJan/AnyPS5
that referenced
this pull request
Oct 10, 2026
…-timeout fix(net): use native Windows condition waits for empty epoll
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
Related to #1471 (the empty-registration
sceNetEpollWaitpath only).With the supported WinLibs toolchain,
std::condition_variable::wait_untiluses winpthreads' coarseGetTickCount64deadline. A 1,000 us empty epoll wait can therefore take approximately one 15.6 ms tick despite the process requesting a 0.5 ms timer resolution.Use a translation-unit-local Windows SRW lock and native condition variable for the network registry. Preserve the existing steady-clock deadline, 100 ms polling slices, wake-all notifications, socket lifetimes and guest error behavior. Linux retains
std::mutexandstd::condition_variable. Unexpected native wait failures throw, matching the project's exact-or-throw policy.Extend
GuestSceNet.cppwith empty finite and zero waits, abort consumption, abort/destroy of indefinite waits, and adding a readable socket to a waiting epoll instance. The timing regression checks the median of nine 1 ms waits rather than imposing a bound on every sample.Tested
Windows 11 Home 10.0.26300, supported WinLibs GCC 15.2.0 UCRT POSIX SEH r7; WSL Ubuntu 26.04 LTS, GCC 15.2.0. Release builds,
BUILD_TESTING=ON, at most two compiler jobs, based on upstreamfd5342b6.guest_sce_net,guest_tcp,guest_udp,guest_poll,guest_addresses,guest_cond_timedwait,guest_nanosleep,guest_pthread_sem,guest_sync_on_address.guest_sce_netalso passed withAPS5_COARSE_TIMED_WAITS=1andAPS5_NO_TIMER_RESOLUTION=1: two additional passes. The latter intentionally omits the latency ceiling while retaining the timeout lower bound and all functional checks. Its 15.558 ms median reproduced an independent review finding, which the corrected test guard resolves.git diff --check: passed.libc,libkernel,libSceNetandlibSceNetCtl, then loaded the patched network library and invoked its epoll exports by NID on both platforms. Used the repository's patcher and the same--preserve-exportsinput as CMake; the generated packaging target's unrelated dependency fan-out was cancelled.Build and CTest commands (Windows
build; Linux/home/roojool/anyps5-net-epoll-linux):Full-project/GPU tests, console hardware and proprietary titles were not tested. The non-empty socket path still uses the existing bounded
WSAPoll/pollwaits. The existing registration-snapshot notification window remains bounded by the unchanged 100 ms slice. WSL reported that userfaultfd write watch was unavailable and used its existing memory-comparison fallback; no memory tracking behavior was changed.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository