fix(libkernel): preserve blocking sockets over nonblocking native transport #12688

Open
Felipebmaitan wants to merge 142 commits from upstream-pr/12688 into main
Felipebmaitan commented 2026-10-29 02:18:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Felipebmaitan on 2026-10-29T02:18:16Z.


What

Head 978a8bef6c118f57242b96cee5c6f8cdf493e5d8 integrates published #12682 7887e7a03da0e8aeed2557f4ba43a6aa777494b9 and main 4f5777f2f320111b156ed5db843a6d5f67968923, including #24382’s Windows socket buffer checks.

Windows send checks the readable source before entering the transport retry loop. Plain recv passes the writable prefix and a partial-buffer indicator to ReceiveNative, like recvfrom. The nonblocking buffer probe and any datagram discard run within the same receive operation. A probe that would block takes the existing retained-socket wait, and cancellation and shutdown are checked before the next native operation. The datagram truncation result uses the validated byte limit.

Previous head a57cf356306256d779487ad2e27695ae76f99ea6 merges upstream main at 8ab98849d5ddf19f9e8758a5205b6159318ea10c and retains published #12682 at e3c4edcd7a254b916d0b8be8521cc58079e3ccbc. The conflict was in connect_nid_postfix. The merge keeps #24939’s Linux pending-connect state under modeMutex, preserves that state on EINPROGRESS, EALREADY, and EINTR, and clears it on success or a terminal error. The Windows blocking connect can still retry after refusal.

The Windows loader fix keeps native I/O registration in libkernel around forwarded receives. libSceNet calls three C entry points that the NID patcher preserves. The stack also keeps #11625’s archive pread errno translation inside cancellation and descriptor ownership, #24076’s per-chunk read interruption, and Windows ungetc pushback handling under the FILE lock.

The LibreSSL interruption fixture uses the backing socket owner’s transfer callback after injecting the requested error. Winsock sockets are physically nonblocking, and the callback preserves guest blocking mode and timeout semantics. The fixture still requires the next SSL_connect to succeed and checks the existing EINTR retry flags.

The Windows transport uses per-call retries on nonblocking host sockets. It retains the socket across descriptor close or reuse, registers shutdown wakeups against that socket, and preserves positive receive progress. The same shutdown wakes native/SCE and borrowed-owner receive waits, including a wait on a descriptor slot that was closed and reused. The accept wait retains its own operation kind. The merge keeps upstream's checked address and output contracts, forwarded libSceNet close wakeups, and Unix datagram ENOBUFS handling. The Unix retained SSL callback still reads F_GETFL per transfer and uses a single deadline across EINTR retries.

The first Windows run reproduced an EIO in guest_sce_net_kernel_forwards on both the combined branch and the published reads runtime. The updated reads prerequisite captures the native error before the interruption check, restoring EAGAIN for an empty MSG_DONTWAIT receive. The transport layer inherits that fix.

Independent review found that a Windows blocking connect could cache a refusal and prevent another attempt on the same socket. The fix keeps pending-error caching for guest-nonblocking connects and allows a blocking connect to retry. guest_socket_options now covers a closed endpoint followed by a successful connection to a listening endpoint. The shared Winsock mode behavior for an independently managed borrowed socket is recorded in the debt fragment.

For the landing order proposed in #10645, I’m fine with #10645 landing before #12688. The merge needs both SubmittedRecords.hpp and SocketSelectDeadline.hpp in Udp.cpp. The transport builds without #10645. #12700 is downstream and inherits the socket fixtures. The mirrored exports in #18112 and #18190 should forward through the same receive implementations. If #24322 lands, carry the transport changes into the socket translation units compiled by that refactor.

#12682 is the prerequisite. #23341 is an independent overlap. The branch that lands second must carry ReceiveEnded through the data receive and readiness recheck paths, and wake a blocked transfer through the retained socket when the peer closes or shuts down writes.

Tested

  • On 978a8bef6c118f57242b96cee5c6f8cdf493e5d8, 403/403 focused Release CTests passed on Windows 11 Pro (WinLibs GCC 15.2) and 390/390 passed on Linux (Debian 12 container, GCC 14.2, WSL2). Both selections covered UDP, TCP, MSG_DONTWAIT, retained-socket shutdown, cancellation, and LibreSSL transport. The Windows selection included the selected-module loader smoke and the individual patched fixtures.
  • Windows guest_udp exercises unreadable send buffers, unwritable receive buffers, valid writable prefixes, and oversized datagram discard. Eight Windows guarded-buffer tests cover shutdown and cancellation for both recv and recvfrom on TCP and UDP. The UDP case and all eight guarded-buffer cases passed five additional runs each.
  • Conventions, whitespace, the debt fold, and the public-header audit passed (413 libraries, 34,810 exports). Git merged the tested head cleanly with the newer main tip e60b2f74adb21151e50567a770ecd8aa795ce415. The function-name scan covered 2,168 open PR heads, including the independent MSG_WAITALL proposal in #11896. The dependency remains #12682.

Results from the preceding Linux connect integration:

  • On a57cf356306256d779487ad2e27695ae76f99ea6, 395/395 focused Release CTests passed on Windows 11 Pro (WinLibs GCC 15.2) and 390/390 passed on Linux (Debian 12 container, GCC 14.2, WSL2). The Windows selection includes the four LibreSSL SSL I/O cases, seven individual patched fixtures, and the selected-module loader smoke. Both suites cover the competing-reader MSG_DONTWAIT regression, retained-socket shutdown and cancellation, and the LibreSSL transport fixture.
  • Linux guest_tcp exercised main’s ENOTCONN result for send, write, and addressless sendto during a pending TCP connect. It and guest_socket_send_before_connect each passed five additional runs. Windows guest_socket_options, including the blocking retry after refusal, also passed five additional runs.
  • Conventions, whitespace, and the public-header audit passed (413 libraries, 34,810 exports). The debt checker reports the same unmatched feat-libwebrtc-rnn-vad.md entry on both the PR and a clean main snapshot. The function-name scan covered 2,173 open PR heads. The overlapping socket stack, macOS reconnect change, and export mirrors are independent of the upstream Linux fix. #12682 remains the prerequisite.

Results from 59991e7d5e186a075c78bd7b55718ce6bb63b59f and its fixture correction:

  • The hosted Windows run had one failing test, guest_libressl_ssl_io_transport. Locally, head 7935169d1605d995040076bee0b6128df94a690c reproduced the abort at the second SSL_connect assertion on line 1161. The three companion SSL I/O cases passed before the fixture correction.

  • Head 59991e7d5e186a075c78bd7b55718ce6bb63b59f passed 12/12 focused Windows CTests and 14/14 focused Linux CTests. Both selections exercised all four LibreSSL SSL I/O cases, all three LibreSSL engine cases, libSceSsl transports, forwarded receives, and socket nonblocking behavior. The Windows transport case that failed in CI passed eight consecutive runs.

  • tools/pr_overlap.py --names FakeTransfer checked 2,201 open PR heads and found no match. Conventions and whitespace checks passed.

  • All 22 runnable hosted checks passed on 59991e7d5e186a075c78bd7b55718ce6bb63b59f. Its hosted Windows run ran 5,869 tests successfully, including the corrected LibreSSL transport fixture and full patched-library sweep. The hosted Linux job was skipped.

The results below are from the preceding loader-fix head 7935169d1605d995040076bee0b6128df94a690c.

  • Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0 r7, Release. 388/388 focused CTests passed, including the competing-reader guest_socket_dontwait regression for #10943, positive MSG_WAITALL progress, and blocking connect retry after refusal.
  • Linux Docker (Debian 12, GCC 14.2.0, WSL2 kernel 6.6.87.2), Release. 383/383 focused CTests passed, including the retained-socket native-mode cases.
  • Both suites exercised read cancellation, the 156 receive-shutdown cases, forwarded libSceNet receives and close wakeups, the libSceNet net_dontwait_* cases available on each host, Unix socketpairs, the sockatmark inline out-of-band fixture, SSL callbacks, curl sockets, standard streams, and stream-close coverage. The added selection covers vector file I/O, pipe creation, descriptor duplication, underscore socket entries, message-buffer bounds, and libSceNet socket info. The archive and plain-file fixtures exercised app0.zar mapping and read paths. On Linux, guest_file_vector crosses the 2 GiB file transfer boundary.
  • The seven individual Windows cases that failed in #12682’s hosted job passed locally, including patched LibreSSL, LibreSSL3, SO_REUSEPORT, and IPV6_V6ONLY. The loader smoke test loaded all six staged patched modules. The PE tables show that every libSceNet cancellation import is exported by patched libkernel. The full patched-library sweep and all seven individual patched fixtures also passed in the hosted Windows run on that loader-fix head.
  • One independent reviewer inspected 1118184e8fc5183dbe9d3108650199810495a2c8. I reproduced the blocking-connect refusal in the new fixture before the fix. The fixture passed after 3bf188d8f478213e85aa21fae457a77fdc649729. On the predecessor c5c5917dcb067b566811d8692d86cd0eae59f12c, 203/203 Windows and 206/206 Linux focused CTests passed. Seven targeted Windows fixtures passed three runs each there. A separate rerun of eight socket tests passed on that predecessor during the progress-report investigation. Marc reviewed selected source paths at that predecessor and at 804d854d2bdacb49116521eb6a7c0cba5e45c1d7 without a formal approval. That head passed 210/210 Windows and 213/213 Linux focused CTests. Marc’s source-only review of the archive merge dd3e4aa0de0548d820b4aa85a5c6c61ce3ae3683 also reported no blocking findings. That archive head passed 215/215 Windows and 218/218 Linux focused CTests.
  • Convention, whitespace, debt fragment, and public-header checks passed. The public-header audit checked 413 libraries and 34,782 exports. The function-name overlap scan covered 2,237 open PRs, including the related work in #12682 and #23341.

The local results cover synthetic loopback and local socket fixtures. macOS, console or title behavior, and the older AMD profiling report remain unverified. GitHub CI and maintainer validation run separately.

Earlier evidence, pinned to its original heads

What

Head 8f34999f2fad40fcf704765c3dedcafe5d157fa7 preserves published November transport 95ce5937f26f90a44448271a17fb3d105be6128c and adopts exact published reads 32121ca48d0abf5e1c11e7c601636d10ec8cb77d, including fetched main 4138defef7c468835190768e5143e411bce92d6a, through merge history.

Address Dean's Windows shutdown integration request. Data receive waits register the existing per-thread TransferWakerTag against the retained socket object, after draining stale wake packets. Shutdown through any alias signals that registration, including native/SCE and borrowed-owner receive waits without an active POSIX cancellation operation. Cancellation registration remains separately conditional on IoActive. Transfer checks ReceiveShut before each retry, retains positive progress and treats local shutdown separately from actual interruption. Main's receive-wrapper checks, empty source addresses and receiver arguments remain; Windows WaitForTransfer delegates to this common nonblocking transport loop. Main's ReadWatch machinery for multiplexed waits is retained.

Keep main's new connection tracking/error state alongside the existing physically nonblocking connect loop, and main's measured SSL handshake reset/plaintext errors alongside retained-owner transport callbacks. Restore the FreeBSD soreceive_generic MSG_DONTWAIT citation. The production blocking PEEK|WAITALL throw/debt remains; the previously withdrawn throw-expectation tests are not restored.

Review exposed and repaired a shared-loop error-contract regression: accept is not a byte receive. Explicit private TransferKind::Accept excludes it from data EOF shortcuts, shutdown error mapping and receive-wake registration. This adds no accept cancellation feature. The accept owner must preserve that explicit argument when adopting this prerequisite. Own dependency order remains reads #12682, transport #12688, writes #12700; no other owner's branch was edited.

Tested

Fresh local Release production builds and focused runtime validation, CPU builds capped at two jobs:

  • 478/478 Windows cases pass at the final head (Windows 10.0.26300, WinLibs GCC 15.2; 38.41 s total). 505/505 Ubuntu 24.04 WSL2/GCC 13.3 cases pass after rebuilding the relevant libc/libkernel/libSceLibcInternal/libkernel_sys/libSceNet/libSceSsl graph and fixtures. This covers existing cancellation/progress/descriptor/context/signal/stream-close/socket/dontwait/SSL transport paths plus the new matrix; it is not the entire project suite.
  • 156 shutdown cases per OS: real loopback TCP/UDP, scalar/vector POSIX read aliases, receive aliases, SCE/native calls, disabled pending cancellation, actual cancellation, parallel readers, receive timeouts and Windows known-positive WAITALL progress. Four added SCE close/reuse cases retain an alias, close the receiving descriptor, install a new connection into its slot, shut the old alias, then verify the new connection still transfers data.
  • Deterministic wake negative control: remove only shutdown's notification loop and keep the observation hooks. Windows ordinary recv, partial WAITALL and SCE descriptor-reuse cases fail 3/3, bounded in 7.04 s total. Restore exact source bytes, refresh mtime and rebuild the real production library: 156/156 pass, followed by the final broad Windows run above. No native operation is cancelled wholesale as the production repair.
  • The accept regression fails on production candidate 2dd935f09d016a4006e0929eaff40a2b8ae27f95: connected stream -> successful SHUT_RD -> accept reports result=-1, errno=38 instead of normal non-listening EINVAL22 (0.85 s CTest total). The operation-kind repair passes that case and all 156 shutdown cases. Both initial independent MICRO/MACRO reviews confirmed this P2. Two fresh independent read-only MICRO/MACRO reviews of repaired 91b617d84495d815c07d933b2ed4451f635fec29 found no remaining must-fix defect. Final head differs from the repaired reviewed source only by the restored debt citation; reviewers ran no binaries.
  • Header audit: 407 libraries / 30,931 exports, unique owning declarations and umbrella coverage pass. Conventions against origin/main: 0 errors, one existing 1,084-character context-debt warning. Isolated overlap scan of the repaired production candidate: 1,774 heads, 78 uncomparable shared-file branches; failed closed, no blanket clearance or new contributor-order agreement claimed.

Evidence boundaries: Windows transport observes real EWOULDBLOCK and completed registration immediately before select; Linux observes admission before its syscall/poll. This establishes the admission-to-wait gap, not an independently observed already-parked select or Linux partial-WAITALL progress. The missing-notification control establishes that the wake is necessary. Existing WSL userfaultfd fallback and original FreeType submodule state remain. Unix retained SSL bare-poll cancellation/close limits, macOS unconnected-datagram and zero-length datagram ancillary races retain debt. The separately reported address-waking intermittency and Windows 22621 sigjump cause remain unresolved. No fresh title/console/macOS/GPU/allocation-failure/paired trace_digest qualification; no performance claim. Maintainer scene/bench and new-head CI/review remain separate gates; historical approvals below are not current-head approval.

Historical evidence and status at earlier heads (superseded where stated above)

What

Head 95ce5937f26f90a44448271a17fb3d105be6128c, integrated main d23df92b3805fea21493a73cbed8835c9e8548d0 through ordinary merge history, preserving every previously published head and maintainer commit.

Implement cancellable native socket transport above reads, retaining the Windows partial-writable-buffer recvfrom probe inside the receive retry/deadline and its delayed-data tests. Remove the requested UnsupportedPeekWaitAll helper/invocation and the ReceivePeekWaitAll blocking throw/message/counter loop. Keep the production NotImplemented marker and gap debt, implemented DONTWAIT/nonblocking EAGAIN, PeekWithWaitAll queued-byte/consume checks and ordinary transport behavior. Drop only unused General.hpp/string includes; retain used exception/memory helpers.

#12149 merged November 4 at 05:34 UTC and #9019 merged November 4 at 17:34 UTC; both are satisfied in main. #10552/#10817/#10755 are also merged. All four Apple empty-iovec guards, general context restoration, synchronous writes and deterministic stream-close hooks/comparisons remain. No archive #11625 work or unrelated owner branch was changed.

Current source comparison: git diff a564d53d8feacc77e94cc6301f35b41175fff6a0 95ce5937f26f90a44448271a17fb3d105be6128c spans 14 files. The maintainer merged main separately into the published branches; the current lower head is not an ancestor of this head. This is a direct tree comparison; the main-based Files view remains cumulative. No retarget or history replacement was performed.

Consolidated maintainer response and evidence.

Tested

Current-head Windows verification: native Windows job succeeds at 95ce5937f26f90a44448271a17fb3d105be6128c. The earlier manual dispatch HTTP 403 remains historical; dispatch is no longer a blocker for this head's Windows execution. Read the job log: main d23df92b38 merged with this head, Server 2025/GNU 15.2 Release; 2,507 passed / 1,033 skipped / zero failed, 3,540 scheduled, 205.62 s. guest_socket_dontwait passes 5.88 s, guest_socket_transfer_progress 2.00 s and guest_udp 1.71 s. These are the maintainer-requested tests after removal of assertions requiring the unsupported blocking receive. The production marker/debt and implemented nonblocking/peek/delayed-buffer coverage remain. One sigjump sample passes 0.02 s on Server 2025; it does not qualify Windows 22621. Other checks remain incomplete with no observed current failures. Reads/transport/writes approvals remain pinned to earlier parent heads; no new review is inferred. The old accept macOS x86-64 timeout remains unexplained, and accept stays draft for the unresolved Windows 22621 hang.

