feat(libkernel): support deferred cancellation in POSIX accept #12965

Open
Felipebmaitan wants to merge 264 commits from upstream-pr/12965 into main
Felipebmaitan commented 2026-10-29 17:42:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Felipebmaitan on 2026-10-29T17:42:53Z.


What

accept and _accept wake on enabled deferred cancellation. The restart state owns an accepted socket through deferred guest delivery. Cancellation or context abandonment releases that socket before guest cleanup and thread-local destructors. A completed native accept wins a pending cancellation request when deferred delivery returns normally. connect and direct libSceNet calls remain outside this cancellation change.

Main's checked length copy runs before descriptor lookup. The peer address is copied into guest memory only after reserving the descriptor and allocating its socket-map entry. The entry becomes visible after checked copy-out succeeds. Copy failure releases both the reservation and the connection, including when the copy throws. TransferKind::Accept keeps connected sockets that received SHUT_RD on the ordinary accept error path. The focused shutdown tests also cover descriptor aliases.

Head fc8023c3f1a7fb8b06dbeddbaedc9b7c1229f651 merges published reads #12682 7887e7a03da0e8aeed2557f4ba43a6aa777494b9, transport #12688 978a8bef6c118f57242b96cee5c6f8cdf493e5d8 and writes #12700 6b8ca980e58f287cb042abf8c09f78f53298aa36, with main integrated through 4f5777f2f320111b156ed5db843a6d5f67968923. The prerequisites retain #24939's Linux pending-connect ENOTCONN behavior and #24382's Windows guest buffer checks alongside interruptible socket transfers. The eight-file accept patch has identical additions and deletions to 5e7647e after composing each prerequisite stack. A read-only merge against main e60b2f74adb21151e50567a770ecd8aa795ce415 passed before push. GitHub's main-based view includes the prerequisites, so this PR stays draft.

Close retries back off from 1 to 16 ms and wake on reader completion. Repeated interruption covers the gap before native entry. An uninterruptible native call can still delay close indefinitely. Setup and admission costs are unmeasured.

The named overlap scan found separate changes in #18476 (libSceNet accept forwarding) and #22573 (inherited socket status flags). A read-only merge of #18476 into the write prerequisite c76cc79 succeeds, while the same merge into 5e7647e conflicts in Udp.cpp. If #18476 lands first, its forwarding path will need to be reconciled with the staged accept installation here. The dependency order for deferred cancellation remains reads, transport, writes, accept.

The overlap report also flags the existing recvfrom and sendto exports from the composed prerequisites. The accept changes leave both alone. Each NID appears once in the patched Windows libkernel export table.

Tested

Fresh focused runtime tests on fc8023c3f1a7fb8b06dbeddbaedc9b7c1229f651

  • Windows 11 build 26300, WinLibs GCC 15.2, Release/Ninja. 357/357 passed, no skips. TCP, UDP and all eight guarded-buffer cancellation and shutdown cases passed five consecutive runs each. The signal-jump test and each of four accept install and handoff cases passed 100 consecutive runs.
  • Linux Debian 12 in Docker on the WSL2 kernel, GCC 14.2, Release/Ninja. 346/346 passed, no skips. The TCP fixture includes the pending-connect ENOTCONN checks for send, write, and addressless sendto.
  • Both suites passed TCP, UDP, all four LibreSSL SSL I/O groups and all three TLS engine groups. The preceding head 16b2d81 failed guest_libressl_ssl_io_transport in hosted Windows CI with exit 0xc0000409. A local rebuild of that head reproduced the failure at the handshake retry assertion. The fixture now uses the retained socket's transfer callback, which preserves guest blocking mode. The EINTR and handshake retry assertions are unchanged. Failing job on 16b2d81. Hosted Windows CI passed on 5e7647e. Windows job on 5e7647e.
  • The focused suites exercised checked peer addresses, close and reuse, shutdown through aliases, accept on a connected socket after SHUT_RD, large-file vector I/O, AIO, synchronous write cancellation, and guest_accept_install_copyout_exception. All nine archive fixtures passed on each platform, including checked pread destinations and damaged backing files. The accept copy-out fixture checks propagation of the injected exception, unchanged guest outputs, peer disconnect, and resource counts at cleanup and thread-local destruction. Its resource snapshot begins after connection setup.
  • Windows patched-library validation passed all three scoped tests (patched_libraries, net_reuseport_patched, net_ipv6only_patched). The loader reported six patched libraries loaded and zero failures. A loopback smoke test called both accept and _accept by NID in patched libkernel. Both copied out the peer address and preserved the queued connection when the guest length pointer was null. PE inspection confirmed patched libSceNet imports the three C cancellation helpers exported by patched libkernel and has no direct ThreadCancel imports.
  • Public-header audit passed for 413 libraries and 34,810 exports. Debt fragments, conventions against latest fetched origin/main, and diff whitespace passed.