Current transport progress audit: the live report now compares main d23df92b38 with transport 95ce5937f2. Reproduced libkernel counts 703 done / 55 todo on main and 696 / 62 here. A temporary scanner-only copy changing only Transfer's blocking-stream receive PEEK|WAITALL NotImplemented marker to a generic throw restores 703 / 55 and precisely accept/recv/recvfrom/recvmsg/send/sendfile/sendto. The scanner propagates helper names without evaluating platform, send/receive or flag guards. Send paths cannot enter that receive-only guard; accept uses no PEEK|WAITALL flags. Receive paths retain the documented unsupported Windows combination alongside implemented behavior. This is classification evidence only, with no runtime qualification. The production gap marker/debt and scanner remain intact; the maintainer-requested removal of tests requiring the missing feature is preserved. The report does not establish unconditional replacement of seven exports with stubs, and no new source change or push is warranted.

Main-integration follow-up: authoritative head 95ce5937f26f90a44448271a17fb3d105be6128c, main d23df92b3805fea21493a73cbed8835c9e8548d0. During the reads overlap audit the bot refreshed to 12 compared / 81 uncomparable branches at 2026-11-05 12:56:19 UTC. #15698 is confirmed merged; its removed row is satisfied by main. The other removed rows are not treated as merged or cleared merely because they disappeared. The remaining compared heads match the selected-source audits; no new implementation dependency. The existing-main recvfrom notice was checked: one implementation definition and one canonical declaration in main and reads, with no duplicate registration to remove.

The pre-push fetch caught maintainer commits a564d53d8f (reads), 95ce5937f2 (transport) and 6076fc5ca3 (writes). Those published commits were adopted unchanged; only accept needed a new ordinary merge of the maintainer's writes head, producing 82eaaf7766. Main's macOS process-start-block pages stay mapped, and the debt still states that POSIX read/receive waits wake and defer delivery until ownership guards are released. No maintainer source resolution was overwritten.

All four authoritative heads pass required conventions and whitespace checks (the existing SSL warning remains on the upper layers). The changed MainThreadMacOs.cpp passes host macOS x86-64 syntax checking. Linux I/O production sources and the selected I/O fixtures are unchanged from the earlier composed 93-test run; guest_socket_dontwait passes again against those unchanged Linux binaries (1.93 s; 2.07 s CTest total). This is not execution of the macOS stack-move fixture or a fresh full-suite run. The refreshed coordinated overlap scan covers 1,831 PRs and fails closed for 84 uncomparable branches at the top accept tree; the reads report's 81 count has different scope and remains uncleared. No repeated no-change overlap comment is posted. New integration-head checks/reviews remain pending; earlier runtime results and approvals below are historical at the heads they name. The earlier manual dispatch was denied HTTP 403; current Windows jobs are recorded above, so dispatch is no longer a blocker for these heads; the intermittent Windows 22621 hang and old accept macOS x86-64 timeout remain unresolved. Accept stays draft.

Transport overlap refresh 2026-11-05 11:59:58 UTC at this head: 19 compared / 94 uncomparable branches, against main e772fb25cc. Read all 19 live heads and the selected new/changed shared-source patches; no whole-branch or combined-runtime clearance. This is the transport subset of the coordinated scan, whose top accept tree reported 100 uncomparable branches.

Selected composition requirements: #13390's updated host-log preservation and failure handling must retain FILE-before-descriptor locking and deterministic stream-close controls. #13582/#13587 preserve checked output-before-mutation and module copy/error ordering; #14497 adds checked JIT output and rollback after releasing its registry lock, so later close cleanup must retain that ordering. #15571/#15748 add checked name/key outputs with failure cleanup. #12970/#14264 add independent startup/instance-lock/allocator build registrations; preserve both sets of tests and platform paths. #15698 retains the macOS process start block when releasing the old stack; preserve that mapping lifetime alongside stack/context retirement.

#15782 maps Windows INADDR_ANY and IPv4-mapped zero destinations to loopback, after existing zero-port/multicast decisions; a later composition must keep that address/error order, SourceFaults precedence and this stack's descriptor/cancellation/Native scopes. #15794 changes UserUcontext/UserMcontext layout and aliases exception frames to it; its proposed offsets, copy bounds and tests must be reconciled with this stack's opaque mc_spare identity/copied-context/abandonment behavior. Its layout change is not imported or jointly tested here. #15848 changes SSL handshake reset/plain-response codes and adds fixtures; preserve that classification and coverage alongside retained transport ownership and its documented Unix wait limit. Remaining pins retain their prior selected-source audits.

These patches introduce no helper this transport implementation requires. Depends on remains #12682; #12149 and #9019 are satisfied in main. No import, base change, source push, order agreement or new runtime qualification follows from this report. All 94 uncomparable branches remain uncleared; archive #11625 is untouched. No repeated overlap comment posted. Pinned compared heads: #12970 a26cb1fc68f20005548d7a3cc162c6220e6a2d3c, #13390 9cf30ea1519df52d52e56892e839d33389808ddc, #13468 ed4c0e19d226c7d37dc61cb1a34ad35c76431d6a, #13582 4ebacd9758689a3e6d9133cf0e5dbcb6ef4bdca1, #13587 49b8d3f89428d8ee111f753053913bdf20c73ef3, #14085 4e67d63a85551ed560845b3abc7766a1eab89ff6, #14183 80c8ea873ee9adfc0a0f9ce060d2ec1e883d9e4f, #14264 cd4549d0cc7790dcc000d1613b6e9a3eaf0a3e5a, #14497 7d75cace5a99f4029e8699f806fa6fe7b40170fe, #15135 b83067a484129701bb780ba2b0b430b1a0f56d1c, #15508 c87d4dcc19244f45b47c7559d41742c9a15b7999, #15524 887c31979a495f396c8bee2e202f0e5bfffbe850, #15567 f5dacc4e140ca1c323f3d229c687132e837cf480, #15571 a0480169f435d8e04dd93bbc9cb9940a51e11010, #15698 dd5ee9e4c66d8fb716b0d6426fd6bd94822f58eb, #15748 b90f0dc47cec8a8b4c795ac29693083d3cf96cc4, #15782 2d60f12f6c74e6f073bc24e8d37881bce366f390, #15794 90c30d52bedf772d7f52789c6bbae4b3ded37378, #15848 41ddd4d6d7e3fe21596bc778aa1467f3d878aab9.

Composed accept tree 6db995790dbe9193ee44028e327ad907faaa5cba with main e772fb25cc72ee5faf77847f06bbc69533016e82: Ubuntu 24.04.5/GCC 13.3 Release, x86-64 Docker through Apple Silicon translation. Rebuilt libc/libkernel/libSceLibcInternal/libkernel_sys and focused fixtures. 30/30 selected socket/UDP/context/accept tests pass (4.60 s): guest_socket_dontwait 1.78 s, guest_udp 1.59 s, all 15 accept cases including both installation failures and cancel/jump handoff disposal. 63/63 selected synchronous-write/stream-close tests pass (3.13 s). These are composed-stack focused results, not a full suite or independent runtime runs of every layer. Both requested test removals are present; implemented nonblocking/peek and delayed partial-buffer cases remain.

Required python3 tools/check_conventions.py --base origin/main checks pass for all four final heads, using an isolated Git context whose origin/main is the actual fetched upstream main above. Reads has no findings; upper layers retain only the existing SSL debt-length warning. Whitespace, preserved-parent and bottom-up ancestor checks pass. The coordinated stack overlap scan covers 1,811 open PRs and fails closed for 100 uncomparable branches; no whole-branch overlap clearance or owner-order agreement is claimed. Latest main and all four remote heads were fetched before the atomic fast-forward-only push. GitHub reports all four branches merge cleanly.

Earlier Windows verification status, superseded by the current results above: After the earlier publication, ordered Build dispatch 12682 12688 12700 12965 was rejected with HTTP 403, “Must have admin rights to Repository.” At that point a collaborator/admin dispatch was requested for guest_socket_dontwait plus native Windows guest_socket_transfer_progress; current runs above now supply execution. The available MinGW 13 cross-syntax attempt stops at newer main's _fflush_nolock declaration; no native Windows execution is inferred. The previous published heads' Windows jobs passed, but do not qualify these updates. New-head CI/review requires refresh.

Prior XairRrR approvals are historical: reads 32169af1dc, transport 70120f1b86, writes fbd44d3326. Accept's prior review is COMMENTED and it remains draft. No new approval is inferred.

The old accept macOS x86-64 job126136729127 remains failed at attempt 1; refreshed status/log reads 668 passed and guest_none_relocations timed out at 20.12 s, 354.88 s total. Its cause and a fix are unestablished; there is no fresh full macOS runtime qualification. The intermittent Windows 22621 sigjump hang remains unresolved; these Linux passes do not resolve it. Retained SSL waits, per-call I/O overhead and the cancelling-caller indefinite spin retain their debt/limits. Unpublished signal-registry/cancellation-request and SyncWrites-exception candidates are excluded. No new title/console, GPU or paired same-scene trace_digest run; no performance claim. Maintainer title-scene bench remains external.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #12682
  • Fixes: Fixes #10943
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5060950504 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12688). Originally posted by [Felipebmaitan](https://github.com/Felipebmaitan) on 2026-10-29T02:18:16Z. --- ### What Head `978a8bef6c118f57242b96cee5c6f8cdf493e5d8` integrates published #12682 `7887e7a03da0e8aeed2557f4ba43a6aa777494b9` and `main` `4f5777f2f320111b156ed5db843a6d5f67968923`, including #24382’s Windows socket buffer checks. Windows `send` checks the readable source before entering the transport retry loop. Plain `recv` passes the writable prefix and a partial-buffer indicator to `ReceiveNative`, like `recvfrom`. The nonblocking buffer probe and any datagram discard run within the same receive operation. A probe that would block takes the existing retained-socket wait, and cancellation and shutdown are checked before the next native operation. The datagram truncation result uses the validated byte limit. Previous head `a57cf356306256d779487ad2e27695ae76f99ea6` merges upstream `main` at `8ab98849d5ddf19f9e8758a5205b6159318ea10c` and retains published #12682 at `e3c4edcd7a254b916d0b8be8521cc58079e3ccbc`. The conflict was in `connect_nid_postfix`. The merge keeps #24939’s Linux pending-connect state under `modeMutex`, preserves that state on `EINPROGRESS`, `EALREADY`, and `EINTR`, and clears it on success or a terminal error. The Windows blocking connect can still retry after refusal. The Windows loader fix keeps native I/O registration in libkernel around forwarded receives. libSceNet calls three C entry points that the NID patcher preserves. The stack also keeps #11625’s archive `pread` errno translation inside cancellation and descriptor ownership, #24076’s per-chunk read interruption, and Windows `ungetc` pushback handling under the FILE lock. The LibreSSL interruption fixture uses the backing socket owner’s transfer callback after injecting the requested error. Winsock sockets are physically nonblocking, and the callback preserves guest blocking mode and timeout semantics. The fixture still requires the next `SSL_connect` to succeed and checks the existing `EINTR` retry flags. The Windows transport uses per-call retries on nonblocking host sockets. It retains the socket across descriptor close or reuse, registers shutdown wakeups against that socket, and preserves positive receive progress. The same shutdown wakes native/SCE and borrowed-owner receive waits, including a wait on a descriptor slot that was closed and reused. The accept wait retains its own operation kind. The merge keeps upstream's checked address and output contracts, forwarded libSceNet close wakeups, and Unix datagram `ENOBUFS` handling. The Unix retained SSL callback still reads `F_GETFL` per transfer and uses a single deadline across `EINTR` retries. The first Windows run reproduced an `EIO` in `guest_sce_net_kernel_forwards` on both the combined branch and the published reads runtime. The updated reads prerequisite captures the native error before the interruption check, restoring `EAGAIN` for an empty `MSG_DONTWAIT` receive. The transport layer inherits that fix. Independent review found that a Windows blocking `connect` could cache a refusal and prevent another attempt on the same socket. The fix keeps pending-error caching for guest-nonblocking connects and allows a blocking connect to retry. `guest_socket_options` now covers a closed endpoint followed by a successful connection to a listening endpoint. The shared Winsock mode behavior for an independently managed borrowed socket is recorded in the debt fragment. For the landing order proposed in #10645, I’m fine with #10645 landing before #12688. The merge needs both `SubmittedRecords.hpp` and `SocketSelectDeadline.hpp` in `Udp.cpp`. The transport builds without #10645. #12700 is downstream and inherits the socket fixtures. The mirrored exports in #18112 and #18190 should forward through the same receive implementations. If #24322 lands, carry the transport changes into the socket translation units compiled by that refactor. #12682 is the prerequisite. #23341 is an independent overlap. The branch that lands second must carry `ReceiveEnded` through the data receive and readiness recheck paths, and wake a blocked transfer through the retained socket when the peer closes or shuts down writes. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> - On `978a8bef6c118f57242b96cee5c6f8cdf493e5d8`, 403/403 focused Release CTests passed on Windows 11 Pro (WinLibs GCC 15.2) and 390/390 passed on Linux (Debian 12 container, GCC 14.2, WSL2). Both selections covered UDP, TCP, `MSG_DONTWAIT`, retained-socket shutdown, cancellation, and LibreSSL transport. The Windows selection included the selected-module loader smoke and the individual patched fixtures. - Windows `guest_udp` exercises unreadable send buffers, unwritable receive buffers, valid writable prefixes, and oversized datagram discard. Eight Windows guarded-buffer tests cover shutdown and cancellation for both `recv` and `recvfrom` on TCP and UDP. The UDP case and all eight guarded-buffer cases passed five additional runs each. - Conventions, whitespace, the debt fold, and the public-header audit passed (413 libraries, 34,810 exports). Git merged the tested head cleanly with the newer `main` tip `e60b2f74adb21151e50567a770ecd8aa795ce415`. The function-name scan covered 2,168 open PR heads, including the independent `MSG_WAITALL` proposal in #11896. The dependency remains #12682. Results from the preceding Linux connect integration: - On `a57cf356306256d779487ad2e27695ae76f99ea6`, 395/395 focused Release CTests passed on Windows 11 Pro (WinLibs GCC 15.2) and 390/390 passed on Linux (Debian 12 container, GCC 14.2, WSL2). The Windows selection includes the four LibreSSL SSL I/O cases, seven individual patched fixtures, and the selected-module loader smoke. Both suites cover the competing-reader `MSG_DONTWAIT` regression, retained-socket shutdown and cancellation, and the LibreSSL transport fixture. - Linux `guest_tcp` exercised main’s `ENOTCONN` result for `send`, `write`, and addressless `sendto` during a pending TCP connect. It and `guest_socket_send_before_connect` each passed five additional runs. Windows `guest_socket_options`, including the blocking retry after refusal, also passed five additional runs. - Conventions, whitespace, and the public-header audit passed (413 libraries, 34,810 exports). The debt checker reports the same unmatched `feat-libwebrtc-rnn-vad.md` entry on both the PR and a clean `main` snapshot. The function-name scan covered 2,173 open PR heads. The overlapping socket stack, macOS reconnect change, and export mirrors are independent of the upstream Linux fix. #12682 remains the prerequisite. Results from `59991e7d5e186a075c78bd7b55718ce6bb63b59f` and its fixture correction: - The [hosted Windows run](https://github.com/boykopovar/AnyPS5/actions/runs/44866166860/job/136733463096) had one failing test, `guest_libressl_ssl_io_transport`. Locally, head `7935169d1605d995040076bee0b6128df94a690c` reproduced the abort at the second `SSL_connect` assertion on line 1161. The three companion SSL I/O cases passed before the fixture correction. - Head `59991e7d5e186a075c78bd7b55718ce6bb63b59f` passed 12/12 focused Windows CTests and 14/14 focused Linux CTests. Both selections exercised all four LibreSSL SSL I/O cases, all three LibreSSL engine cases, libSceSsl transports, forwarded receives, and socket nonblocking behavior. The Windows transport case that failed in CI passed eight consecutive runs. - `tools/pr_overlap.py --names FakeTransfer` checked 2,201 open PR heads and found no match. Conventions and whitespace checks passed. - All 22 runnable hosted checks passed on `59991e7d5e186a075c78bd7b55718ce6bb63b59f`. Its [hosted Windows run](https://github.com/boykopovar/AnyPS5/actions/runs/44873935002/job/136756568334) ran 5,869 tests successfully, including the corrected LibreSSL transport fixture and full patched-library sweep. The hosted Linux job was skipped. The results below are from the preceding loader-fix head `7935169d1605d995040076bee0b6128df94a690c`. - Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0 r7, Release. 388/388 focused CTests passed, including the competing-reader `guest_socket_dontwait` regression for #10943, positive `MSG_WAITALL` progress, and blocking connect retry after refusal. - Linux Docker (Debian 12, GCC 14.2.0, WSL2 kernel 6.6.87.2), Release. 383/383 focused CTests passed, including the retained-socket native-mode cases. - Both suites exercised read cancellation, the 156 receive-shutdown cases, forwarded libSceNet receives and close wakeups, the libSceNet `net_dontwait_*` cases available on each host, Unix socketpairs, the `sockatmark` inline out-of-band fixture, SSL callbacks, curl sockets, standard streams, and stream-close coverage. The added selection covers vector file I/O, pipe creation, descriptor duplication, underscore socket entries, message-buffer bounds, and libSceNet socket info. The archive and plain-file fixtures exercised `app0.zar` mapping and read paths. On Linux, `guest_file_vector` crosses the 2 GiB file transfer boundary. - The seven individual Windows cases that failed in [#12682’s hosted job](https://github.com/boykopovar/AnyPS5/actions/runs/44854888826/job/136705039829) passed locally, including patched LibreSSL, LibreSSL3, `SO_REUSEPORT`, and `IPV6_V6ONLY`. The loader smoke test loaded all six staged patched modules. The PE tables show that every libSceNet cancellation import is exported by patched libkernel. The full patched-library sweep and all seven individual patched fixtures also passed in the hosted Windows run on that loader-fix head. - One independent reviewer inspected `1118184e8fc5183dbe9d3108650199810495a2c8`. I reproduced the blocking-connect refusal in the new fixture before the fix. The fixture passed after `3bf188d8f478213e85aa21fae457a77fdc649729`. On the predecessor `c5c5917dcb067b566811d8692d86cd0eae59f12c`, 203/203 Windows and 206/206 Linux focused CTests passed. Seven targeted Windows fixtures passed three runs each there. A separate rerun of eight socket tests passed on that predecessor during the progress-report investigation. Marc reviewed selected source paths at that predecessor and at `804d854d2bdacb49116521eb6a7c0cba5e45c1d7` without a formal approval. That head passed 210/210 Windows and 213/213 Linux focused CTests. Marc’s source-only review of the archive merge `dd3e4aa0de0548d820b4aa85a5c6c61ce3ae3683` also reported no blocking findings. That archive head passed 215/215 Windows and 218/218 Linux focused CTests. - Convention, whitespace, debt fragment, and public-header checks passed. The public-header audit checked 413 libraries and 34,782 exports. The function-name overlap scan covered 2,237 open PRs, including the related work in #12682 and #23341. The local results cover synthetic loopback and local socket fixtures. macOS, console or title behavior, and the older AMD profiling report remain unverified. GitHub CI and maintainer validation run separately. <details><summary>Earlier evidence, pinned to its original heads</summary> #### What Head `8f34999f2fad40fcf704765c3dedcafe5d157fa7` preserves published November transport `95ce5937f26f90a44448271a17fb3d105be6128c` and adopts exact published reads `32121ca48d0abf5e1c11e7c601636d10ec8cb77d`, including fetched main `4138defef7c468835190768e5143e411bce92d6a`, through merge history. Address [Dean's Windows shutdown integration request](https://github.com/boykopovar/AnyPS5/pull/12688#issuecomment-6672546510). Data receive waits register the existing per-thread TransferWakerTag against the retained socket object, after draining stale wake packets. Shutdown through any alias signals that registration, including native/SCE and borrowed-owner receive waits without an active POSIX cancellation operation. Cancellation registration remains separately conditional on IoActive. Transfer checks ReceiveShut before each retry, retains positive progress and treats local shutdown separately from actual interruption. Main's receive-wrapper checks, empty source addresses and receiver arguments remain; Windows WaitForTransfer delegates to this common nonblocking transport loop. Main's ReadWatch machinery for multiplexed waits is retained. Keep main's new connection tracking/error state alongside the existing physically nonblocking connect loop, and main's measured SSL handshake reset/plaintext errors alongside retained-owner transport callbacks. Restore the FreeBSD soreceive_generic MSG_DONTWAIT citation. The production blocking PEEK|WAITALL throw/debt remains; the previously withdrawn throw-expectation tests are not restored. Review exposed and repaired a shared-loop error-contract regression: accept is not a byte receive. Explicit private TransferKind::Accept excludes it from data EOF shortcuts, shutdown error mapping and receive-wake registration. This adds no accept cancellation feature. **The accept owner must preserve that explicit argument when adopting this prerequisite.** Own dependency order remains reads #12682, transport #12688, writes #12700; no other owner's branch was edited. #### Tested Fresh local Release production builds and focused runtime validation, CPU builds capped at two jobs: - **478/478 Windows** cases pass at the final head (Windows 10.0.26300, WinLibs GCC 15.2; 38.41 s total). **505/505 Ubuntu 24.04 WSL2/GCC 13.3** cases pass after rebuilding the relevant libc/libkernel/libSceLibcInternal/libkernel_sys/libSceNet/libSceSsl graph and fixtures. This covers existing cancellation/progress/descriptor/context/signal/stream-close/socket/dontwait/SSL transport paths plus the new matrix; it is not the entire project suite. - **156 shutdown cases per OS**: real loopback TCP/UDP, scalar/vector POSIX read aliases, receive aliases, SCE/native calls, disabled pending cancellation, actual cancellation, parallel readers, receive timeouts and Windows known-positive WAITALL progress. Four added SCE close/reuse cases retain an alias, close the receiving descriptor, install a new connection into its slot, shut the old alias, then verify the new connection still transfers data. - Deterministic wake negative control: remove only shutdown's notification loop and keep the observation hooks. Windows ordinary recv, partial WAITALL and SCE descriptor-reuse cases **fail 3/3**, bounded in 7.04 s total. Restore exact source bytes, refresh mtime and rebuild the real production library: **156/156** pass, followed by the final broad Windows run above. No native operation is cancelled wholesale as the production repair. - The accept regression fails on production candidate `2dd935f09d016a4006e0929eaff40a2b8ae27f95`: connected stream -> successful SHUT_RD -> accept reports `result=-1, errno=38` instead of normal non-listening EINVAL22 (0.85 s CTest total). The operation-kind repair passes that case and all 156 shutdown cases. Both initial independent MICRO/MACRO reviews confirmed this P2. Two **fresh** independent read-only MICRO/MACRO reviews of repaired `91b617d84495d815c07d933b2ed4451f635fec29` found no remaining must-fix defect. Final head differs from the repaired reviewed source only by the restored debt citation; reviewers ran no binaries. - Header audit: **407 libraries / 30,931 exports**, unique owning declarations and umbrella coverage pass. Conventions against origin/main: **0 errors**, one existing 1,084-character context-debt warning. Isolated overlap scan of the repaired production candidate: **1,774 heads**, **78 uncomparable shared-file branches**; failed closed, no blanket clearance or new contributor-order agreement claimed. Evidence boundaries: Windows transport observes real EWOULDBLOCK and completed registration immediately before select; Linux observes admission before its syscall/poll. This establishes the admission-to-wait gap, not an independently observed already-parked select or Linux partial-WAITALL progress. The missing-notification control establishes that the wake is necessary. Existing WSL userfaultfd fallback and original FreeType submodule state remain. Unix retained SSL bare-poll cancellation/close limits, macOS unconnected-datagram and zero-length datagram ancillary races retain debt. The separately reported address-waking intermittency and Windows 22621 sigjump cause remain unresolved. No fresh title/console/macOS/GPU/allocation-failure/paired trace_digest qualification; no performance claim. Maintainer scene/bench and new-head CI/review remain separate gates; historical approvals below are not current-head approval. <details><summary>Historical evidence and status at earlier heads (superseded where stated above)</summary> #### What Head `95ce5937f26f90a44448271a17fb3d105be6128c`, integrated main `d23df92b3805fea21493a73cbed8835c9e8548d0` through ordinary merge history, preserving every previously published head and maintainer commit. Implement cancellable native socket transport above reads, retaining the Windows partial-writable-buffer recvfrom probe inside the receive retry/deadline and its delayed-data tests. Remove the requested UnsupportedPeekWaitAll helper/invocation and the ReceivePeekWaitAll blocking throw/message/counter loop. Keep the production NotImplemented marker and gap debt, implemented DONTWAIT/nonblocking EAGAIN, PeekWithWaitAll queued-byte/consume checks and ordinary transport behavior. Drop only unused General.hpp/string includes; retain used exception/memory helpers. #12149 merged November 4 at 05:34 UTC and #9019 merged November 4 at 17:34 UTC; both are satisfied in main. #10552/#10817/#10755 are also merged. All four Apple empty-iovec guards, general context restoration, synchronous writes and deterministic stream-close hooks/comparisons remain. No archive #11625 work or unrelated owner branch was changed. Current source comparison: `git diff a564d53d8feacc77e94cc6301f35b41175fff6a0 95ce5937f26f90a44448271a17fb3d105be6128c` spans 14 files. The maintainer merged main separately into the published branches; the current lower head is not an ancestor of this head. This is a direct tree comparison; the main-based Files view remains cumulative. No retarget or history replacement was performed. [Consolidated maintainer response and evidence](https://github.com/boykopovar/AnyPS5/pull/12688#issuecomment-6657001460). #### Tested Current-head Windows verification: [native Windows job](https://github.com/boykopovar/AnyPS5/actions/runs/42028963256/job/127250539896) succeeds at `95ce5937f26f90a44448271a17fb3d105be6128c`. The earlier manual dispatch HTTP 403 remains historical; dispatch is no longer a blocker for this head's Windows execution. Read the job log: main d23df92b3805fea21493a73cbed8835c9e8548d0 merged with this head, Server 2025/GNU 15.2 Release; **2,507 passed / 1,033 skipped / zero failed**, 3,540 scheduled, 205.62 s. guest_socket_dontwait passes 5.88 s, guest_socket_transfer_progress 2.00 s and guest_udp 1.71 s. These are the maintainer-requested tests after removal of assertions requiring the unsupported blocking receive. The production marker/debt and implemented nonblocking/peek/delayed-buffer coverage remain. One sigjump sample passes 0.02 s on Server 2025; it does not qualify Windows 22621. Other checks remain incomplete with no observed current failures. Reads/transport/writes approvals remain pinned to earlier parent heads; no new review is inferred. The old accept macOS x86-64 timeout remains unexplained, and accept stays draft for the unresolved Windows 22621 hang. Current transport progress audit: the [live report](https://github.com/boykopovar/AnyPS5/pull/12688#issuecomment-6611621668) now compares main d23df92b3805fea21493a73cbed8835c9e8548d0 with transport 95ce5937f26f90a44448271a17fb3d105be6128c. Reproduced libkernel counts 703 done / 55 todo on main and 696 / 62 here. A temporary scanner-only copy changing only Transfer's blocking-stream receive PEEK|WAITALL NotImplemented marker to a generic throw restores 703 / 55 and precisely accept/recv/recvfrom/recvmsg/send/sendfile/sendto. The scanner propagates helper names without evaluating platform, send/receive or flag guards. Send paths cannot enter that receive-only guard; accept uses no PEEK|WAITALL flags. Receive paths retain the documented unsupported Windows combination alongside implemented behavior. This is classification evidence only, with no runtime qualification. The production gap marker/debt and scanner remain intact; the maintainer-requested removal of tests requiring the missing feature is preserved. The report does not establish unconditional replacement of seven exports with stubs, and no new source change or push is warranted. Main-integration follow-up: authoritative head `95ce5937f26f90a44448271a17fb3d105be6128c`, main `d23df92b3805fea21493a73cbed8835c9e8548d0`. During the reads overlap audit the bot refreshed to 12 compared / 81 uncomparable branches at 2026-11-05 12:56:19 UTC. #15698 is confirmed merged; its removed row is satisfied by main. The other removed rows are not treated as merged or cleared merely because they disappeared. The remaining compared heads match the selected-source audits; no new implementation dependency. The existing-main recvfrom notice was checked: one implementation definition and one canonical declaration in main and reads, with no duplicate registration to remove. The pre-push fetch caught maintainer commits a564d53d8feacc77e94cc6301f35b41175fff6a0 (reads), 95ce5937f26f90a44448271a17fb3d105be6128c (transport) and 6076fc5ca39d40aad6e69b27a41a50f4af3bc836 (writes). Those published commits were adopted unchanged; only accept needed a new ordinary merge of the maintainer's writes head, producing 82eaaf776697625bd9e186d94f7e87c6301f4c30. Main's macOS process-start-block pages stay mapped, and the debt still states that POSIX read/receive waits wake and defer delivery until ownership guards are released. No maintainer source resolution was overwritten. All four authoritative heads pass required conventions and whitespace checks (the existing SSL warning remains on the upper layers). The changed MainThreadMacOs.cpp passes host macOS x86-64 syntax checking. Linux I/O production sources and the selected I/O fixtures are unchanged from the earlier composed 93-test run; guest_socket_dontwait passes again against those unchanged Linux binaries (1.93 s; 2.07 s CTest total). This is not execution of the macOS stack-move fixture or a fresh full-suite run. The refreshed coordinated overlap scan covers 1,831 PRs and fails closed for 84 uncomparable branches at the top accept tree; the reads report's 81 count has different scope and remains uncleared. No repeated no-change overlap comment is posted. New integration-head checks/reviews remain pending; earlier runtime results and approvals below are historical at the heads they name. The earlier manual dispatch was denied HTTP 403; current Windows jobs are recorded above, so dispatch is no longer a blocker for these heads; the intermittent Windows 22621 hang and old accept macOS x86-64 timeout remain unresolved. Accept stays draft. Transport overlap refresh 2026-11-05 11:59:58 UTC at this head: **19 compared / 94 uncomparable branches**, against main e772fb25cc72ee5faf77847f06bbc69533016e82. Read all 19 live heads and the selected new/changed shared-source patches; no whole-branch or combined-runtime clearance. This is the transport subset of the coordinated scan, whose top accept tree reported 100 uncomparable branches. Selected composition requirements: #13390's updated host-log preservation and failure handling must retain FILE-before-descriptor locking and deterministic stream-close controls. #13582/#13587 preserve checked output-before-mutation and module copy/error ordering; #14497 adds checked JIT output and rollback after releasing its registry lock, so later close cleanup must retain that ordering. #15571/#15748 add checked name/key outputs with failure cleanup. #12970/#14264 add independent startup/instance-lock/allocator build registrations; preserve both sets of tests and platform paths. #15698 retains the macOS process start block when releasing the old stack; preserve that mapping lifetime alongside stack/context retirement. #15782 maps Windows INADDR_ANY and IPv4-mapped zero destinations to loopback, after existing zero-port/multicast decisions; a later composition must keep that address/error order, SourceFaults precedence and this stack's descriptor/cancellation/Native scopes. #15794 changes UserUcontext/UserMcontext layout and aliases exception frames to it; its proposed offsets, copy bounds and tests must be reconciled with this stack's opaque mc_spare identity/copied-context/abandonment behavior. Its layout change is not imported or jointly tested here. #15848 changes SSL handshake reset/plain-response codes and adds fixtures; preserve that classification and coverage alongside retained transport ownership and its documented Unix wait limit. Remaining pins retain their prior selected-source audits. These patches introduce no helper this transport implementation requires. Depends on remains #12682; #12149 and #9019 are satisfied in main. No import, base change, source push, order agreement or new runtime qualification follows from this report. All 94 uncomparable branches remain uncleared; archive #11625 is untouched. No repeated overlap comment posted. Pinned compared heads: #12970 `a26cb1fc68f20005548d7a3cc162c6220e6a2d3c`, #13390 `9cf30ea1519df52d52e56892e839d33389808ddc`, #13468 `ed4c0e19d226c7d37dc61cb1a34ad35c76431d6a`, #13582 `4ebacd9758689a3e6d9133cf0e5dbcb6ef4bdca1`, #13587 `49b8d3f89428d8ee111f753053913bdf20c73ef3`, #14085 `4e67d63a85551ed560845b3abc7766a1eab89ff6`, #14183 `80c8ea873ee9adfc0a0f9ce060d2ec1e883d9e4f`, #14264 `cd4549d0cc7790dcc000d1613b6e9a3eaf0a3e5a`, #14497 `7d75cace5a99f4029e8699f806fa6fe7b40170fe`, #15135 `b83067a484129701bb780ba2b0b430b1a0f56d1c`, #15508 `c87d4dcc19244f45b47c7559d41742c9a15b7999`, #15524 `887c31979a495f396c8bee2e202f0e5bfffbe850`, #15567 `f5dacc4e140ca1c323f3d229c687132e837cf480`, #15571 `a0480169f435d8e04dd93bbc9cb9940a51e11010`, #15698 `dd5ee9e4c66d8fb716b0d6426fd6bd94822f58eb`, #15748 `b90f0dc47cec8a8b4c795ac29693083d3cf96cc4`, #15782 `2d60f12f6c74e6f073bc24e8d37881bce366f390`, #15794 `90c30d52bedf772d7f52789c6bbae4b3ded37378`, #15848 `41ddd4d6d7e3fe21596bc778aa1467f3d878aab9`. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Composed accept tree `6db995790dbe9193ee44028e327ad907faaa5cba` with main `e772fb25cc72ee5faf77847f06bbc69533016e82`: Ubuntu 24.04.5/GCC 13.3 Release, x86-64 Docker through Apple Silicon translation. Rebuilt libc/libkernel/libSceLibcInternal/libkernel_sys and focused fixtures. **30/30** selected socket/UDP/context/accept tests pass (4.60 s): guest_socket_dontwait 1.78 s, guest_udp 1.59 s, all 15 accept cases including both installation failures and cancel/jump handoff disposal. **63/63** selected synchronous-write/stream-close tests pass (3.13 s). These are composed-stack focused results, not a full suite or independent runtime runs of every layer. Both requested test removals are present; implemented nonblocking/peek and delayed partial-buffer cases remain. Required `python3 tools/check_conventions.py --base origin/main` checks pass for all four final heads, using an isolated Git context whose origin/main is the actual fetched upstream main above. Reads has no findings; upper layers retain only the existing SSL debt-length warning. Whitespace, preserved-parent and bottom-up ancestor checks pass. The coordinated stack overlap scan covers 1,811 open PRs and fails closed for 100 uncomparable branches; no whole-branch overlap clearance or owner-order agreement is claimed. Latest main and all four remote heads were fetched before the atomic fast-forward-only push. GitHub reports all four branches merge cleanly. **Earlier Windows verification status, superseded by the current results above:** After the earlier publication, ordered Build dispatch `12682 12688 12700 12965` was rejected with HTTP 403, “Must have admin rights to Repository.” At that point a collaborator/admin dispatch was requested for guest_socket_dontwait plus native Windows guest_socket_transfer_progress; current runs above now supply execution. The available MinGW 13 cross-syntax attempt stops at newer main's `_fflush_nolock` declaration; no native Windows execution is inferred. The previous published heads' Windows jobs passed, but do not qualify these updates. New-head CI/review requires refresh. Prior XairRrR approvals are historical: reads 32169af1dc395b182370cdf973687d313d33bfc4, transport 70120f1b8604f9a5f4f96cb18fbf299204acdeec, writes fbd44d33266946006afd8ca4acc55e2bbe7d91e6. Accept's prior review is COMMENTED and it remains draft. No new approval is inferred. The old accept macOS x86-64 [job126136729127](https://github.com/boykopovar/AnyPS5/actions/runs/41696471846/job/126136729127) remains failed at attempt 1; refreshed status/log reads 668 passed and guest_none_relocations timed out at 20.12 s, 354.88 s total. Its cause and a fix are unestablished; there is no fresh full macOS runtime qualification. The intermittent Windows 22621 sigjump hang remains unresolved; these Linux passes do not resolve it. Retained SSL waits, per-call I/O overhead and the cancelling-caller indefinite spin retain their debt/limits. Unpublished signal-registry/cancellation-request and SyncWrites-exception candidates are excluded. No new title/console, GPU or paired same-scene trace_digest run; no performance claim. Maintainer title-scene bench remains external. </details> <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> </details> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #12682 <!-- #PR, or none --> - [x] Fixes: Fixes #10943 <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
CnRJay commented 2026-11-01 19:50:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:50:55Z.

Review: COMMENTED


Correction (2026-11-01): the title-ID/log demand below is not a CONTRIBUTING requirement; Unblocks: none is allowed. The technical points below are unaffected.

The descriptor-access layer is cumulative here as well (the diff still carries the reads layer, +6.1k). The same points as on #12682 apply:

  1. GuestDescriptorAccess::Get(int) locks one global static mutex and does an erase_if pass over the whole std::map<int, std::weak_ptr<State>> on every call, which is every read, recv, write and send. That is O(open descriptors) under a process-wide lock per I/O call.
  2. The close path polls: Interrupt() followed by changed.wait_for(lock, 1ms) until CanChange(). The registry drain is yield() in a loop while holding and re-taking the registry mutex.

Evidence: Unblocks: none while the body leans on Human Fall Flat (PPSA02429). Please name the title under Unblocks and show the log line that reaches this transport path on main. There are no trace_digest.py summaries of main versus this change for a socket-heavy scene, so the cost of moving native sockets to nonblocking plus readiness polling is unmeasured.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729927138 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12688#pullrequestreview-5729927138). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-11-01T19:50:55Z. **Review:** COMMENTED --- **Correction (2026-11-01):** the title-ID/log demand below is not a CONTRIBUTING requirement; `Unblocks: none` is allowed. The technical points below are unaffected. The descriptor-access layer is cumulative here as well (the diff still carries the reads layer, +6.1k). The same points as on #12682 apply: 1. `GuestDescriptorAccess::Get(int)` locks one global static mutex and does an `erase_if` pass over the whole `std::map<int, std::weak_ptr<State>>` on every call, which is every read, recv, write and send. That is O(open descriptors) under a process-wide lock per I/O call. 2. The close path polls: `Interrupt()` followed by `changed.wait_for(lock, 1ms)` until `CanChange()`. The registry drain is `yield()` in a loop while holding and re-taking the registry mutex. Evidence: `Unblocks: none` while the body leans on Human Fall Flat (PPSA02429). Please name the title under `Unblocks` and show the log line that reaches this transport path on `main`. There are no `trace_digest.py` summaries of `main` versus this change for a socket-heavy scene, so the cost of moving native sockets to nonblocking plus readiness polling is unmeasured.
XairRrR commented 2026-11-03 17:44:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T17:44:24Z.

Review: COMMENTED


Reviewed — comments

The PR merges cleanly, builds, and passes every Linux test it reaches, and the Linux negative control fails as it should. Most of the new transport code is Windows-only and could not be run here, and reading it turns up one likely Windows regression.

What I ran

Head 35e16ad94f3ef76de75d7c28ad224efb71f8d790 merged with --no-ff into main 1e658521a0a599872612bb91949311e2956b5283, on Debian 13 (VM, 32 vCPU Xeon Gold 6136), GCC 14.2.0, Release, Ninja.

git diff --check 1e658521a0a599872612bb91949311e2956b5283...35e16ad94f3ef76de75d7c28ad224efb71f8d790
python3 tools/check_conventions.py --base 1e658521a0a599872612bb91949311e2956b5283
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "guest_socket_native_mode|guest_ssl_transport|guest_socket_timeouts|guest_socket_dontwait|guest_udp$|net_dontwait|guest_socket_read_write"
# negative control
git show 1e658521a0a599872612bb91949311e2956b5283:core/libs/prx/libkernel/Socket/src/Udp.cpp > core/libs/prx/libkernel/Socket/src/Udp.cpp
ninja -C build -j32 -l32 guest_socket_native_mode_tests guest_ssl_transport_tests
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "guest_socket_native_mode|guest_ssl_transport"
git show ec9fec6fd2e03c457f05bcd544b341eb555a1eae:core/libs/prx/libkernel/Socket/src/Udp.cpp > core/libs/prx/libkernel/Socket/src/Udp.cpp
ninja -C build -j32 -l32 guest_socket_native_mode_tests guest_ssl_transport_tests
ctest --test-dir build -j8 --test-load 32 -R "guest_socket_native_mode|guest_ssl_transport"
git status --porcelain

Results

Check Result
git diff --check clean
check_conventions.py 0 errors, 1 warning (debt-length on docs/dev/debt/libSceSsl.md:10, 7821 characters; this entry already existed and the PR edits it)
Configure / build / libs (script) ok
Selected tests (script, 4075 run) no new failures, no timeouts; 9 known failures that also fail on main (agc_driver_* denormal/division, guest_interfaces, guest_socket_options_multicast, unwrap_self_…, vector_constant_factor_tininess); guest_net_ctl skip also happens on main
Focused transport tests (20) 20/20 passed, 9.59 s total, slowest net_dontwait_blocking_sendto at 3.13 s
Worktree after restore git status --porcelain empty; focused tests pass again (5/5)

Negative control

I restored only core/libs/prx/libkernel/Socket/src/Udp.cpp from main and rebuilt. Four tests then failed:

Output with main's Udp.cpp
send-nonblocking: native one-byte write=-1 errno=11 after filling 8128 bytes
native socket mode check failed at line 52, errno 11, guest errno 11
receive-nonblocking: native empty read=-1 errno=11 byte=63 elapsed=0ms
native socket mode check failed at line 52, errno 11, guest errno 11

The following tests FAILED:
	3062 - guest_ssl_transport_kernel (Timeout)
	3778 - guest_socket_native_mode_receive-nonblocking (Subprocess aborted)
	3779 - guest_socket_native_mode_receive-blocking (Subprocess aborted)
	3780 - guest_socket_native_mode_send-nonblocking (Subprocess aborted)

So the new Unix tests depend on the PR's TransferForNativeOwner, which is now installed on every platform. After I restored the merged file and rebuilt, they passed again. The Windows-only fixtures, such as guest_socket_transfer_progress, are not registered on Linux, so this control does not cover them.

Findings

Blocking

None.

Non-blocking

  1. Windows blocking recvfrom into a partly unwritable buffer can now return EAGAIN instead of waiting. Udp.cpp#L1999-L2008 calls PendingFits (L620-L647) before ReceiveNative.

    • PendingFits makes a direct MSG_PEEK ::recvfrom call.
    • Before this PR, the native socket of a blocking guest socket was blocking, so that peek waited for data.
    • Now Install makes every Windows native socket nonblocking, and Windows WaitForTransfer returns 0 straight away (L1087-L1092).
    • With no data queued, the peek fails with WSAEWOULDBLOCK, and the call returns Fail(35) without ever reaching Transfer's readiness wait or SO_RCVTIMEO handling.

    I found this by reading the code; I could not run it, because there is no Windows here. The path is narrow (it only applies when GuestPrefix finds less writable memory than length), but it contradicts the PR's goal of preserving blocking sockets. Suggested fix: when the guest socket is blocking and MSG_DONTWAIT is not set, wait with WaitTransferReady and the receive deadline before the peek, and retry the peek on WSAEWOULDBLOCK. A Windows test that sends the datagram after the receiver blocks would cover this.

  2. Windows blocking MSG_PEEK | MSG_WAITALL on a stream socket returns an invented EOPNOTSUPP instead of throwing. See Udp.cpp#L167-L170.

    • FreeBSD accepts this combination, and the debt entry calls it unsupported ("needs a separate buffering contract").
    • CONTRIBUTING says a function either does what it should or throws.
    • On main, Winsock produced the same error for this combination, so this is not a regression. But the PR now synthesises the error deliberately, so it should be NotImplemented_nid_no_patch("recv: MSG_PEEK | MSG_WAITALL on a blocking stream socket"), and the MSG_DONTWAIT/MSG_WAITALL debt wording should change to match.
  3. The Unix retained transfer wait cannot be cancelled. TransferForNativeOwner on Unix waits in a bare ::poll (Udp.cpp#L251-L252), not inside ThreadCancel::Native. An SSL session on a blocking socket with no timeout therefore waits indefinitely, even when the socket is closed from another thread, unless shutdown wakes it.

    • This matches the libSceSsl/libkernel debt notes on retained waits, so it is acceptable as recorded debt.
    • It is worth confirming that the debt entry names this case explicitly, so the limitation is visible.
  4. Scope. The diff against main (53 files, +5566/−181) includes the open prerequisites #12149 and #12682. The Depends on line declares them, but merging this PR before them would bring their code in under this title. This review concentrated on the transport part: Socket/, NativeIo.cpp, libSceSsl, libSceNet and their tests. It did not re-review the read-cancellation and _setjmp layers in depth.

Not verified

  • Windows runtime. Nearly all of the new Transfer/WaitTransferReady logic is #ifdef _WIN32: nonblocking native transport, readiness retries, the deadline restart after progress, connect completion through select, and the per-thread waker reuse. None of it ran here. The CI totals quoted in the description (Server 2025: 2,389 passed; macOS relinker 669/669) are taken from the PR text and not reproduced. The Windows 22621 intermittent hang the author reports is still open.
  • macOS. The macOS runtime path was not run.
  • Validation layer. The script skipped the Vulkan validation comparison because no AGC/shader/VideoOut file changed; that skip is correct.
  • Other claims. The Human Fall Flat counts in the discussion and the composed-stack 660/660 run were not reproduced.
  • Prerequisites. The prerequisite layers (#12149, #12682) were covered only by the script's selected test run, not by a separate review.

To get this to a good state

  1. Make the Windows recvfrom partial-writable-buffer path honour blocking mode and SO_RCVTIMEO before peeking (finding 1), and add a Windows test where the datagram arrives after the receiver blocks.
  2. Throw NotImplemented_nid_no_patch for blocking MSG_PEEK | MSG_WAITALL on Windows instead of returning EOPNOTSUPP (finding 2), and update the debt entry to match.
  3. Ideally, land #12149 and #12682 first, so that this PR's diff against main is only the transport change.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5756940468 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12688#pullrequestreview-5756940468). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T17:44:24Z. **Review:** COMMENTED --- # Reviewed — comments The PR merges cleanly, builds, and passes every Linux test it reaches, and the Linux negative control fails as it should. Most of the new transport code is Windows-only and could not be run here, and reading it turns up one likely Windows regression. ## What I ran Head `35e16ad94f3ef76de75d7c28ad224efb71f8d790` merged with `--no-ff` into `main` `1e658521a0a599872612bb91949311e2956b5283`, on Debian 13 (VM, 32 vCPU Xeon Gold 6136), GCC 14.2.0, Release, Ninja. ``` git diff --check 1e658521a0a599872612bb91949311e2956b5283...35e16ad94f3ef76de75d7c28ad224efb71f8d790 python3 tools/check_conventions.py --base 1e658521a0a599872612bb91949311e2956b5283 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "guest_socket_native_mode|guest_ssl_transport|guest_socket_timeouts|guest_socket_dontwait|guest_udp$|net_dontwait|guest_socket_read_write" # negative control git show 1e658521a0a599872612bb91949311e2956b5283:core/libs/prx/libkernel/Socket/src/Udp.cpp > core/libs/prx/libkernel/Socket/src/Udp.cpp ninja -C build -j32 -l32 guest_socket_native_mode_tests guest_ssl_transport_tests ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "guest_socket_native_mode|guest_ssl_transport" git show ec9fec6fd2e03c457f05bcd544b341eb555a1eae:core/libs/prx/libkernel/Socket/src/Udp.cpp > core/libs/prx/libkernel/Socket/src/Udp.cpp ninja -C build -j32 -l32 guest_socket_native_mode_tests guest_ssl_transport_tests ctest --test-dir build -j8 --test-load 32 -R "guest_socket_native_mode|guest_ssl_transport" git status --porcelain ``` ## Results | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | 0 errors, 1 warning (`debt-length` on `docs/dev/debt/libSceSsl.md:10`, 7821 characters; this entry already existed and the PR edits it) | | Configure / build / `libs` (script) | ok | | Selected tests (script, 4075 run) | no new failures, no timeouts; 9 known failures that also fail on `main` (`agc_driver_*` denormal/division, `guest_interfaces`, `guest_socket_options_multicast`, `unwrap_self_…`, `vector_constant_factor_tininess`); `guest_net_ctl` skip also happens on `main` | | Focused transport tests (20) | 20/20 passed, 9.59 s total, slowest `net_dontwait_blocking_sendto` at 3.13 s | | Worktree after restore | `git status --porcelain` empty; focused tests pass again (5/5) | ## Negative control I restored only `core/libs/prx/libkernel/Socket/src/Udp.cpp` from `main` and rebuilt. Four tests then failed: <details><summary>Output with main's Udp.cpp</summary> ``` send-nonblocking: native one-byte write=-1 errno=11 after filling 8128 bytes native socket mode check failed at line 52, errno 11, guest errno 11 receive-nonblocking: native empty read=-1 errno=11 byte=63 elapsed=0ms native socket mode check failed at line 52, errno 11, guest errno 11 The following tests FAILED: 3062 - guest_ssl_transport_kernel (Timeout) 3778 - guest_socket_native_mode_receive-nonblocking (Subprocess aborted) 3779 - guest_socket_native_mode_receive-blocking (Subprocess aborted) 3780 - guest_socket_native_mode_send-nonblocking (Subprocess aborted) ``` </details> So the new Unix tests depend on the PR's `TransferForNativeOwner`, which is now installed on every platform. After I restored the merged file and rebuilt, they passed again. The Windows-only fixtures, such as `guest_socket_transfer_progress`, are not registered on Linux, so this control does not cover them. ## Findings ### Blocking None. ### Non-blocking 1. **Windows blocking `recvfrom` into a partly unwritable buffer can now return `EAGAIN` instead of waiting.** [Udp.cpp#L1999-L2008](https://github.com/boykopovar/AnyPS5/blob/35e16ad94f3ef76de75d7c28ad224efb71f8d790/core/libs/prx/libkernel/Socket/src/Udp.cpp#L1999-L2008) calls `PendingFits` ([L620-L647](https://github.com/boykopovar/AnyPS5/blob/35e16ad94f3ef76de75d7c28ad224efb71f8d790/core/libs/prx/libkernel/Socket/src/Udp.cpp#L620-L647)) before `ReceiveNative`. - `PendingFits` makes a direct `MSG_PEEK` `::recvfrom` call. - Before this PR, the native socket of a blocking guest socket was blocking, so that peek waited for data. - Now `Install` makes every Windows native socket nonblocking, and Windows `WaitForTransfer` returns 0 straight away ([L1087-L1092](https://github.com/boykopovar/AnyPS5/blob/35e16ad94f3ef76de75d7c28ad224efb71f8d790/core/libs/prx/libkernel/Socket/src/Udp.cpp#L1087-L1092)). - With no data queued, the peek fails with `WSAEWOULDBLOCK`, and the call returns `Fail(35)` without ever reaching `Transfer`'s readiness wait or `SO_RCVTIMEO` handling. I found this by reading the code; I could not run it, because there is no Windows here. The path is narrow (it only applies when `GuestPrefix` finds less writable memory than `length`), but it contradicts the PR's goal of preserving blocking sockets. Suggested fix: when the guest socket is blocking and `MSG_DONTWAIT` is not set, wait with `WaitTransferReady` and the receive deadline before the peek, and retry the peek on `WSAEWOULDBLOCK`. A Windows test that sends the datagram after the receiver blocks would cover this. 2. **Windows blocking `MSG_PEEK | MSG_WAITALL` on a stream socket returns an invented `EOPNOTSUPP` instead of throwing.** See [Udp.cpp#L167-L170](https://github.com/boykopovar/AnyPS5/blob/35e16ad94f3ef76de75d7c28ad224efb71f8d790/core/libs/prx/libkernel/Socket/src/Udp.cpp#L167-L170). - FreeBSD accepts this combination, and the debt entry calls it unsupported ("needs a separate buffering contract"). - CONTRIBUTING says a function either does what it should or throws. - On `main`, Winsock produced the same error for this combination, so this is not a regression. But the PR now synthesises the error deliberately, so it should be `NotImplemented_nid_no_patch("recv: MSG_PEEK | MSG_WAITALL on a blocking stream socket")`, and the `MSG_DONTWAIT`/`MSG_WAITALL` debt wording should change to match. 3. **The Unix retained transfer wait cannot be cancelled.** `TransferForNativeOwner` on Unix waits in a bare `::poll` ([Udp.cpp#L251-L252](https://github.com/boykopovar/AnyPS5/blob/35e16ad94f3ef76de75d7c28ad224efb71f8d790/core/libs/prx/libkernel/Socket/src/Udp.cpp#L251-L252)), not inside `ThreadCancel::Native`. An SSL session on a blocking socket with no timeout therefore waits indefinitely, even when the socket is closed from another thread, unless `shutdown` wakes it. - This matches the libSceSsl/libkernel debt notes on retained waits, so it is acceptable as recorded debt. - It is worth confirming that the debt entry names this case explicitly, so the limitation is visible. 4. **Scope.** The diff against `main` (53 files, +5566/−181) includes the open prerequisites #12149 and #12682. The `Depends on` line declares them, but merging this PR before them would bring their code in under this title. This review concentrated on the transport part: `Socket/`, `NativeIo.cpp`, libSceSsl, libSceNet and their tests. It did not re-review the read-cancellation and `_setjmp` layers in depth. ## Not verified - **Windows runtime.** Nearly all of the new `Transfer`/`WaitTransferReady` logic is `#ifdef _WIN32`: nonblocking native transport, readiness retries, the deadline restart after progress, `connect` completion through `select`, and the per-thread waker reuse. None of it ran here. The CI totals quoted in the description (Server 2025: 2,389 passed; macOS relinker 669/669) are taken from the PR text and not reproduced. The Windows 22621 intermittent hang the author reports is still open. - **macOS.** The macOS runtime path was not run. - **Validation layer.** The script skipped the Vulkan validation comparison because no AGC/shader/VideoOut file changed; that skip is correct. - **Other claims.** The Human Fall Flat counts in the discussion and the composed-stack 660/660 run were not reproduced. - **Prerequisites.** The prerequisite layers (#12149, #12682) were covered only by the script's selected test run, not by a separate review. ## To get this to a good state 1. Make the Windows `recvfrom` partial-writable-buffer path honour blocking mode and `SO_RCVTIMEO` before peeking (finding 1), and add a Windows test where the datagram arrives after the receiver blocks. 2. Throw `NotImplemented_nid_no_patch` for blocking `MSG_PEEK | MSG_WAITALL` on Windows instead of returning `EOPNOTSUPP` (finding 2), and update the debt entry to match. 3. Ideally, land #12149 and #12682 first, so that this PR's diff against `main` is only the transport change. <!-- anyps5-bots job=2005 head=35e16ad94f3ef76de75d7c28ad224efb71f8d790 -->
XairRrR commented 2026-11-03 18:18:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T18:18:37Z.

Review: COMMENTED


Re-checked — comments

Commits 085458a70c and 8957ad0b52 change three things. The Windows partial-buffer recvfrom probe now runs inside the transport wait, and blocking stream MSG_PEEK | MSG_WAITALL now throws. The Unix retained-wait limitation is now written into both debt files. Reading the code, all three points from my last review are fixed. But the two code fixes only run on Windows. Neither here nor in the author's run (syntax-only MinGW checks) have they been executed.

What changed since my last review

  • core/libs/prx/libkernel/Socket/src/Udp.cpp:
    • ReceiveFrom no longer calls PendingFits before the receive. It passes partialBuffer = limit < length to ReceiveNative.
    • On Windows, ReceiveNative runs PendingFits/DropDatagram inside the Transfer operation, at offset == 0.
    • Transfer calls NotImplemented_nid_no_patch("recv: MSG_PEEK | MSG_WAITALL on a blocking stream socket") instead of setting WSAEOPNOTSUPP.
  • core/libs/tests/GuestUdp.cpp: new CheckDelayedPartialReceive. It covers delayed fitting (3-byte) and oversized (8-byte) datagrams into 4 writable bytes followed by a guard page:
    • blocking, and with SO_RCVTIMEO;
    • plain and MSG_PEEK;
    • an idle timeout, and immediate EAGAIN for MSG_DONTWAIT and for a nonblocking socket.
  • core/libs/tests/GuestSocketTransferProgress.cpp (Windows-only fixture): new receive-peek-waitall mode. It checks that blocking recv and recvfrom throw and that the NotImplemented counter goes up by one, and that the DONTWAIT and nonblocking calls still return EAGAIN.
  • Debt:
    • Both MSG_DONTWAIT/MSG_WAITALL entries in docs/dev/debt/libkernel.md now say the combination throws.
    • A "Retained native socket transport" entry is added to docs/dev/debt/libkernel.md, and a matching entry to docs/dev/debt/libSceSsl.md.
  • Description and discussion: the author's reply of 2026-11-03 18:01 reports a Linux run (9/9 transport, 11/11 libSceNet, 660/660 composed). I take these as author-reported. MinGW checks were syntax-only, with no Windows run.

What I ran

Head 8957ad0b52a6400270f0129e09d2deb7f1a5503e, merged with --no-ff into main 1e658521a0a599872612bb91949311e2956b5283 (merged tree ae09f701a88db155f538355f2f14dbdb1c7f90b9). Debian 13 VM, 32 vCPU Xeon Gold 6136, GCC 14.2.0, Release, Ninja.

git diff --check 1e658521a0a599872612bb91949311e2956b5283...8957ad0b52a6400270f0129e09d2deb7f1a5503e
python3 tools/check_conventions.py --base 1e658521a0a599872612bb91949311e2956b5283
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "guest_socket_native_mode|guest_ssl_transport|guest_socket_timeouts|guest_socket_dontwait|guest_udp$|net_dontwait|guest_socket_read_write|guest_socket_transfer_progress"
# negative control for the delta: previous head's Udp.cpp
git show 35e16ad94f3ef76de75d7c28ad224efb71f8d790:core/libs/prx/libkernel/Socket/src/Udp.cpp > core/libs/prx/libkernel/Socket/src/Udp.cpp
ninja -C build -j32 -l32 guest_udp_tests
ctest --test-dir build --output-on-failure -R "guest_udp$"
git show ae09f701a88db155f538355f2f14dbdb1c7f90b9:core/libs/prx/libkernel/Socket/src/Udp.cpp > core/libs/prx/libkernel/Socket/src/Udp.cpp
ninja -C build -j32 -l32 guest_udp_tests
ctest --test-dir build -R "guest_udp$"
git status --porcelain
Check Result
git diff --check clean
check_conventions.py 0 errors, 1 warning (debt-length on the existing docs/dev/debt/libSceSsl.md:10 entry, 7821 characters, unchanged from last time)
Configure / build / libs (script) ok
Selected tests (script, 4075 run) no new failures, no timeouts. The 9 known failures (agc_driver_* denormal/division, guest_interfaces, guest_socket_options_multicast, unwrap_self_…, vector_constant_factor_tininess) also fail on main, and the guest_net_ctl skip also happens on main
Focused transport tests 20/20 passed in 3.33 s. guest_udp takes 1.53 s with the new case. guest_socket_transfer_progress is registered only on Windows, so it did not run
Negative control (previous head's Udp.cpp) guest_udp still passes, as expected on Linux (see below)
Worktree after restore git status --porcelain empty, and guest_udp passes again

Previous findings

  1. Windows blocking recvfrom into a partly unwritable buffer returned EAGAIN instead of waiting. Resolved by reading the code; not run.

    • The probe now runs inside Transfer (Udp.cpp#L1073-L1083).
    • When the peek fails, PendingFits sets error but leaves WSAGetLastError() at WSAEWOULDBLOCK. The operation returns -1, and Transfer waits in WaitTransferReady under the single receive deadline, then retries the probe.
    • The oversized case sets WSAEFAULT. Transfer does not retry it and returns -1, so ReceiveFrom maps it to EFAULT through NativeError(), which matches the old Fail(14).
    • DropDatagram still skips the drop under MSG_PEEK.
    • The new GuestUdp case is the Windows test I asked for. On Linux it only shows that the Unix path already behaved this way (see the negative control).
  2. Windows blocking stream MSG_PEEK | MSG_WAITALL returned an invented EOPNOTSUPP. Resolved.

    • The combination now throws through NotImplemented_nid_no_patch (Udp.cpp#L167-L169). The mode lock is released before the throw.
    • Both debt entries are updated.
    • The fixture checks the message text and the counter. I have not run it, because it is Windows-only.
  3. The Unix retained transfer wait cannot be cancelled. Resolved as recorded debt.

    • Both libkernel.md#L385 and libSceSsl.md#L23 now name the bare poll outside ThreadCancel::Native.
    • They also say it can wait indefinitely after guest close or cancellation, and that it is not a cancellation point.
  4. Scope: the diff includes the open prerequisites #12149 and #12682. Still open (non-blocking).

    • Both are still declared on Depends on and still open.
    • The 53-file diff against main still brings their code in under this title if this PR merges first.

Negative control

The delta's production change is all inside #ifdef _WIN32. I restored only Udp.cpp from the previous head 35e16ad9 and rebuilt guest_udp_tests. guest_udp, including the new CheckDelayedPartialReceive, still passed. This is expected: on Linux the receive was already a blocking native call under ThreadCancel::Native. So the new test is useful regression coverage on Linux, but only a Windows run can show it catches the old bug. The receive-peek-waitall fixture is not registered on Linux. After I restored the merged file and rebuilt, guest_udp passed again and the worktree was clean.

New findings

Blocking

None.

Non-blocking

  1. The new debt entries are separated from their lists by a blank line.
    • Where: libkernel.md#L384-L385 and libSceSsl.md#L22-L23.
    • Effect: the blank line starts a new list in rendered Markdown, unlike the entries around it.
    • Fix: remove the blank lines.
    • The two entries also describe the same gap twice. One entry in libkernel.md, with a short pointer from libSceSsl, would be enough, though the duplication does no harm.

Not verified

  • Windows runtime. The probe-inside-Transfer change and the NotImplemented throw are Windows-only and were not run here. The author reports only syntax-only MinGW checks for this head, so so far no one has run them on Windows. This is the reason for comment rather than approve.
  • Windows 22621. The author's open intermittent Windows 22621 guest_io_context_sigjump hang is not addressed here.
  • macOS. The macOS runtime path was not run.
  • Author-reported runs. The author's 9/9, 11/11 and 660/660 Linux runs were not reproduced beyond the focused set above.
  • Validation layer. The script skipped the comparison because no AGC driver, shader recompiler or VideoOut file changed. That skip is correct.

To get this to a good state

  1. Get a Windows CI run at this head (a collaborator dispatches it), including guest_udp and guest_socket_transfer_progress. It should confirm that the delayed partial-buffer receive blocks and then completes, and that blocking MSG_PEEK | MSG_WAITALL throws.
  2. Optionally, remove the blank lines before the two new debt entries.
  3. Ideally, land #12149 and #12682 first, so that this PR's diff against main is only the transport change.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5757375706 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12688#pullrequestreview-5757375706). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T18:18:37Z. **Review:** COMMENTED --- # Re-checked — comments Commits `085458a70c` and `8957ad0b52` change three things. The Windows partial-buffer `recvfrom` probe now runs inside the transport wait, and blocking stream `MSG_PEEK | MSG_WAITALL` now throws. The Unix retained-wait limitation is now written into both debt files. Reading the code, all three points from my last review are fixed. But the two code fixes only run on Windows. Neither here nor in the author's run (syntax-only MinGW checks) have they been executed. ## What changed since my last review - `core/libs/prx/libkernel/Socket/src/Udp.cpp`: - `ReceiveFrom` no longer calls `PendingFits` before the receive. It passes `partialBuffer = limit < length` to `ReceiveNative`. - On Windows, `ReceiveNative` runs `PendingFits`/`DropDatagram` inside the `Transfer` operation, at `offset == 0`. - `Transfer` calls `NotImplemented_nid_no_patch("recv: MSG_PEEK | MSG_WAITALL on a blocking stream socket")` instead of setting `WSAEOPNOTSUPP`. - `core/libs/tests/GuestUdp.cpp`: new `CheckDelayedPartialReceive`. It covers delayed fitting (3-byte) and oversized (8-byte) datagrams into 4 writable bytes followed by a guard page: - blocking, and with `SO_RCVTIMEO`; - plain and `MSG_PEEK`; - an idle timeout, and immediate `EAGAIN` for `MSG_DONTWAIT` and for a nonblocking socket. - `core/libs/tests/GuestSocketTransferProgress.cpp` (Windows-only fixture): new `receive-peek-waitall` mode. It checks that blocking `recv` and `recvfrom` throw and that the NotImplemented counter goes up by one, and that the `DONTWAIT` and nonblocking calls still return `EAGAIN`. - Debt: - Both `MSG_DONTWAIT`/`MSG_WAITALL` entries in `docs/dev/debt/libkernel.md` now say the combination throws. - A "Retained native socket transport" entry is added to `docs/dev/debt/libkernel.md`, and a matching entry to `docs/dev/debt/libSceSsl.md`. - Description and discussion: the author's reply of 2026-11-03 18:01 reports a Linux run (9/9 transport, 11/11 libSceNet, 660/660 composed). I take these as author-reported. MinGW checks were syntax-only, with no Windows run. ## What I ran Head `8957ad0b52a6400270f0129e09d2deb7f1a5503e`, merged with `--no-ff` into `main` `1e658521a0a599872612bb91949311e2956b5283` (merged tree `ae09f701a88db155f538355f2f14dbdb1c7f90b9`). Debian 13 VM, 32 vCPU Xeon Gold 6136, GCC 14.2.0, Release, Ninja. ``` git diff --check 1e658521a0a599872612bb91949311e2956b5283...8957ad0b52a6400270f0129e09d2deb7f1a5503e python3 tools/check_conventions.py --base 1e658521a0a599872612bb91949311e2956b5283 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "guest_socket_native_mode|guest_ssl_transport|guest_socket_timeouts|guest_socket_dontwait|guest_udp$|net_dontwait|guest_socket_read_write|guest_socket_transfer_progress" # negative control for the delta: previous head's Udp.cpp git show 35e16ad94f3ef76de75d7c28ad224efb71f8d790:core/libs/prx/libkernel/Socket/src/Udp.cpp > core/libs/prx/libkernel/Socket/src/Udp.cpp ninja -C build -j32 -l32 guest_udp_tests ctest --test-dir build --output-on-failure -R "guest_udp$" git show ae09f701a88db155f538355f2f14dbdb1c7f90b9:core/libs/prx/libkernel/Socket/src/Udp.cpp > core/libs/prx/libkernel/Socket/src/Udp.cpp ninja -C build -j32 -l32 guest_udp_tests ctest --test-dir build -R "guest_udp$" git status --porcelain ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | 0 errors, 1 warning (`debt-length` on the existing `docs/dev/debt/libSceSsl.md:10` entry, 7821 characters, unchanged from last time) | | Configure / build / `libs` (script) | ok | | Selected tests (script, 4075 run) | no new failures, no timeouts. The 9 known failures (`agc_driver_*` denormal/division, `guest_interfaces`, `guest_socket_options_multicast`, `unwrap_self_…`, `vector_constant_factor_tininess`) also fail on `main`, and the `guest_net_ctl` skip also happens on `main` | | Focused transport tests | 20/20 passed in 3.33 s. `guest_udp` takes 1.53 s with the new case. `guest_socket_transfer_progress` is registered only on Windows, so it did not run | | Negative control (previous head's `Udp.cpp`) | `guest_udp` still passes, as expected on Linux (see below) | | Worktree after restore | `git status --porcelain` empty, and `guest_udp` passes again | ## Previous findings 1. **Windows blocking `recvfrom` into a partly unwritable buffer returned `EAGAIN` instead of waiting.** Resolved by reading the code; not run. - The probe now runs inside `Transfer` ([Udp.cpp#L1073-L1083](https://github.com/boykopovar/AnyPS5/blob/8957ad0b52a6400270f0129e09d2deb7f1a5503e/core/libs/prx/libkernel/Socket/src/Udp.cpp#L1073-L1083)). - When the peek fails, `PendingFits` sets `error` but leaves `WSAGetLastError()` at `WSAEWOULDBLOCK`. The operation returns -1, and `Transfer` waits in `WaitTransferReady` under the single receive deadline, then retries the probe. - The oversized case sets `WSAEFAULT`. `Transfer` does not retry it and returns -1, so `ReceiveFrom` maps it to `EFAULT` through `NativeError()`, which matches the old `Fail(14)`. - `DropDatagram` still skips the drop under `MSG_PEEK`. - The new GuestUdp case is the Windows test I asked for. On Linux it only shows that the Unix path already behaved this way (see the negative control). 2. **Windows blocking stream `MSG_PEEK | MSG_WAITALL` returned an invented `EOPNOTSUPP`.** Resolved. - The combination now throws through `NotImplemented_nid_no_patch` ([Udp.cpp#L167-L169](https://github.com/boykopovar/AnyPS5/blob/8957ad0b52a6400270f0129e09d2deb7f1a5503e/core/libs/prx/libkernel/Socket/src/Udp.cpp#L167-L169)). The mode lock is released before the throw. - Both debt entries are updated. - The fixture checks the message text and the counter. I have not run it, because it is Windows-only. 3. **The Unix retained transfer wait cannot be cancelled.** Resolved as recorded debt. - Both [libkernel.md#L385](https://github.com/boykopovar/AnyPS5/blob/8957ad0b52a6400270f0129e09d2deb7f1a5503e/docs/dev/debt/libkernel.md#L385) and [libSceSsl.md#L23](https://github.com/boykopovar/AnyPS5/blob/8957ad0b52a6400270f0129e09d2deb7f1a5503e/docs/dev/debt/libSceSsl.md#L23) now name the bare `poll` outside `ThreadCancel::Native`. - They also say it can wait indefinitely after guest close or cancellation, and that it is not a cancellation point. 4. **Scope: the diff includes the open prerequisites #12149 and #12682.** Still open (non-blocking). - Both are still declared on `Depends on` and still open. - The 53-file diff against `main` still brings their code in under this title if this PR merges first. ## Negative control The delta's production change is all inside `#ifdef _WIN32`. I restored only `Udp.cpp` from the previous head `35e16ad9` and rebuilt `guest_udp_tests`. `guest_udp`, including the new `CheckDelayedPartialReceive`, still passed. This is expected: on Linux the receive was already a blocking native call under `ThreadCancel::Native`. So the new test is useful regression coverage on Linux, but only a Windows run can show it catches the old bug. The `receive-peek-waitall` fixture is not registered on Linux. After I restored the merged file and rebuilt, `guest_udp` passed again and the worktree was clean. ## New findings ### Blocking None. ### Non-blocking 1. **The new debt entries are separated from their lists by a blank line.** - Where: [libkernel.md#L384-L385](https://github.com/boykopovar/AnyPS5/blob/8957ad0b52a6400270f0129e09d2deb7f1a5503e/docs/dev/debt/libkernel.md#L384-L385) and [libSceSsl.md#L22-L23](https://github.com/boykopovar/AnyPS5/blob/8957ad0b52a6400270f0129e09d2deb7f1a5503e/docs/dev/debt/libSceSsl.md#L22-L23). - Effect: the blank line starts a new list in rendered Markdown, unlike the entries around it. - Fix: remove the blank lines. - The two entries also describe the same gap twice. One entry in `libkernel.md`, with a short pointer from libSceSsl, would be enough, though the duplication does no harm. ## Not verified - **Windows runtime.** The probe-inside-`Transfer` change and the NotImplemented throw are Windows-only and were not run here. The author reports only syntax-only MinGW checks for this head, so so far no one has run them on Windows. This is the reason for `comment` rather than `approve`. - **Windows 22621.** The author's open intermittent Windows 22621 `guest_io_context_sigjump` hang is not addressed here. - **macOS.** The macOS runtime path was not run. - **Author-reported runs.** The author's 9/9, 11/11 and 660/660 Linux runs were not reproduced beyond the focused set above. - **Validation layer.** The script skipped the comparison because no AGC driver, shader recompiler or VideoOut file changed. That skip is correct. ## To get this to a good state 1. Get a Windows CI run at this head (a collaborator dispatches it), including `guest_udp` and `guest_socket_transfer_progress`. It should confirm that the delayed partial-buffer receive blocks and then completes, and that blocking `MSG_PEEK | MSG_WAITALL` throws. 2. Optionally, remove the blank lines before the two new debt entries. 3. Ideally, land #12149 and #12682 first, so that this PR's diff against `main` is only the transport change. <!-- anyps5-bots job=3500 head=8957ad0b52a6400270f0129e09d2deb7f1a5503e -->
XairRrR commented 2026-11-03 18:56:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T18:56:19Z.

Review: COMMENTED


Re-checked — comments

Two commits since my last review: 70120f1b86 changes the Windows-only PeekWithWaitAll case in GuestSocketDontWait.cpp to expect the NotImplemented_nid_no_patch throw instead of EOPNOTSUPP, and 4f897946d2 removes the blank lines and the duplicated text in the retained-wait debt entries. No production source changed. The test fix looks right in the code, but it only runs on Windows and has not run there yet.

What changed since my last review

  • core/libs/tests/GuestSocketDontWait.cpp has a new UnsupportedPeekWaitAll (L231-L242). Its call site at L253-L255 is inside #ifdef _WIN32.
    • It calls recv_nid_postfix(..., WaitAll | 2) on the test thread instead of on a Receive worker thread.
    • It catches std::runtime_error and checks that the message contains MSG_PEEK | MSG_WAITALL on a blocking stream socket. It also checks that NotImplementedCalls_nid_no_patch() went up by exactly one, and that the buffer is unchanged.
    • The pair.CheckReadable(true) and the DontWait consume that follow are kept.
    • This matches the production throw at Udp.cpp:167-169. NotImplemented_nid_no_patch throws std::runtime_error(funcName + " not implemented") and increments the counter (core/libs/prx/libc/src/General.cpp:1020-1027), so the substring and counter checks fit.
    • The check now runs on the test thread, so a throw cannot reach a std::thread and call std::terminate. According to the author, that is how the parent-head Windows job failed.
  • docs/dev/debt/libkernel.md no longer has the blank line before the "Retained native socket transport" entry (L384).
  • docs/dev/debt/libSceSsl.md drops the blank line and shortens its entry to a pointer to the libkernel entry (L22).
  • Discussion: the author reports Windows job 126104433602 at the parent head 8957ad0b52, merged onto 1e65852. I can only read the author's summary of it:
    • 2,389 passed / 981 skipped / 1 failed.
    • guest_udp passes, including the delayed partial-buffer cases.
    • guest_socket_transfer_progress passes, including the throw and counter checks.
    • The one failure is the outdated guest_socket_dontwait expectation that this push fixes.
    • The author also reports a stubbed harness check of the new assertion. It is not a native run.

What I ran

Head 70120f1b8604f9a5f4f96cb18fbf299204acdeec, merged with --no-ff into main 1e658521a0a599872612bb91949311e2956b5283 (merged tree 4e58136a6e6d75a99d8feb1427b9729989753892). Debian 13 VM, GCC 14.2.0, Release, Ninja.

git diff 8957ad0b52a6400270f0129e09d2deb7f1a5503e 70120f1b8604f9a5f4f96cb18fbf299204acdeec
git diff --check 1e658521a0a599872612bb91949311e2956b5283...70120f1b8604f9a5f4f96cb18fbf299204acdeec
python3 tools/check_conventions.py --base 1e658521a0a599872612bb91949311e2956b5283
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "guest_socket_dontwait|guest_udp$|guest_socket_transfer_progress|guest_ssl_transport"
git status --porcelain
Check Result
git diff --check clean
check_conventions.py 0 errors. 1 warning (debt-length on the existing libSceSsl.md:10 entry, 7821 characters), unchanged since last time
Configure / build / libs (script) ok
Selected tests (script, 4075 run) 0 new failures, 0 timeouts. The 9 known failures also fail on main. The guest_net_ctl skip also happens on main. agc_driver_alpha_to_coverage_sample_mask_export passed on rerun
Focused tests 4/4 passed (guest_socket_dontwait 1.64 s, guest_udp 1.53 s, guest_ssl_transport_kernel/_net 1.45 s each). guest_socket_transfer_progress is registered only on Windows
Worktree git status --porcelain empty

Negative control

None was possible here. The only test change is inside #ifdef _WIN32, and the production code it checks is Windows-only too. On Linux, guest_socket_dontwait does not build or run the changed branch, so restoring main cannot make it fail here. The author reports a stubbed harness in which the old returned-error behaviour makes the new assertion fail. I take that as author-reported.

Previous findings

  1. Windows partial-buffer recvfrom probe outside the transport wait. Resolved, as before.
    • The author reports that guest_udp passed in Windows job 126104433602 at the parent head. Production code has not changed since.
    • I have not seen the job log.
  2. Invented EOPNOTSUPP for blocking stream MSG_PEEK | MSG_WAITALL. Resolved.
    • guest_socket_transfer_progress passed on Windows (author-reported).
    • The outdated guest_socket_dontwait expectation is now updated to the throw contract.
  3. Unix retained transfer wait cannot be cancelled. Resolved as recorded debt.
    • The canonical entry is in libkernel (L384), with a pointer from libSceSsl.
  4. Scope: the diff includes the open prerequisites #12149 and #12682 (non-blocking). Still open.
    • Both are still declared on Depends on.
  5. Blank lines before the new debt entries, and the duplicated text (non-blocking). Resolved in 4f897946d2.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • Windows run at this head. The fixed PeekWithWaitAll branch has not run natively. The parent-head job did not run it in its fixed form. This is why the verdict is comment and not approve.
  • The parent-head Windows job. I can only read the author's summary of job 126104433602. I have not seen its log.
  • The throw on Windows. I could not check here that throwing through recv_nid_postfix on Windows leaves descriptor admission and ownership consistent. The CheckReadable and consume after the call would show a problem in a Windows run.
  • Windows 22621 guest_io_context_sigjump hang (author-reported, still unresolved). Not addressed.
  • macOS. Not run.
  • Validation layer. Skipped by the script: no AGC driver, shader recompiler or VideoOut file changed.

To get this to a good state

  1. Get a Windows CI run at 70120f1b86 (a collaborator dispatches it). guest_socket_dontwait, guest_udp and guest_socket_transfer_progress should all pass.
  2. Ideally, land #12149 and #12682 first, so the diff against main is only the transport change.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5757856939 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12688#pullrequestreview-5757856939). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T18:56:19Z. **Review:** COMMENTED --- # Re-checked — comments Two commits since my last review: `70120f1b86` changes the Windows-only `PeekWithWaitAll` case in `GuestSocketDontWait.cpp` to expect the `NotImplemented_nid_no_patch` throw instead of `EOPNOTSUPP`, and `4f897946d2` removes the blank lines and the duplicated text in the retained-wait debt entries. No production source changed. The test fix looks right in the code, but it only runs on Windows and has not run there yet. ## What changed since my last review - `core/libs/tests/GuestSocketDontWait.cpp` has a new `UnsupportedPeekWaitAll` ([L231-L242](https://github.com/boykopovar/AnyPS5/blob/70120f1b8604f9a5f4f96cb18fbf299204acdeec/core/libs/tests/GuestSocketDontWait.cpp#L231-L242)). Its call site at [L253-L255](https://github.com/boykopovar/AnyPS5/blob/70120f1b8604f9a5f4f96cb18fbf299204acdeec/core/libs/tests/GuestSocketDontWait.cpp#L253-L255) is inside `#ifdef _WIN32`. - It calls `recv_nid_postfix(..., WaitAll | 2)` on the test thread instead of on a `Receive` worker thread. - It catches `std::runtime_error` and checks that the message contains `MSG_PEEK | MSG_WAITALL on a blocking stream socket`. It also checks that `NotImplementedCalls_nid_no_patch()` went up by exactly one, and that the buffer is unchanged. - The `pair.CheckReadable(true)` and the `DontWait` consume that follow are kept. - This matches the production throw at `Udp.cpp:167-169`. `NotImplemented_nid_no_patch` throws `std::runtime_error(funcName + " not implemented")` and increments the counter (`core/libs/prx/libc/src/General.cpp:1020-1027`), so the substring and counter checks fit. - The check now runs on the test thread, so a throw cannot reach a `std::thread` and call `std::terminate`. According to the author, that is how the parent-head Windows job failed. - `docs/dev/debt/libkernel.md` no longer has the blank line before the "Retained native socket transport" entry ([L384](https://github.com/boykopovar/AnyPS5/blob/70120f1b8604f9a5f4f96cb18fbf299204acdeec/docs/dev/debt/libkernel.md#L384)). - `docs/dev/debt/libSceSsl.md` drops the blank line and shortens its entry to a pointer to the libkernel entry ([L22](https://github.com/boykopovar/AnyPS5/blob/70120f1b8604f9a5f4f96cb18fbf299204acdeec/docs/dev/debt/libSceSsl.md#L22)). - Discussion: the author reports Windows job 126104433602 at the parent head `8957ad0b52`, merged onto `1e65852`. I can only read the author's summary of it: - 2,389 passed / 981 skipped / 1 failed. - `guest_udp` passes, including the delayed partial-buffer cases. - `guest_socket_transfer_progress` passes, including the throw and counter checks. - The one failure is the outdated `guest_socket_dontwait` expectation that this push fixes. - The author also reports a stubbed harness check of the new assertion. It is not a native run. ## What I ran Head `70120f1b8604f9a5f4f96cb18fbf299204acdeec`, merged with `--no-ff` into `main` `1e658521a0a599872612bb91949311e2956b5283` (merged tree `4e58136a6e6d75a99d8feb1427b9729989753892`). Debian 13 VM, GCC 14.2.0, Release, Ninja. ``` git diff 8957ad0b52a6400270f0129e09d2deb7f1a5503e 70120f1b8604f9a5f4f96cb18fbf299204acdeec git diff --check 1e658521a0a599872612bb91949311e2956b5283...70120f1b8604f9a5f4f96cb18fbf299204acdeec python3 tools/check_conventions.py --base 1e658521a0a599872612bb91949311e2956b5283 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "guest_socket_dontwait|guest_udp$|guest_socket_transfer_progress|guest_ssl_transport" git status --porcelain ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | 0 errors. 1 warning (`debt-length` on the existing `libSceSsl.md:10` entry, 7821 characters), unchanged since last time | | Configure / build / `libs` (script) | ok | | Selected tests (script, 4075 run) | 0 new failures, 0 timeouts. The 9 known failures also fail on `main`. The `guest_net_ctl` skip also happens on `main`. `agc_driver_alpha_to_coverage_sample_mask_export` passed on rerun | | Focused tests | 4/4 passed (`guest_socket_dontwait` 1.64 s, `guest_udp` 1.53 s, `guest_ssl_transport_kernel`/`_net` 1.45 s each). `guest_socket_transfer_progress` is registered only on Windows | | Worktree | `git status --porcelain` empty | ## Negative control None was possible here. The only test change is inside `#ifdef _WIN32`, and the production code it checks is Windows-only too. On Linux, `guest_socket_dontwait` does not build or run the changed branch, so restoring `main` cannot make it fail here. The author reports a stubbed harness in which the old returned-error behaviour makes the new assertion fail. I take that as author-reported. ## Previous findings 1. Windows partial-buffer `recvfrom` probe outside the transport wait. **Resolved**, as before. - The author reports that `guest_udp` passed in Windows job 126104433602 at the parent head. Production code has not changed since. - I have not seen the job log. 2. Invented `EOPNOTSUPP` for blocking stream `MSG_PEEK | MSG_WAITALL`. **Resolved.** - `guest_socket_transfer_progress` passed on Windows (author-reported). - The outdated `guest_socket_dontwait` expectation is now updated to the throw contract. 3. Unix retained transfer wait cannot be cancelled. **Resolved** as recorded debt. - The canonical entry is in libkernel ([L384](https://github.com/boykopovar/AnyPS5/blob/70120f1b8604f9a5f4f96cb18fbf299204acdeec/docs/dev/debt/libkernel.md#L384)), with a pointer from libSceSsl. 4. Scope: the diff includes the open prerequisites #12149 and #12682 (non-blocking). **Still open.** - Both are still declared on `Depends on`. 5. Blank lines before the new debt entries, and the duplicated text (non-blocking). **Resolved** in `4f897946d2`. ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - **Windows run at this head.** The fixed `PeekWithWaitAll` branch has not run natively. The parent-head job did not run it in its fixed form. This is why the verdict is `comment` and not `approve`. - **The parent-head Windows job.** I can only read the author's summary of job 126104433602. I have not seen its log. - **The throw on Windows.** I could not check here that throwing through `recv_nid_postfix` on Windows leaves descriptor admission and ownership consistent. The `CheckReadable` and consume after the call would show a problem in a Windows run. - **Windows 22621 `guest_io_context_sigjump` hang** (author-reported, still unresolved). Not addressed. - **macOS.** Not run. - **Validation layer.** Skipped by the script: no AGC driver, shader recompiler or VideoOut file changed. ## To get this to a good state 1. Get a Windows CI run at `70120f1b86` (a collaborator dispatches it). `guest_socket_dontwait`, `guest_udp` and `guest_socket_transfer_progress` should all pass. 2. Ideally, land #12149 and #12682 first, so the diff against `main` is only the transport change. <!-- anyps5-bots job=3532 head=70120f1b8604f9a5f4f96cb18fbf299204acdeec -->
XairRrR commented 2026-11-03 20:06:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T20:06:27Z.

Review: APPROVED


Re-checked — approved

The head is unchanged at 70120f1b86. Since my last review the author has reported a native Windows CI run of this exact head. That run was the only missing item, and the PR still merges, builds and passes its focused tests on the newer main 086c0686.

What changed since my last review

  • No new commits. delta.patch shows every commit unchanged.
  • New Windows evidence (author-reported, 2026-11-03 19:49 UTC comment). Windows CI job 126135445281 ran head 70120f1b8604f9a5f4f96cb18fbf299204acdeec merged onto main 1e658521a0, on Server 2025 with GNU 15.2, Release:
    • 2,390 passed, 981 skipped, 0 failed.
    • guest_socket_dontwait passed in 5.88 s, so the corrected PeekWithWaitAll throw/counter branch has now run.
    • guest_udp passed in 1.72 s.
    • guest_socket_transfer_progress passed in 2.01 s.
    • I cannot open the job log from here, so I accept these results as author-reported.
  • Other new comments. A contributor AMD run at this head reports 0 new failures. The author also posted an overlap audit and notes that a read-only merge-tree with main 086c0686 is clean. Neither touches code.
  • main moved from 1e65852 to 086c0686. The script re-merged and retested against the new main.

What I ran

Head 70120f1b8604f9a5f4f96cb18fbf299204acdeec, merged with --no-ff into main 086c0686c8adff3ee648fdbe34e0b0b647e1d511 (merged tree 6fe766c8e5d67e5896fee0c11a6759c4f75b7468). Debian 13 VM, GCC 14.2.0, Release, Ninja.

git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...70120f1b8604f9a5f4f96cb18fbf299204acdeec
python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "guest_socket_dontwait|guest_udp$|guest_socket_timeouts|guest_socket_native_mode|guest_ssl_transport|guest_io_read_cancel|guest_io_descriptor_access"
git status --porcelain
Check Result
git diff --check clean
check_conventions.py 0 errors. 1 warning (debt-length on the existing libSceSsl.md:10 entry, 7821 characters), unchanged
Configure / build / libs (script) ok
Selected tests (script, 4095 run) 0 new failures, 0 timeouts. The 9 known failures also fail on main. The guest_net_ctl skip also happens on main
Focused tests 9/9 passed in 3.72 s, including guest_socket_dontwait, guest_udp, guest_socket_timeouts, the 3 native-mode cases, guest_ssl_transport_kernel/_net and guest_io_descriptor_access_cancel
Worktree git status --porcelain empty

Negative control

None was possible here; the reason is the same as last time. The changed test branch and the production path it checks are both inside #ifdef _WIN32. The author reports a stubbed harness in which restoring the old returned-error behaviour makes the assertion fail. I take that as author-reported.

Previous findings

  1. Windows partial-buffer recvfrom probe outside the transport wait: Resolved. guest_udp passes at the exact head on Windows (author-reported) and on Linux here.
  2. Invented EOPNOTSUPP for blocking stream MSG_PEEK | MSG_WAITALL: Resolved. The throw contract is in place. guest_socket_transfer_progress and the corrected guest_socket_dontwait pass natively on Windows at this head (author-reported).
  3. Unix retained transfer wait cannot be cancelled: Resolved as recorded debt. The canonical entry is in docs/dev/debt/libkernel.md, with a pointer from libSceSsl.md.
  4. The diff includes the open prerequisites #12149 and #12682 (non-blocking): Still open. Both are still declared on Depends on, and they should merge first.
  5. Blank lines and duplicated text in the debt entries (non-blocking): Resolved in 4f897946d2, unchanged since.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • The Windows job log. I cannot open job 126135445281. Its results above are the author's report.
  • Windows on the newer main. That job used main 1e65852, not 086c0686. Only Linux was tested here against 086c0686.
  • Windows 22621 guest_io_context_sigjump hang. The author reports it as still unresolved; it concerns the accept layer of the stack.
  • macOS runtime. Not run.
  • Validation layer. Skipped by the script: no AGC driver, shader recompiler or VideoOut file changed.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5758759955 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12688#pullrequestreview-5758759955). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T20:06:27Z. **Review:** APPROVED --- # Re-checked — approved The head is unchanged at `70120f1b86`. Since my last review the author has reported a native Windows CI run of this exact head. That run was the only missing item, and the PR still merges, builds and passes its focused tests on the newer `main` `086c0686`. ## What changed since my last review - **No new commits.** delta.patch shows every commit unchanged. - **New Windows evidence (author-reported, 2026-11-03 19:49 UTC comment).** Windows CI job 126135445281 ran head `70120f1b8604f9a5f4f96cb18fbf299204acdeec` merged onto `main` `1e658521a0`, on Server 2025 with GNU 15.2, Release: - 2,390 passed, 981 skipped, 0 failed. - `guest_socket_dontwait` passed in 5.88 s, so the corrected `PeekWithWaitAll` throw/counter branch has now run. - `guest_udp` passed in 1.72 s. - `guest_socket_transfer_progress` passed in 2.01 s. - I cannot open the job log from here, so I accept these results as author-reported. - **Other new comments.** A contributor AMD run at this head reports 0 new failures. The author also posted an overlap audit and notes that a read-only merge-tree with `main` `086c0686` is clean. Neither touches code. - **`main` moved** from `1e65852` to `086c0686`. The script re-merged and retested against the new `main`. ## What I ran Head `70120f1b8604f9a5f4f96cb18fbf299204acdeec`, merged with `--no-ff` into `main` `086c0686c8adff3ee648fdbe34e0b0b647e1d511` (merged tree `6fe766c8e5d67e5896fee0c11a6759c4f75b7468`). Debian 13 VM, GCC 14.2.0, Release, Ninja. ``` git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...70120f1b8604f9a5f4f96cb18fbf299204acdeec python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "guest_socket_dontwait|guest_udp$|guest_socket_timeouts|guest_socket_native_mode|guest_ssl_transport|guest_io_read_cancel|guest_io_descriptor_access" git status --porcelain ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | 0 errors. 1 warning (`debt-length` on the existing `libSceSsl.md:10` entry, 7821 characters), unchanged | | Configure / build / `libs` (script) | ok | | Selected tests (script, 4095 run) | 0 new failures, 0 timeouts. The 9 known failures also fail on `main`. The `guest_net_ctl` skip also happens on `main` | | Focused tests | 9/9 passed in 3.72 s, including `guest_socket_dontwait`, `guest_udp`, `guest_socket_timeouts`, the 3 native-mode cases, `guest_ssl_transport_kernel`/`_net` and `guest_io_descriptor_access_cancel` | | Worktree | `git status --porcelain` empty | ## Negative control None was possible here; the reason is the same as last time. The changed test branch and the production path it checks are both inside `#ifdef _WIN32`. The author reports a stubbed harness in which restoring the old returned-error behaviour makes the assertion fail. I take that as author-reported. ## Previous findings 1. Windows partial-buffer `recvfrom` probe outside the transport wait: **Resolved.** `guest_udp` passes at the exact head on Windows (author-reported) and on Linux here. 2. Invented `EOPNOTSUPP` for blocking stream `MSG_PEEK | MSG_WAITALL`: **Resolved.** The throw contract is in place. `guest_socket_transfer_progress` and the corrected `guest_socket_dontwait` pass natively on Windows at this head (author-reported). 3. Unix retained transfer wait cannot be cancelled: **Resolved** as recorded debt. The canonical entry is in `docs/dev/debt/libkernel.md`, with a pointer from `libSceSsl.md`. 4. The diff includes the open prerequisites #12149 and #12682 (non-blocking): **Still open.** Both are still declared on `Depends on`, and they should merge first. 5. Blank lines and duplicated text in the debt entries (non-blocking): **Resolved** in `4f897946d2`, unchanged since. ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - **The Windows job log.** I cannot open job 126135445281. Its results above are the author's report. - **Windows on the newer `main`.** That job used `main` `1e65852`, not `086c0686`. Only Linux was tested here against `086c0686`. - **Windows 22621 `guest_io_context_sigjump` hang.** The author reports it as still unresolved; it concerns the accept layer of the stack. - **macOS runtime.** Not run. - **Validation layer.** Skipped by the script: no AGC driver, shader recompiler or VideoOut file changed. <!-- anyps5-bots job=3557 head=70120f1b8604f9a5f4f96cb18fbf299204acdeec -->
MarcZX10 commented 2026-11-20 08:52:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T08:52:29Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this change; the points below are optional.

What I ran

Reviewed head 8f34999f2fad40fcf704765c3dedcafe5d157fa7 from the prepared patch and targeted reader output. I ran no commands or tests. The reported Windows and Ubuntu runs are author-supplied.

Results

Check Result Note
Patch and targeted source review passed Inspected descriptor, I/O signal, jump-buffer, and socket paths
Builds and runtime tests not run Results in the description were not independently verified

Findings

Blocking

None in the inspected code.

Non-blocking

  • The scope is large, covering descriptor synchronization, cancellation, context restoration, and socket transport. Keep the reported platform-specific test evidence with the PR so maintainers can assess the separate Windows, Linux, and unresolved platform limits.

Not verified

I read description.md, commits.md, diff.patch, manifest.json, and targeted source ranges from DescriptorAccess.cpp, IoSignals.cpp, NativeIo.cpp, JumpBuffer.cpp, JumpBuffer.hpp, DescriptorControl.cpp, Stdio.cpp, and Udp.cpp. I did not read every file marked included in the manifest. files.json was not available through the reader, so excluded-file details are not verified. No build, test, CI job, or console behavior was run or independently confirmed.

To get this to a good state

Nothing is required. Optional: preserve the platform-specific test evidence and limitations in the PR description.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5989873024 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12688#pullrequestreview-5989873024). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T08:52:29Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this change; the points below are optional. ## What I ran Reviewed head `8f34999f2fad40fcf704765c3dedcafe5d157fa7` from the prepared patch and targeted reader output. I ran no commands or tests. The reported Windows and Ubuntu runs are author-supplied. ## Results | Check | Result | Note | |---|---|---| | Patch and targeted source review | passed | Inspected descriptor, I/O signal, jump-buffer, and socket paths | | Builds and runtime tests | not run | Results in the description were not independently verified | ## Findings ### Blocking None in the inspected code. ### Non-blocking - The scope is large, covering descriptor synchronization, cancellation, context restoration, and socket transport. Keep the reported platform-specific test evidence with the PR so maintainers can assess the separate Windows, Linux, and unresolved platform limits. ## Not verified I read `description.md`, `commits.md`, `diff.patch`, `manifest.json`, and targeted source ranges from `DescriptorAccess.cpp`, `IoSignals.cpp`, `NativeIo.cpp`, `JumpBuffer.cpp`, `JumpBuffer.hpp`, `DescriptorControl.cpp`, `Stdio.cpp`, and `Udp.cpp`. I did not read every file marked included in the manifest. `files.json` was not available through the reader, so excluded-file details are not verified. No build, test, CI job, or console behavior was run or independently confirmed. ## To get this to a good state Nothing is required. Optional: preserve the platform-specific test evidence and limitations in the PR description.
MarcZX10 commented 2026-11-20 21:29:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T21:29:31Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing in the inspected code establishes a blocking defect; I could not justify a formal approval because not every reviewed file was read.

What I ran

Reviewed head c5c5917dcb067b566811d8692d86cd0eae59f12c. No commands or tests were run. The author reports focused Windows and Linux CTest runs in description.md; those results were not independently verified here.

Read the prepared description, commit list, manifest, and diff, plus the full text of DescriptorAccess.cpp and DescriptorAccess.hpp, and targeted ranges in IoSignals.cpp, NativeIo.cpp, and Udp.cpp. The review folder did not expose files.json; its changed-file listing marks every listed changed file included. docs/dev/debt/changes/posix-socket-blocking-transport.md was excluded by rule.

Results

Check Result Note
Source inspection not run Partial inspection only
Tests not run Author-reported results only
Build not run No local build

Findings

Blocking

None identified in the inspected code.

Non-blocking

None.

Not verified

The remaining changed files were not read, so their behavior and the complete change are not verified. No tests or builds were run. macOS, console/title behavior, and exact-head CI were not independently confirmed; the description also identifies these as unverified or separate gates.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5999662527 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12688#pullrequestreview-5999662527). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T21:29:31Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing in the inspected code establishes a blocking defect; I could not justify a formal approval because not every reviewed file was read. ## What I ran Reviewed head `c5c5917dcb067b566811d8692d86cd0eae59f12c`. No commands or tests were run. The author reports focused Windows and Linux CTest runs in `description.md`; those results were not independently verified here. Read the prepared description, commit list, manifest, and diff, plus the full text of `DescriptorAccess.cpp` and `DescriptorAccess.hpp`, and targeted ranges in `IoSignals.cpp`, `NativeIo.cpp`, and `Udp.cpp`. The review folder did not expose `files.json`; its changed-file listing marks every listed changed file included. `docs/dev/debt/changes/posix-socket-blocking-transport.md` was excluded by rule. ## Results | Check | Result | Note | |---|---|---| | Source inspection | not run | Partial inspection only | | Tests | not run | Author-reported results only | | Build | not run | No local build | ## Findings ### Blocking None identified in the inspected code. ### Non-blocking None. ## Not verified The remaining changed files were not read, so their behavior and the complete change are not verified. No tests or builds were run. macOS, console/title behavior, and exact-head CI were not independently confirmed; the description also identifies these as unverified or separate gates. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-20 23:15:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T23:15:02Z.

Review: COMMENTED


Reviewed — comments

The review is incomplete, so a formal approval or change request is not justified; no blocking defect was verified.

What I ran

No commands or tests were run. I read the prepared description, commits, review README, manifest, and diff, plus DescriptorAccess.hpp, DescriptorAccess.cpp, IoSignals.cpp, NativeIo.cpp, DescriptorControl.cpp, and the opening of Udp.cpp at the pinned head 804d854d2bdacb49116521eb6a7c0cba5e45c1d7.

Results

Check Result Note
Tests not run Review only
Changed code review not run Not all changed lines were read

Findings

Blocking

None verified in the code inspected.

Non-blocking

None.

Not verified

The change spans 61 changed files listed in the review bundle. I did not read every changed line or inspect all touched code paths and tests, so the review does not establish that the full change is sound. The review bundle’s files.json was not available; excluded files were therefore not verified. No runtime, build, or CI checks were performed.

To get this to a good state

Complete the review of the remaining changed lines and relevant callers and tests, then run the appropriate checks on this head before making a formal decision.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6000633709 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12688#pullrequestreview-6000633709). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T23:15:02Z. **Review:** COMMENTED --- # Reviewed — comments The review is incomplete, so a formal approval or change request is not justified; no blocking defect was verified. ## What I ran No commands or tests were run. I read the prepared description, commits, review README, manifest, and diff, plus `DescriptorAccess.hpp`, `DescriptorAccess.cpp`, `IoSignals.cpp`, `NativeIo.cpp`, `DescriptorControl.cpp`, and the opening of `Udp.cpp` at the pinned head `804d854d2bdacb49116521eb6a7c0cba5e45c1d7`. ## Results | Check | Result | Note | |---|---|---| | Tests | not run | Review only | | Changed code review | not run | Not all changed lines were read | ## Findings ### Blocking None verified in the code inspected. ### Non-blocking None. ## Not verified The change spans 61 changed files listed in the review bundle. I did not read every changed line or inspect all touched code paths and tests, so the review does not establish that the full change is sound. The review bundle’s `files.json` was not available; excluded files were therefore not verified. No runtime, build, or CI checks were performed. ## To get this to a good state Complete the review of the remaining changed lines and relevant callers and tests, then run the appropriate checks on this head before making a formal decision.
MarcZX10 commented 2026-11-21 02:54:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T02:54:22Z.

Review: COMMENTED


Reviewed — no blocking findings

The inspected cancellation and socket paths showed no verified blocking defect, but this review is incomplete because I did not read every changed file.

What I ran

Reviewed head dd3e4aa0de0548d820b4aa85a5c6c61ce3ae3683 using the prepared diff and pinned reader. I ran no tests or builds. The description reports Windows and Linux focused test runs; those results were not reproduced in this review.

Results

Check Result Note
Prepared diff and inventory passed 59 changed files, all listed as included
Targeted source review passed No blocking defect found in inspected paths
Tests and builds not run Author-reported results only
Full changed-file review not run Many changed files were not read

Negative control

Not run.

Findings

Blocking

None verified in the inspected paths.

Non-blocking

Nothing to report from the inspected paths.

Sources

Behavior claims are based on the prepared diff and repository source at the reviewed head. Socket transfer implementation and descriptor access implementation.

Not verified

I read review/description.md, review/commits.md, review/manifest.json, review/README.md, and review/diff.patch. In changed repository files, I inspected targeted ranges in core/libs/prx/libc/src/DescriptorAccess.cpp, core/libs/prx/libkernel/Pthread/src/IoSignals.cpp, core/libs/prx/libkernel/Pthread/src/NativeIo.cpp, core/libs/prx/libkernel/Pthread/include/Cancel.hpp, core/libs/prx/libkernel/File/src/Stdio.cpp, core/libs/prx/libkernel/File/src/DescriptorControl.cpp, core/libs/prx/libkernel/File/src/Open.cpp, core/libs/prx/libkernel/Socket/src/Udp.cpp, core/libs/prx/libSceNet/Export.cpp, core/libs/prx/libSceSsl/Export.cpp, core/libs/prx/libc/include/FileStream.hpp, core/libs/prx/libc/include/HostThreadLocal.hpp, core/libs/prx/libc/include/JumpBuffer.hpp, core/libs/prx/libc/src/JumpBuffer.cpp, core/libs/prx/libc/src/RuntimeSupport.cpp, core/libs/prx/libkernel/Pthread/src/Thread.cpp, and docs/dev/debt/changes/posix-read-cancellation.md. I did not read all changed lines in those files or inspect the other changed files. No separate files.json was available in the review folder listing; the manifest reports all changed files included. Tests, build results, macOS behavior, console behavior, and hardware behavior were not independently verified.

To get this to a good state

Nothing is required. Optional: complete review of the remaining changed lines and run focused checks on this exact head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6002400618 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12688#pullrequestreview-6002400618). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T02:54:22Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The inspected cancellation and socket paths showed no verified blocking defect, but this review is incomplete because I did not read every changed file. ## What I ran Reviewed head `dd3e4aa0de0548d820b4aa85a5c6c61ce3ae3683` using the prepared diff and pinned reader. I ran no tests or builds. The description reports Windows and Linux focused test runs; those results were not reproduced in this review. ## Results | Check | Result | Note | |---|---|---| | Prepared diff and inventory | passed | 59 changed files, all listed as included | | Targeted source review | passed | No blocking defect found in inspected paths | | Tests and builds | not run | Author-reported results only | | Full changed-file review | not run | Many changed files were not read | ## Negative control Not run. ## Findings ### Blocking None verified in the inspected paths. ### Non-blocking Nothing to report from the inspected paths. ## Sources Behavior claims are based on the prepared diff and repository source at the reviewed head. [Socket transfer implementation](https://github.com/boykopovar/AnyPS5/blob/dd3e4aa0de0548d820b4aa85a5c6c61ce3ae3683/core/libs/prx/libkernel/Socket/src/Udp.cpp) and [descriptor access implementation](https://github.com/boykopovar/AnyPS5/blob/dd3e4aa0de0548d820b4aa85a5c6c61ce3ae3683/core/libs/prx/libc/src/DescriptorAccess.cpp). ## Not verified I read `review/description.md`, `review/commits.md`, `review/manifest.json`, `review/README.md`, and `review/diff.patch`. In changed repository files, I inspected targeted ranges in `core/libs/prx/libc/src/DescriptorAccess.cpp`, `core/libs/prx/libkernel/Pthread/src/IoSignals.cpp`, `core/libs/prx/libkernel/Pthread/src/NativeIo.cpp`, `core/libs/prx/libkernel/Pthread/include/Cancel.hpp`, `core/libs/prx/libkernel/File/src/Stdio.cpp`, `core/libs/prx/libkernel/File/src/DescriptorControl.cpp`, `core/libs/prx/libkernel/File/src/Open.cpp`, `core/libs/prx/libkernel/Socket/src/Udp.cpp`, `core/libs/prx/libSceNet/Export.cpp`, `core/libs/prx/libSceSsl/Export.cpp`, `core/libs/prx/libc/include/FileStream.hpp`, `core/libs/prx/libc/include/HostThreadLocal.hpp`, `core/libs/prx/libc/include/JumpBuffer.hpp`, `core/libs/prx/libc/src/JumpBuffer.cpp`, `core/libs/prx/libc/src/RuntimeSupport.cpp`, `core/libs/prx/libkernel/Pthread/src/Thread.cpp`, and `docs/dev/debt/changes/posix-read-cancellation.md`. I did not read all changed lines in those files or inspect the other changed files. No separate `files.json` was available in the review folder listing; the manifest reports all changed files included. Tests, build results, macOS behavior, console behavior, and hardware behavior were not independently verified. ## To get this to a good state Nothing is required. Optional: complete review of the remaining changed lines and run focused checks on this exact head.
MarcZX10 commented 2026-11-21 04:50:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T04:50:40Z.

Review: COMMENTED


Reviewed — comments

The exact head 7935169d1605d995040076bee0b6128df94a690c has no verified blocking finding in the inspected excerpts, but this review is incomplete and does not support a formal approval.

What I ran

No commands or tests were run. I read the prepared description, commit list, manifest, file list, and selected excerpts from diff.patch; repository source was not read through repo_read.py.

Results

Check Result Note
Prepared change bundle passed Inspected
Tests not run Author-reported runs only
Full source review not run Review is incomplete

Findings

Blocking

None verified in the inspected excerpts.

Non-blocking

None.

Not verified

The changed production and test files were not read in full, and callers beyond the inspected excerpts were not checked. The author-reported Windows and Linux results were not independently run. The manifest lists 55 changed files as included; selected excerpts of DescriptorAccess.hpp, DescriptorAccess.cpp, JumpBuffer.cpp, Open.cpp, Stdio.cpp, Udp.cpp, IoSignals.cpp, NativeIo.cpp, Thread.cpp, and Exception.cpp were inspected in diff.patch. No changed file was read through repo_read.py; the full texts listed in the manifest and the excluded debt fragment were not reviewed.

To get this to a good state

Nothing is required. Optional: complete the source and test review before making a formal approval decision.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6002918503 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12688#pullrequestreview-6002918503). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T04:50:40Z. **Review:** COMMENTED --- # Reviewed — comments The exact head `7935169d1605d995040076bee0b6128df94a690c` has no verified blocking finding in the inspected excerpts, but this review is incomplete and does not support a formal approval. ## What I ran No commands or tests were run. I read the prepared description, commit list, manifest, file list, and selected excerpts from `diff.patch`; repository source was not read through `repo_read.py`. ## Results | Check | Result | Note | |---|---|---| | Prepared change bundle | passed | Inspected | | Tests | not run | Author-reported runs only | | Full source review | not run | Review is incomplete | ## Findings ### Blocking None verified in the inspected excerpts. ### Non-blocking None. ## Not verified The changed production and test files were not read in full, and callers beyond the inspected excerpts were not checked. The author-reported Windows and Linux results were not independently run. The manifest lists 55 changed files as included; selected excerpts of `DescriptorAccess.hpp`, `DescriptorAccess.cpp`, `JumpBuffer.cpp`, `Open.cpp`, `Stdio.cpp`, `Udp.cpp`, `IoSignals.cpp`, `NativeIo.cpp`, `Thread.cpp`, and `Exception.cpp` were inspected in `diff.patch`. No changed file was read through `repo_read.py`; the full texts listed in the manifest and the excluded debt fragment were not reviewed. ## To get this to a good state Nothing is required. Optional: complete the source and test review before making a formal approval decision.
MarcZX10 commented 2026-11-21 06:50:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T06:50:28Z.

Review: COMMENTED


Reviewed — no blocking findings

The prepared bundle describes socket I/O and cancellation changes, but this review is incomplete because I read only a small subset of the changed files; no merge decision is justified.

What I ran

Reviewed prepared head 59991e7d5e186a075c78bd7b55718ce6bb63b59f using the provided reader. I did not run tests or other commands.

Results

Check Result Note
Prepared diff inspection passed Read selected hunks
Tests not run No local execution
Full changed-file review not run Only selected files read

Negative control

Not run.

Findings

Blocking

None identified in the portions reviewed.

Non-blocking

None.

Sources

Read selected hunks in review/diff.patch and source at the pinned head in core/libs/prx/libc/src/DescriptorAccess.cpp, core/libs/prx/libc/include/FileStream.hpp, core/libs/prx/libc/src/JumpBuffer.cpp, core/libs/prx/libc/include/JumpBuffer.hpp, and core/libs/prx/libSceLibcInternal/UserContext.cpp.

Not verified

I read review/description.md, review/commits.md, the beginning of review/manifest.json, and selected ranges of review/diff.patch. I did not read every file listed as reviewed in the manifest, the full diff or manifest, or the excluded-file listing. The remaining changed code, tests, and behavior are not verified.

To get this to a good state

Complete review of the remaining changed files and relevant tests before making a formal decision.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6003622721 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12688#pullrequestreview-6003622721). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T06:50:28Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The prepared bundle describes socket I/O and cancellation changes, but this review is incomplete because I read only a small subset of the changed files; no merge decision is justified. ## What I ran Reviewed prepared head `59991e7d5e186a075c78bd7b55718ce6bb63b59f` using the provided reader. I did not run tests or other commands. ## Results | Check | Result | Note | |---|---|---| | Prepared diff inspection | passed | Read selected hunks | | Tests | not run | No local execution | | Full changed-file review | not run | Only selected files read | ## Negative control Not run. ## Findings ### Blocking None identified in the portions reviewed. ### Non-blocking None. ## Sources Read selected hunks in `review/diff.patch` and source at the pinned head in `core/libs/prx/libc/src/DescriptorAccess.cpp`, `core/libs/prx/libc/include/FileStream.hpp`, `core/libs/prx/libc/src/JumpBuffer.cpp`, `core/libs/prx/libc/include/JumpBuffer.hpp`, and `core/libs/prx/libSceLibcInternal/UserContext.cpp`. ## Not verified I read `review/description.md`, `review/commits.md`, the beginning of `review/manifest.json`, and selected ranges of `review/diff.patch`. I did not read every file listed as reviewed in the manifest, the full diff or manifest, or the excluded-file listing. The remaining changed code, tests, and behavior are not verified. ## To get this to a good state Complete review of the remaining changed files and relevant tests before making a formal decision.
MarcZX10 commented 2026-11-21 13:30:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T13:30:23Z.

Review: COMMENTED


Reviewed — comments

The change spans 61 included files; only selected portions of four production files and the prepared diff were inspected, so the evidence is insufficient for a formal decision.

What I ran

Reviewed head a57cf356306256d779487ad2e27695ae76f99ea6. No commands or tests were run; the prepared diff was used without fetching it again.

Results

Check Result Note
Prepared artifacts passed Description, commits, manifest, and diff inspected
Runtime and build checks not run No test output independently verified
Full source review not run Only selected production-file ranges inspected

Negative control

Not run; no test binary or build environment was available through the reader.

Findings

Blocking

None verified from the inspected portions.

Non-blocking

No code-level finding is asserted from this partial inspection.

Sources

Prepared diff and repository source at the pinned head. No behavior claim is made beyond the inspected excerpts.

Not verified

Inspected repository files: core/libs/prx/libkernel/Pthread/src/IoSignals.cpp (lines 1–220), core/libs/prx/libkernel/Pthread/src/NativeIo.cpp (lines 1–121), core/libs/prx/libkernel/File/src/Stdio.cpp (lines 1–220), and core/libs/prx/libkernel/Socket/src/Udp.cpp (lines 1–200). Also inspected review/description.md, review/commits.md, review/manifest.json, and review/diff.patch (lines 1–999). The remaining source ranges and other changed files were not read. files.json was not available through the reader. Builds, tests, platform behavior, and the rest of the changed code remain unverified.

To get this to a good state

Nothing is required for the non-blocking comments in this draft; complete the source review and run the applicable checks before making a formal decision.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6005488641 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12688#pullrequestreview-6005488641). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T13:30:23Z. **Review:** COMMENTED --- # Reviewed — comments The change spans 61 included files; only selected portions of four production files and the prepared diff were inspected, so the evidence is insufficient for a formal decision. ## What I ran Reviewed head `a57cf356306256d779487ad2e27695ae76f99ea6`. No commands or tests were run; the prepared diff was used without fetching it again. ## Results | Check | Result | Note | |---|---|---| | Prepared artifacts | passed | Description, commits, manifest, and diff inspected | | Runtime and build checks | not run | No test output independently verified | | Full source review | not run | Only selected production-file ranges inspected | ## Negative control Not run; no test binary or build environment was available through the reader. ## Findings ### Blocking None verified from the inspected portions. ### Non-blocking No code-level finding is asserted from this partial inspection. ## Sources Prepared diff and repository source at the pinned head. No behavior claim is made beyond the inspected excerpts. ## Not verified Inspected repository files: `core/libs/prx/libkernel/Pthread/src/IoSignals.cpp` (lines 1–220), `core/libs/prx/libkernel/Pthread/src/NativeIo.cpp` (lines 1–121), `core/libs/prx/libkernel/File/src/Stdio.cpp` (lines 1–220), and `core/libs/prx/libkernel/Socket/src/Udp.cpp` (lines 1–200). Also inspected `review/description.md`, `review/commits.md`, `review/manifest.json`, and `review/diff.patch` (lines 1–999). The remaining source ranges and other changed files were not read. `files.json` was not available through the reader. Builds, tests, platform behavior, and the rest of the changed code remain unverified. ## To get this to a good state Nothing is required for the non-blocking comments in this draft; complete the source review and run the applicable checks before making a formal decision.
MarcZX10 commented 2026-11-21 14:07:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T14:07:43Z.

Review: COMMENTED


Reviewed — comments

The change has broad author-reported test coverage, but this review did not inspect every changed file or run those checks, so a formal approval is not justified.

What I ran

No commands or tests were run. I read the prepared description, commit list, manifest, diff excerpt, and targeted source ranges at head 978a8bef6c118f57242b96cee5c6f8cdf493e5d8.

Results

Check Result Note
Source review not run Partial review only
Author-reported tests not run Reported as passing in the description
Local tests not run No test execution environment used

Findings

Blocking

None identified in the source ranges reviewed.

Non-blocking

  • The description reports extensive Windows and Linux focused test runs, but these results were not independently verified in this review.

Not verified

The change spans many files. I read core/libs/prx/libkernel/Pthread/src/IoSignals.cpp, core/libs/prx/Pthread/src/NativeIo.cpp, core/libs/prx/libc/src/DescriptorAccess.cpp, core/libs/prx/libc/include/DescriptorAccess.hpp, and core/libs/prx/libkernel/Pthread/include/Cancel.hpp, plus the opening diff excerpt and selected test diff. I did not read every changed file or all changed hunks. I did not inspect the excluded-file list, run tests, or verify platform, console, or title behavior. The author-reported test results remain unverified.

To get this to a good state

Nothing is required. Optional: independently verify the reported focused test runs and complete review of the changed files before relying on this review as a merge decision.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6005808692 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12688#pullrequestreview-6005808692). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T14:07:43Z. **Review:** COMMENTED --- # Reviewed — comments The change has broad author-reported test coverage, but this review did not inspect every changed file or run those checks, so a formal approval is not justified. ## What I ran No commands or tests were run. I read the prepared description, commit list, manifest, diff excerpt, and targeted source ranges at head `978a8bef6c118f57242b96cee5c6f8cdf493e5d8`. ## Results | Check | Result | Note | |---|---|---| | Source review | not run | Partial review only | | Author-reported tests | not run | Reported as passing in the description | | Local tests | not run | No test execution environment used | ## Findings ### Blocking None identified in the source ranges reviewed. ### Non-blocking - The description reports extensive Windows and Linux focused test runs, but these results were not independently verified in this review. ## Not verified The change spans many files. I read `core/libs/prx/libkernel/Pthread/src/IoSignals.cpp`, `core/libs/prx/Pthread/src/NativeIo.cpp`, `core/libs/prx/libc/src/DescriptorAccess.cpp`, `core/libs/prx/libc/include/DescriptorAccess.hpp`, and `core/libs/prx/libkernel/Pthread/include/Cancel.hpp`, plus the opening diff excerpt and selected test diff. I did not read every changed file or all changed hunks. I did not inspect the excluded-file list, run tests, or verify platform, console, or title behavior. The author-reported test results remain unverified. ## To get this to a good state Nothing is required. Optional: independently verify the reported focused test runs and complete review of the changed files before relying on this review as a merge decision.
ligmaSec commented 2026-12-03 19:53:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T19:53:56Z.

Review: COMMENTED


In the Windows partial-buffer path, PendingFits peeks at the next datagram and DropDatagram or the receive consumes it in a separate call. The Transfer retry loop does not serialize those two native operations against receives on the same socket. If another reader consumes the peeked datagram, the fault path can discard a different packet which would have fit. Can the nonblocking peek-and-consume sequence share the socket's receive serialization, with the lock released before waiting for readiness?

Source review at 978a8bef6c. A trial merge onto 484e8e6b77 conflicts in libc and libkernel, including Socket/src/Udp.cpp. Native Windows execution is unavailable here.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6177356127 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12688#pullrequestreview-6177356127). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T19:53:56Z. **Review:** COMMENTED --- In the Windows partial-buffer path, `PendingFits` peeks at the next datagram and `DropDatagram` or the receive consumes it in a separate call. The `Transfer` retry loop does not serialize those two native operations against receives on the same socket. If another reader consumes the peeked datagram, the fault path can discard a different packet which would have fit. Can the nonblocking peek-and-consume sequence share the socket's receive serialization, with the lock released before waiting for readiness? Source review at `978a8bef6c`. A trial merge onto `484e8e6b77` conflicts in libc and libkernel, including `Socket/src/Udp.cpp`. Native Windows execution is unavailable here. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/12688:upstream-pr/12688'
git switch 'upstream-pr/12688'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/12688'
git switch 'upstream-pr/12688'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/12688'
git switch 'upstream-pr/12688'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/12688'
git switch 'main'
git merge --squash 'upstream-pr/12688'
git switch 'main'
git merge --ff-only 'upstream-pr/12688'
git switch 'main'
git merge 'upstream-pr/12688'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!12688
No description provided.