A progress scanner comparison counted 719 implemented libkernel exports out of 758 on integrated main 4f5777f2f320111b156ed5db843a6d5f67968923 and 708 out of 758 on this head. Replacing one guarded marker in a temporary scanner-only copy restored all eleven labels and the 719/758 count. The marker applies to a blocking Windows stream receive with both MSG_PEEK and MSG_WAITALL. The scanner follows shared helpers and aliases without evaluating the guard. Accept passes zero flags and sends take the send branch. All eleven exports retain their implementations.

An independent review of 500971c926aa02b6ba9045e89844f2e320eb8adc found that post-install copy-out could leak the descriptor on exception or close a reused number during rollback. Commit 142ec9f0df76baff6aa22df10ff2278670191e56 stages publication until copy-out succeeds, adds the exception regression and records the remaining limits through the debt fragment. The corrected accept patch is identical to the layer previously published at 81d2fef3bfe01c82e842a817b20de0df66d971eb. The counts above are from local rebuilds and tests of the refreshed stack.

The intermittent guest_io_context_sigjump timeout reported on Windows 22621 remains unresolved. The Windows repetitions above ran on 26300. macOS runtime and console behavior remain unverified for this composition. Original Windows 22621 report.

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, #12688, #12700
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5072832257 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12965). Originally posted by [Felipebmaitan](https://github.com/Felipebmaitan) on 2026-10-29T17:42:53Z. --- ### What `accept` and `_accept` wake on enabled deferred cancellation. The restart state owns an accepted socket through deferred guest delivery. Cancellation or context abandonment releases that socket before guest cleanup and thread-local destructors. A completed native accept wins a pending cancellation request when deferred delivery returns normally. `connect` and direct libSceNet calls remain outside this cancellation change. Main's checked length copy runs before descriptor lookup. The peer address is copied into guest memory only after reserving the descriptor and allocating its socket-map entry. The entry becomes visible after checked copy-out succeeds. Copy failure releases both the reservation and the connection, including when the copy throws. `TransferKind::Accept` keeps connected sockets that received `SHUT_RD` on the ordinary accept error path. The focused shutdown tests also cover descriptor aliases. Head `fc8023c3f1a7fb8b06dbeddbaedc9b7c1229f651` merges published reads #12682 `7887e7a03da0e8aeed2557f4ba43a6aa777494b9`, transport #12688 `978a8bef6c118f57242b96cee5c6f8cdf493e5d8` and writes #12700 `6b8ca980e58f287cb042abf8c09f78f53298aa36`, with main integrated through `4f5777f2f320111b156ed5db843a6d5f67968923`. The prerequisites retain #24939's Linux pending-connect `ENOTCONN` behavior and #24382's Windows guest buffer checks alongside interruptible socket transfers. The eight-file accept patch has identical additions and deletions to `5e7647e` after composing each prerequisite stack. A read-only merge against main `e60b2f74adb21151e50567a770ecd8aa795ce415` passed before push. GitHub's main-based view includes the prerequisites, so this PR stays draft. Close retries back off from 1 to 16 ms and wake on reader completion. Repeated interruption covers the gap before native entry. An uninterruptible native call can still delay close indefinitely. Setup and admission costs are unmeasured. The named overlap scan found separate changes in #18476 (libSceNet accept forwarding) and #22573 (inherited socket status flags). A read-only merge of #18476 into the write prerequisite `c76cc79` succeeds, while the same merge into `5e7647e` conflicts in `Udp.cpp`. If #18476 lands first, its forwarding path will need to be reconciled with the staged accept installation here. The dependency order for deferred cancellation remains reads, transport, writes, accept. The overlap report also flags the existing `recvfrom` and `sendto` exports from the composed prerequisites. The accept changes leave both alone. Each NID appears once in the patched Windows `libkernel` export table. ### Tested Fresh focused runtime tests on `fc8023c3f1a7fb8b06dbeddbaedc9b7c1229f651` - Windows 11 build 26300, WinLibs GCC 15.2, Release/Ninja. **357/357 passed**, no skips. TCP, UDP and all eight guarded-buffer cancellation and shutdown cases passed five consecutive runs each. The signal-jump test and each of four accept install and handoff cases passed 100 consecutive runs. - Linux Debian 12 in Docker on the WSL2 kernel, GCC 14.2, Release/Ninja. **346/346 passed**, no skips. The TCP fixture includes the pending-connect `ENOTCONN` checks for `send`, `write`, and addressless `sendto`. - Both suites passed TCP, UDP, all four LibreSSL SSL I/O groups and all three TLS engine groups. The preceding head `16b2d81` failed `guest_libressl_ssl_io_transport` in hosted Windows CI with exit `0xc0000409`. A local rebuild of that head reproduced the failure at the handshake retry assertion. The fixture now uses the retained socket's transfer callback, which preserves guest blocking mode. The `EINTR` and handshake retry assertions are unchanged. [Failing job on `16b2d81`](https://github.com/boykopovar/AnyPS5/actions/runs/44867872282/job/136736413548). Hosted Windows CI passed on `5e7647e`. [Windows job on `5e7647e`](https://github.com/boykopovar/AnyPS5/actions/runs/44875251104/job/136763414219). - The focused suites exercised checked peer addresses, close and reuse, shutdown through aliases, accept on a connected socket after `SHUT_RD`, large-file vector I/O, AIO, synchronous write cancellation, and `guest_accept_install_copyout_exception`. All nine archive fixtures passed on each platform, including checked `pread` destinations and damaged backing files. The accept copy-out fixture checks propagation of the injected exception, unchanged guest outputs, peer disconnect, and resource counts at cleanup and thread-local destruction. Its resource snapshot begins after connection setup. - Windows patched-library validation passed all three scoped tests (`patched_libraries`, `net_reuseport_patched`, `net_ipv6only_patched`). The loader reported six patched libraries loaded and zero failures. A loopback smoke test called both `accept` and `_accept` by NID in patched `libkernel`. Both copied out the peer address and preserved the queued connection when the guest length pointer was null. PE inspection confirmed patched `libSceNet` imports the three C cancellation helpers exported by patched `libkernel` and has no direct `ThreadCancel` imports. - Public-header audit passed for 413 libraries and 34,810 exports. Debt fragments, conventions against latest fetched `origin/main`, and diff whitespace passed. A progress scanner comparison counted 719 implemented libkernel exports out of 758 on integrated main `4f5777f2f320111b156ed5db843a6d5f67968923` and 708 out of 758 on this head. Replacing one guarded marker in a temporary scanner-only copy restored all eleven labels and the 719/758 count. The marker applies to a blocking Windows stream receive with both `MSG_PEEK` and `MSG_WAITALL`. The scanner follows shared helpers and aliases without evaluating the guard. Accept passes zero flags and sends take the send branch. All eleven exports retain their implementations. An independent review of `500971c926aa02b6ba9045e89844f2e320eb8adc` found that post-install copy-out could leak the descriptor on exception or close a reused number during rollback. Commit `142ec9f0df76baff6aa22df10ff2278670191e56` stages publication until copy-out succeeds, adds the exception regression and records the remaining limits through the debt fragment. The corrected accept patch is identical to the layer previously published at `81d2fef3bfe01c82e842a817b20de0df66d971eb`. The counts above are from local rebuilds and tests of the refreshed stack. The intermittent `guest_io_context_sigjump` timeout reported on Windows 22621 remains unresolved. The Windows repetitions above ran on 26300. macOS runtime and console behavior remain unverified for this composition. [Original Windows 22621 report](https://github.com/boykopovar/AnyPS5/pull/12965#issuecomment-6505197255). <!-- 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. --> ### 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, #12688, #12700 <!-- #PR, or none --> - [x] Fixes: none <!-- 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:48:59 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Correction (2026-11-01): this review's claim that maintainers close PRs without a title ID is wrong. CONTRIBUTING allows Unblocks: none; a title is only required when the PR fixes a title. The technical points below are unaffected.

No title ID with a log line reaching accept cancellation on main is given ("Unblocks: none", and the limits paragraph says no TCP/cancellation title run). Per the project's usual bar that is the first thing a maintainer will ask for.

  1. Not an accept PR as filed. The diff is f66 +7768/-263 because it carries #10817/#10755, #12682, #12688 and #12700 as a stack. Reviewers cannot read the accept slice (the stated 7 files, 249 insertions) in this view, and the same commits are being reviewed in the prerequisite PRs. Please keep this as a draft until the stack merges, or retarget so the diff is only the accept change.

  2. A known hang is shipped open. The body says the Windows 22621 guest_io_context_sigjump hang "remains unexplained" and the update "adds a bounded diagnostic guard, not a claimed lost-wake repair". A ready PR should not merge with a reproducible hang in the cancellation path under test; either explain it or mark the PR draft.

  3. 1 ms poll in the Close path. In the descriptor-access code the Mode::Close wait is while (!CanChange()) { state->Interrupt(); changed.wait_for(lock, 1ms); }. That re-issues Interrupt() every millisecond for as long as any reader is in flight, instead of waiting on a notification from the reader. If the reader is blocked in a long native call (an accept with no pending connection is exactly that), this wakes at 1 kHz and re-takes the state mutex each time. Please say why a single Interrupt() plus a predicate wait is not enough, and what bounds the loop.

  4. Limits listed but untested. "Descriptor-installation failure and disposal ordering before cleanup/TSD are statically reviewed, not directly fault-injected." The ownership transfer of an accepted socket across a deferred-cancel boundary is the part that leaks descriptors if wrong; a fault-injection test with a count of open descriptors before and after would be the negative control.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729920776 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12965#pullrequestreview-5729920776). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-11-01T19:48:59Z. **Review:** COMMENTED --- **Correction (2026-11-01):** this review's claim that maintainers close PRs without a title ID is wrong. CONTRIBUTING allows `Unblocks: none`; a title is only required when the PR fixes a title. The technical points below are unaffected. No title ID with a log line reaching `accept` cancellation on main is given ("Unblocks: none", and the limits paragraph says no TCP/cancellation title run). Per the project's usual bar that is the first thing a maintainer will ask for. 1. **Not an accept PR as filed.** The diff is f66 +7768/-263 because it carries #10817/#10755, #12682, #12688 and #12700 as a stack. Reviewers cannot read the accept slice (the stated 7 files, 249 insertions) in this view, and the same commits are being reviewed in the prerequisite PRs. Please keep this as a draft until the stack merges, or retarget so the diff is only the accept change. 2. **A known hang is shipped open.** The body says the Windows 22621 `guest_io_context_sigjump` hang "remains unexplained" and the update "adds a bounded diagnostic guard, not a claimed lost-wake repair". A ready PR should not merge with a reproducible hang in the cancellation path under test; either explain it or mark the PR draft. 3. **1 ms poll in the Close path.** In the descriptor-access code the `Mode::Close` wait is `while (!CanChange()) { state->Interrupt(); changed.wait_for(lock, 1ms); }`. That re-issues `Interrupt()` every millisecond for as long as any reader is in flight, instead of waiting on a notification from the reader. If the reader is blocked in a long native call (an `accept` with no pending connection is exactly that), this wakes at 1 kHz and re-takes the state mutex each time. Please say why a single `Interrupt()` plus a predicate wait is not enough, and what bounds the loop. 4. **Limits listed but untested.** "Descriptor-installation failure and disposal ordering before cleanup/TSD are statically reviewed, not directly fault-injected." The ownership transfer of an accepted socket across a deferred-cancel boundary is the part that leaks descriptors if wrong; a fault-injection test with a count of open descriptors before and after would be the negative control.
MarcZX10 commented 2026-11-16 21:54:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T21:54:02Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this review; the points below are optional.

What I ran

Reviewed head 99dee9956598573e0f66bd0dae68040cfad574ad. No commands or tests were run in this review. I read the prepared description, commits, manifest, and diff, plus the accept cancellation, restart ownership, and socket installation code using repo_read.py. All files marked reviewed in the manifest are included, but the full text of every changed file was not read.

Results

Check Result Note
Accept handoff inspection passed Retained socket stays owned through deferred delivery
Tests in this review not run Description reports author-run Windows tests
Full changed-file review not run Large composed change; targeted accept path reviewed

Findings

Blocking

None.

Non-blocking

  • Fresh composed-head Linux and macOS runs and the reported Windows 22621 hang remain unresolved, as stated in the PR description. These results would improve confidence in the platform coverage.

Not verified

I did not review every changed file or independently verify the broader prerequisite changes, author-reported test results, CI, or console behavior. No files were excluded by the prepared review manifest; the review was targeted to the accept cancellation path and its ownership/install context.

To get this to a good state

Nothing is required. Optional: add fresh composed-head Linux and macOS results and continue investigating the Windows 22621 hang.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5928422908 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12965#pullrequestreview-5928422908). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-16T21:54:02Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this review; the points below are optional. ## What I ran Reviewed head `99dee9956598573e0f66bd0dae68040cfad574ad`. No commands or tests were run in this review. I read the prepared description, commits, manifest, and diff, plus the accept cancellation, restart ownership, and socket installation code using `repo_read.py`. All files marked `reviewed` in the manifest are included, but the full text of every changed file was not read. ## Results | Check | Result | Note | |---|---|---| | Accept handoff inspection | passed | Retained socket stays owned through deferred delivery | | Tests in this review | not run | Description reports author-run Windows tests | | Full changed-file review | not run | Large composed change; targeted accept path reviewed | ## Findings ### Blocking None. ### Non-blocking - Fresh composed-head Linux and macOS runs and the reported Windows 22621 hang remain unresolved, as stated in the PR description. These results would improve confidence in the platform coverage. ## Not verified I did not review every changed file or independently verify the broader prerequisite changes, author-reported test results, CI, or console behavior. No files were excluded by the prepared review manifest; the review was targeted to the accept cancellation path and its ownership/install context. ## To get this to a good state Nothing is required. Optional: add fresh composed-head Linux and macOS results and continue investigating the Windows 22621 hang.
MarcZX10 commented 2026-11-20 22:23:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T22:23:58Z.

Review: COMMENTED


Reviewed — no blocking findings

The accept cancellation and staged socket installation paths are supported by the inspected code and focused tests; the broader composed change was not reviewed completely.

What I ran

No build or tests were run. The description reports focused test runs, but these were not independently verified here.

Results

Check Result Note
Targeted source review passed Accept ownership and install paths inspected
Build and tests not run Author-reported results only
Full composed change not run Review scope was incomplete

Findings

Blocking

None in the code inspected.

Non-blocking

None.

Not verified

The inspected repository files were core/libs/prx/libkernel/Socket/src/Udp.cpp, core/libs/prx/libkernel/Pthread/include/Cancel.hpp, core/libs/prx/libkernel/Pthread/src/IoSignals.cpp, core/libs/prx/libkernel/Pthread/src/NativeIo.cpp, and core/libs/tests/GuestAcceptCancel.cpp. The diff and manifest were read in selected ranges. Most other changed files listed as reviewed in review/manifest.json were not read; their behavior, tests, and interactions are not verified. docs/dev/debt/changes/posix-socket-blocking-transport.md was excluded by rule. No build, runtime tests, or console behavior were checked.

To get this to a good state

Nothing is required. Optional: complete review of the remaining changed files and independently run the focused suites before relying on the broader composed change.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6000182625 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12965#pullrequestreview-6000182625). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T22:23:58Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The accept cancellation and staged socket installation paths are supported by the inspected code and focused tests; the broader composed change was not reviewed completely. ## What I ran No build or tests were run. The description reports focused test runs, but these were not independently verified here. ## Results | Check | Result | Note | |---|---|---| | Targeted source review | passed | Accept ownership and install paths inspected | | Build and tests | not run | Author-reported results only | | Full composed change | not run | Review scope was incomplete | ## Findings ### Blocking None in the code inspected. ### Non-blocking None. ## Not verified The inspected repository files were `core/libs/prx/libkernel/Socket/src/Udp.cpp`, `core/libs/prx/libkernel/Pthread/include/Cancel.hpp`, `core/libs/prx/libkernel/Pthread/src/IoSignals.cpp`, `core/libs/prx/libkernel/Pthread/src/NativeIo.cpp`, and `core/libs/tests/GuestAcceptCancel.cpp`. The diff and manifest were read in selected ranges. Most other changed files listed as reviewed in `review/manifest.json` were not read; their behavior, tests, and interactions are not verified. `docs/dev/debt/changes/posix-socket-blocking-transport.md` was excluded by rule. No build, runtime tests, or console behavior were checked. ## To get this to a good state Nothing is required. Optional: complete review of the remaining changed files and independently run the focused suites before relying on the broader composed change.
MarcZX10 commented 2026-11-21 00:08:40 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Reviewed — comments

The accept cancellation path was reviewed at head 2e68c87b9986edef7123f0cfbdf1ee7ae60eba6b; I found no verified blocking defect, but the broader change was not fully reviewed.

What I ran

Read the prepared description, commits, manifest and diff, then inspected the changed accept implementation and cancellation interface through repo_read.py. No tests or builds were run.

Results

Check Result Note
Prepared review bundle passed Read description, commits, manifest and diff
Targeted accept code review passed Inspected accept installation and cancellation path
Tests and build not run Runtime results in the description are author-reported

Findings

Blocking

None verified in the code inspected.

Non-blocking

None.

Not verified

This was a targeted review, not a complete review of the changed code. I read core/libs/prx/libkernel/Socket/src/Udp.cpp and core/libs/prx/libkernel/Pthread/include/Cancel.hpp for repository context. I did not read all changed files or run tests. The description reports Windows 11 and Debian 12 test results; these were not independently verified. macOS runtime and console behavior are reported as unverified by the author. The bundle’s excluded-by-rule file is docs/dev/debt/changes/posix-socket-blocking-transport.md.

To get this to a good state

Nothing is required. Optional: complete review of the remaining changed files and run the focused tests on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6001092812 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12965#pullrequestreview-6001092812). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T00:08:40Z. **Review:** COMMENTED --- # Reviewed — comments The accept cancellation path was reviewed at head `2e68c87b9986edef7123f0cfbdf1ee7ae60eba6b`; I found no verified blocking defect, but the broader change was not fully reviewed. ## What I ran Read the prepared description, commits, manifest and diff, then inspected the changed accept implementation and cancellation interface through `repo_read.py`. No tests or builds were run. ## Results | Check | Result | Note | |---|---|---| | Prepared review bundle | passed | Read description, commits, manifest and diff | | Targeted accept code review | passed | Inspected accept installation and cancellation path | | Tests and build | not run | Runtime results in the description are author-reported | ## Findings ### Blocking None verified in the code inspected. ### Non-blocking None. ## Not verified This was a targeted review, not a complete review of the changed code. I read `core/libs/prx/libkernel/Socket/src/Udp.cpp` and `core/libs/prx/libkernel/Pthread/include/Cancel.hpp` for repository context. I did not read all changed files or run tests. The description reports Windows 11 and Debian 12 test results; these were not independently verified. macOS runtime and console behavior are reported as unverified by the author. The bundle’s excluded-by-rule file is `docs/dev/debt/changes/posix-socket-blocking-transport.md`. ## To get this to a good state Nothing is required. Optional: complete review of the remaining changed files and run the focused tests on this head.
MarcZX10 commented 2026-11-21 03:13:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T03:13:19Z.

Review: COMMENTED


Reviewed — comments

The review is incomplete, so a formal approval is not justified; the inspected accept and descriptor paths showed no verified blocking defect.

What I ran

Reviewed head 34f53aac67749d5c76d21aa106b127990396fa4a from the prepared diff. I did not run commands or tests; the test results in the description are author-reported.

Results

Check Result Note
Diff and metadata passed Prepared review materials read
Tests not run Results supplied by author only
Full changed-file review not run Only 6 of 80 changed files inspected

Negative control

Not run; no tests were run in this review.

Findings

Blocking

None verified in the inspected code.

Non-blocking

No code-level feedback from the inspected paths. This review remains a comment because most changed files were not inspected.

Sources

Not verified

I read description.md, commits.md, manifest.json, and diff.patch from the prepared review materials. Among changed repository files, I inspected core/libs/prx/libkernel/Pthread/include/Cancel.hpp, core/libs/prx/libkernel/Socket/src/Udp.cpp, core/libs/prx/libc/src/DescriptorAccess.cpp, core/libs/prx/libc/include/DescriptorAccess.hpp, core/libs/prx/libkernel/File/include/File.hpp, and core/libs/prx/libkernel/File/src/DescriptorControl.cpp. I did not inspect the remaining 74 changed files or run tests. The description identifies docs/dev/debt/changes/posix-socket-blocking-transport.md as excluded by rule.

To get this to a good state

Nothing is required. Optional: complete review of the remaining changed files and run the focused tests on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6002486869 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12965#pullrequestreview-6002486869). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T03:13:19Z. **Review:** COMMENTED --- # Reviewed — comments The review is incomplete, so a formal approval is not justified; the inspected accept and descriptor paths showed no verified blocking defect. ## What I ran Reviewed head `34f53aac67749d5c76d21aa106b127990396fa4a` from the prepared diff. I did not run commands or tests; the test results in the description are author-reported. ## Results | Check | Result | Note | |---|---|---| | Diff and metadata | passed | Prepared review materials read | | Tests | not run | Results supplied by author only | | Full changed-file review | not run | Only 6 of 80 changed files inspected | ## Negative control Not run; no tests were run in this review. ## Findings ### Blocking None verified in the inspected code. ### Non-blocking No code-level feedback from the inspected paths. This review remains a comment because most changed files were not inspected. ## Sources - [Accept and descriptor installation at the reviewed commit](https://github.com/boykopovar/AnyPS5/blob/34f53aac67749d5c76d21aa106b127990396fa4a/core/libs/prx/libkernel/Socket/src/Udp.cpp) - [Descriptor access coordination at the reviewed commit](https://github.com/boykopovar/AnyPS5/blob/34f53aac67749d5c76d21aa106b127990396fa4a/core/libs/prx/libc/src/DescriptorAccess.cpp) ## Not verified I read `description.md`, `commits.md`, `manifest.json`, and `diff.patch` from the prepared review materials. Among changed repository files, I inspected `core/libs/prx/libkernel/Pthread/include/Cancel.hpp`, `core/libs/prx/libkernel/Socket/src/Udp.cpp`, `core/libs/prx/libc/src/DescriptorAccess.cpp`, `core/libs/prx/libc/include/DescriptorAccess.hpp`, `core/libs/prx/libkernel/File/include/File.hpp`, and `core/libs/prx/libkernel/File/src/DescriptorControl.cpp`. I did not inspect the remaining 74 changed files or run tests. The description identifies `docs/dev/debt/changes/posix-socket-blocking-transport.md` as excluded by rule. ## To get this to a good state Nothing is required. Optional: complete review of the remaining changed files and run the focused tests on this head.
MarcZX10 commented 2026-11-21 05:12:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T05:12:02Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this change; the points below are optional.

What I ran

Reviewed head 16b2d81e0dca6f215e2dafcfc4e29e283c156c15 using the prepared diff and repo_read.py at the pinned head. No commands or tests were run. The description reports Windows and Linux test runs; those results are author-reported, not independently verified.

Results

Check Result Note
Prepared diff and changed paths passed All changed files were included
Targeted source review passed Cancellation, accept install, context, and descriptor paths
Runtime tests not run Reported results were not independently checked

Negative control

Not run; no tests were run in this review.

Findings

Blocking

None.

Non-blocking

None.

Sources

The prepared diff and pinned source review support the behavior claims. Key reviewed paths: core/libs/prx/libkernel/Socket/src/Udp.cpp, core/libs/prx/libkernel/Pthread/include/Cancel.hpp, core/libs/prx/libkernel/Pthread/src/IoSignals.cpp, core/libs/prx/libc/src/DescriptorAccess.cpp, and core/libs/prx/libc/src/JumpBuffer.cpp.

Not verified

I did not read every changed file or independently verify the author-reported Windows, Linux, patched-library, or public-header checks. macOS runtime and console behavior are reported as unverified in the description. docs/dev/debt/changes/posix-socket-blocking-transport.md was excluded by rule.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6003010103 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12965#pullrequestreview-6003010103). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T05:12:02Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this change; the points below are optional. ## What I ran Reviewed head `16b2d81e0dca6f215e2dafcfc4e29e283c156c15` using the prepared diff and `repo_read.py` at the pinned head. No commands or tests were run. The description reports Windows and Linux test runs; those results are author-reported, not independently verified. ## Results | Check | Result | Note | |---|---|---| | Prepared diff and changed paths | passed | All changed files were included | | Targeted source review | passed | Cancellation, accept install, context, and descriptor paths | | Runtime tests | not run | Reported results were not independently checked | ## Negative control Not run; no tests were run in this review. ## Findings ### Blocking None. ### Non-blocking None. ## Sources The prepared diff and pinned source review support the behavior claims. Key reviewed paths: `core/libs/prx/libkernel/Socket/src/Udp.cpp`, `core/libs/prx/libkernel/Pthread/include/Cancel.hpp`, `core/libs/prx/libkernel/Pthread/src/IoSignals.cpp`, `core/libs/prx/libc/src/DescriptorAccess.cpp`, and `core/libs/prx/libc/src/JumpBuffer.cpp`. ## Not verified I did not read every changed file or independently verify the author-reported Windows, Linux, patched-library, or public-header checks. macOS runtime and console behavior are reported as unverified in the description. `docs/dev/debt/changes/posix-socket-blocking-transport.md` was excluded by rule. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-21 06:55:32 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Reviewed — comments

The review is incomplete: only selected implementation files and hunks were inspected, so a formal merge decision is not justified.

What I ran

Inspected the prepared review documents and selected source ranges at head 5e7647e0824841f1c772b7cc44b1a548060b8ed2 using the repo_read.py reader. No build or tests were run; test results in the PR description are author-reported.

Results

Check Result Note
Prepared diff and description passed Inspected
Selected source context passed Partial review
Build and runtime tests not run Author reports platform runs
Complete changed-line review not run Most changed lines remain unread

Findings

Blocking

None identified in the inspected portions.

Non-blocking

None identified in the inspected portions.

Not verified

The changed files read were core/libs/prx/libSceLibreSsl/tests/FakeSocket.hpp, core/libs/prx/libc/src/DescriptorAccess.cpp, core/libs/prx/libc/src/JumpBuffer.cpp, core/libs/prx/libkernel/File/src/DescriptorControl.cpp, core/libs/prx/libkernel/File/src/Stdio.cpp, core/libs/prx/libkernel/Pthread/include/Cancel.hpp, core/libs/prx/libkernel/Pthread/src/IoSignals.cpp, core/libs/prx/libkernel/Pthread/src/NativeIo.cpp, and core/libs/prx/libkernel/Socket/src/Udp.cpp. Some were only partially read. The description, commit list, manifest, diff, and review-folder README were also inspected.

The other changed files listed in the manifest were not read, and the changed lines in the partially read files were not all checked. The excluded files listed by the review folder were not inspected. Builds, tests, macOS runtime, and console behavior were not verified. The PR description's test results were not independently confirmed.

To get this to a good state

Nothing is required. Optional: complete the changed-line review and run or independently confirm the relevant checks before making a formal review decision.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6003650645 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12965#pullrequestreview-6003650645). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T06:55:32Z. **Review:** COMMENTED --- # Reviewed — comments The review is incomplete: only selected implementation files and hunks were inspected, so a formal merge decision is not justified. ## What I ran Inspected the prepared review documents and selected source ranges at head `5e7647e0824841f1c772b7cc44b1a548060b8ed2` using the `repo_read.py` reader. No build or tests were run; test results in the PR description are author-reported. ## Results | Check | Result | Note | |---|---|---| | Prepared diff and description | passed | Inspected | | Selected source context | passed | Partial review | | Build and runtime tests | not run | Author reports platform runs | | Complete changed-line review | not run | Most changed lines remain unread | ## Findings ### Blocking None identified in the inspected portions. ### Non-blocking None identified in the inspected portions. ## Not verified The changed files read were `core/libs/prx/libSceLibreSsl/tests/FakeSocket.hpp`, `core/libs/prx/libc/src/DescriptorAccess.cpp`, `core/libs/prx/libc/src/JumpBuffer.cpp`, `core/libs/prx/libkernel/File/src/DescriptorControl.cpp`, `core/libs/prx/libkernel/File/src/Stdio.cpp`, `core/libs/prx/libkernel/Pthread/include/Cancel.hpp`, `core/libs/prx/libkernel/Pthread/src/IoSignals.cpp`, `core/libs/prx/libkernel/Pthread/src/NativeIo.cpp`, and `core/libs/prx/libkernel/Socket/src/Udp.cpp`. Some were only partially read. The description, commit list, manifest, diff, and review-folder README were also inspected. The other changed files listed in the manifest were not read, and the changed lines in the partially read files were not all checked. The excluded files listed by the review folder were not inspected. Builds, tests, macOS runtime, and console behavior were not verified. The PR description's test results were not independently confirmed. ## To get this to a good state Nothing is required. Optional: complete the changed-line review and run or independently confirm the relevant checks before making a formal review decision.
MarcZX10 commented 2026-11-22 09:05:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T09:05:48Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this draft; the remaining checks and platform behavior listed below were not verified.

What I ran

Inspected the prepared diff and targeted source at head fc8023c3f1a7fb8b06dbeddbaedc9b7c1229f651 using repo_read.py reader tools. No build or tests were run in this review.

Read the prepared description, commit list, diff, manifest, and targeted ranges from core/libs/prx/libkernel/Socket/src/Udp.cpp, core/libs/prx/libc/src/DescriptorAccess.cpp, and core/libs/prx/libkernel/Pthread/include/Cancel.hpp. The manifest marks every changed file included; the separate files.json was unavailable through the reader. Excluded by rule: docs/dev/debt/changes/posix-socket-blocking-transport.md.

Results

Check Result Note
Diff and targeted source review passed No verified blocking defect
Build and tests not run Author reports focused suites passed
Platform coverage not run macOS and console behavior unverified

Findings

Blocking

None.

Non-blocking

None.

Not verified

The patch spans many files; targeted source reads focused on descriptor coordination, cancellation helpers, and socket transfer/accept paths. I did not read every changed file in full or independently reproduce the author-reported test results. macOS runtime, physical-console behavior, and the reported Windows 22621 timeout remain unverified.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6011424741 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12965#pullrequestreview-6011424741). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T09:05:48Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this draft; the remaining checks and platform behavior listed below were not verified. ## What I ran Inspected the prepared diff and targeted source at head `fc8023c3f1a7fb8b06dbeddbaedc9b7c1229f651` using `repo_read.py` reader tools. No build or tests were run in this review. Read the prepared description, commit list, diff, manifest, and targeted ranges from `core/libs/prx/libkernel/Socket/src/Udp.cpp`, `core/libs/prx/libc/src/DescriptorAccess.cpp`, and `core/libs/prx/libkernel/Pthread/include/Cancel.hpp`. The manifest marks every changed file included; the separate `files.json` was unavailable through the reader. Excluded by rule: `docs/dev/debt/changes/posix-socket-blocking-transport.md`. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | No verified blocking defect | | Build and tests | not run | Author reports focused suites passed | | Platform coverage | not run | macOS and console behavior unverified | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The patch spans many files; targeted source reads focused on descriptor coordination, cancellation helpers, and socket transfer/accept paths. I did not read every changed file in full or independently reproduce the author-reported test results. macOS runtime, physical-console behavior, and the reported Windows 22621 timeout remain unverified. ## To get this to a good state Nothing is required.
ligmaSec commented 2026-12-03 19:53:58 +00:00 (Migrated from github.com)

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

Review: COMMENTED


ReportAddress writes the peer bytes before it checks whether the length can be written. The new copy-out exception fixture throws before ReportAddress, so its untouched-output assertion misses a failure of the second write. Could the fixture cover both output destinations independently and assert the intended peer-buffer contents after accept returns EFAULT? If that case should leave both outputs unchanged, check both guest spans before copying the address.

Source review at fc8023c3f1. A trial merge onto 484e8e6b77 conflicts in the inherited libc and socket changes, preventing an integrated run on that base.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6177356688 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12965#pullrequestreview-6177356688). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T19:53:58Z. **Review:** COMMENTED --- `ReportAddress` writes the peer bytes before it checks whether the length can be written. The new copy-out exception fixture throws before `ReportAddress`, so its untouched-output assertion misses a failure of the second write. Could the fixture cover both output destinations independently and assert the intended peer-buffer contents after `accept` returns `EFAULT`? If that case should leave both outputs unchanged, check both guest spans before copying the address. Source review at `fc8023c3f1`. A trial merge onto `484e8e6b77` conflicts in the inherited libc and socket changes, preventing an integrated run on that base. 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/12965:upstream-pr/12965'
git switch 'upstream-pr/12965'

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/12965'
git switch 'upstream-pr/12965'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/12965'
git switch 'upstream-pr/12965'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/12965'
git switch 'main'
git merge --squash 'upstream-pr/12965'
git switch 'main'
git merge --ff-only 'upstream-pr/12965'
git switch 'main'
git merge 'upstream-pr/12965'
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!12965
No description provided.