fix(kernel): handle redirected standard pipes #19824

Merged
DonRyuzaki merged 3 commits from upstream-pr/19824 into main 2026-11-18 16:32:04 +00:00
DonRyuzaki commented 2026-11-14 00:38:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by DonRyuzaki on 2026-11-14T00:38:14Z.


What

Classify real pipes before applying standard-descriptor console readiness assumptions. Currently queued input on a pipe duplicated onto descriptor 0, 1 or 2 is ignored by select/poll, and poll treats redirected output as writable even under pipe backpressure.

Use the existing pipe readiness paths for those descriptors. Preserve the non-pipe console fallback and its errno behavior. Make the old console fixture use a valid non-pipe null device, independent of CTest's pipe stdin; restore standard descriptors before asserting or rethrowing.

Tested

Linux, Ubuntu 24.04 under WSL2, GCC 13.3, Release; base 6fd2999417948562be633aa71629bab45d0e8b81, head 156f7723601dad71e775e8c38293c061023bfcff, tree db50f7aaa75b1771950e8694d37ffcb81442007f.

  • Reproduced PrivacyOnion's reported guest_select_wait failure on the previous exact head b38d4a7890a9ff465aa2b9f3c3dbe1f4843a1c96: select with no ready device did not time out. The inherited CTest stdin pipe can be readable at EOF after the corrected pipe classification. The test now temporarily installs a controlled non-pipe null device and restores the original descriptor even on exceptions. Timeout and bitmap assertions are unchanged; production pipe logic is unchanged by this review fix.
  • Full runtime: cmake --build build --target libs guest_poll_tests guest_select_tests guest_select_wait_tests --parallel 8 passes on this exact head.
  • ctest --test-dir build --no-tests=error --output-on-failure -R '^guest_(poll|select|select_wait)$': 3/3 pass, zero skips, 9.73 seconds locally.
  • Negative control: unchanged base plus only the three current fixtures fails the redirected-pipe regressions in poll and select (descriptor=0 ready=0); the controlled-device wait fixture passes. Local test-only baseline fixture 99629f67786bdf16d9419ad91ce89f8344251877. Reproduce by applying only these changed test files to the base.
  • Pipe coverage redirects each of descriptors 0, 1 and 2 onto real pipe ends: empty/queued/consumed/EOF input, writable output, backpressure and reader-close behavior. Existing socket, vnode, random-device, kqueue, invalid-pointer and wait checks remain.
  • Windows GCC 15.2 Release object compilation passes for GuestPoll.cpp, GuestSelect.cpp and GuestSelectWait.cpp. This is compile-only evidence; no Windows linking or runtime execution is claimed for the platform-specific pipe-query path.
  • Configured with BUILD_TESTING=ON, FT_ENABLE_ERROR_STRINGS=OFF, CMAKE_LINK_DEPENDS_NO_SHARED=ON. Conventions and literal git diff --check pass.
  • Fresh full branch overlap checking required manual comparison of eight exact heads: #11896, #12682, #12688, #12700, #12965, #14970, #17253 and #17853. All complete reported shared-file diffs were reviewed; unchanged prior reviews were reused only after exact-head and full-diff hash equality checks. No competing standard-pipe implementation or blocking semantic interaction was found. This is a manual assessment, not a clean checker exit. Preserve #17853's distinct EBADF close-race fix if it lands; this PR does not claim all descriptor-close races are solved.
  • The include-order-only conflict with #19631 was removed. Actual git merge-tree --write-tree against its head 17bebb404f8dd4f5db013095f3d9d073f1dd118f succeeds.
  • No game, GPU, or console-hardware execution claimed; no new export signature or console-success fallback is introduced.

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
  • 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: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5305175078 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19824). Originally posted by [DonRyuzaki](https://github.com/DonRyuzaki) on 2026-11-14T00:38:14Z. --- ### What Classify real pipes before applying standard-descriptor console readiness assumptions. Currently queued input on a pipe duplicated onto descriptor 0, 1 or 2 is ignored by select/poll, and poll treats redirected output as writable even under pipe backpressure. Use the existing pipe readiness paths for those descriptors. Preserve the non-pipe console fallback and its errno behavior. Make the old console fixture use a valid non-pipe null device, independent of CTest's pipe stdin; restore standard descriptors before asserting or rethrowing. ### 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. --> Linux, Ubuntu 24.04 under WSL2, GCC 13.3, Release; base `6fd2999417948562be633aa71629bab45d0e8b81`, head `156f7723601dad71e775e8c38293c061023bfcff`, tree `db50f7aaa75b1771950e8694d37ffcb81442007f`. - Reproduced PrivacyOnion's reported `guest_select_wait` failure on the previous exact head `b38d4a7890a9ff465aa2b9f3c3dbe1f4843a1c96`: `select with no ready device did not time out`. The inherited CTest stdin pipe can be readable at EOF after the corrected pipe classification. The test now temporarily installs a controlled non-pipe null device and restores the original descriptor even on exceptions. Timeout and bitmap assertions are unchanged; production pipe logic is unchanged by this review fix. - Full runtime: `cmake --build build --target libs guest_poll_tests guest_select_tests guest_select_wait_tests --parallel 8` passes on this exact head. - `ctest --test-dir build --no-tests=error --output-on-failure -R '^guest_(poll|select|select_wait)$'`: 3/3 pass, zero skips, 9.73 seconds locally. - Negative control: unchanged base plus only the three current fixtures fails the redirected-pipe regressions in poll and select (`descriptor=0 ready=0`); the controlled-device wait fixture passes. Local test-only baseline fixture `99629f67786bdf16d9419ad91ce89f8344251877`. Reproduce by applying only these changed test files to the base. - Pipe coverage redirects each of descriptors 0, 1 and 2 onto real pipe ends: empty/queued/consumed/EOF input, writable output, backpressure and reader-close behavior. Existing socket, vnode, random-device, kqueue, invalid-pointer and wait checks remain. - Windows GCC 15.2 Release object compilation passes for GuestPoll.cpp, GuestSelect.cpp and GuestSelectWait.cpp. This is compile-only evidence; no Windows linking or runtime execution is claimed for the platform-specific pipe-query path. - Configured with `BUILD_TESTING=ON`, `FT_ENABLE_ERROR_STRINGS=OFF`, `CMAKE_LINK_DEPENDS_NO_SHARED=ON`. Conventions and literal `git diff --check` pass. - Fresh full branch overlap checking required manual comparison of eight exact heads: #11896, #12682, #12688, #12700, #12965, #14970, #17253 and #17853. All complete reported shared-file diffs were reviewed; unchanged prior reviews were reused only after exact-head and full-diff hash equality checks. No competing standard-pipe implementation or blocking semantic interaction was found. This is a manual assessment, not a clean checker exit. Preserve #17853's distinct EBADF close-race fix if it lands; this PR does not claim all descriptor-close races are solved. - The include-order-only conflict with #19631 was removed. Actual `git merge-tree --write-tree` against its head `17bebb404f8dd4f5db013095f3d9d073f1dd118f` succeeds. - No game, GPU, or console-hardware execution claimed; no new export signature or console-success fallback is introduced. ### 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) - [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: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
PrivacyOnion commented 2026-11-14 00:39:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-14T00:39:18Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against b38d4a7890:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_poll_tests, guest_select_tests built cleanly.
  • CTest (guest_poll, guest_select_wait, guest_select):
    1/3 Test #4807: guest_select_wait ................Subprocess aborted***Exception:   0.22 sec
    2/3 Test #4808: guest_select .....................   Passed    4.70 sec
    3/3 Test #4806: guest_poll .......................   Passed    4.81 sec
    67% tests passed, 1 tests failed out of 3
    
    The following tests FAILED:
    
  • Note: the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5900082024 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19824#pullrequestreview-5900082024). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-14T00:39:18Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `b38d4a7890`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_poll_tests`, `guest_select_tests` built cleanly. - **CTest** (`guest_poll`, `guest_select_wait`, `guest_select`): ``` 1/3 Test #4807: guest_select_wait ................Subprocess aborted***Exception: 0.22 sec 2/3 Test #4808: guest_select ..................... Passed 4.70 sec 3/3 Test #4806: guest_poll ....................... Passed 4.81 sec 67% tests passed, 1 tests failed out of 3 ``` ``` The following tests FAILED: ``` - Note: the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-15 20:24:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T20:24:06Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 156f772360:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_poll_tests, guest_select_tests, guest_select_wait_tests built cleanly.
  • CTest (guest_poll, guest_select_wait, guest_select):
    1/3 Test #4807: guest_select_wait ................   Passed    0.15 sec
    2/3 Test #4808: guest_select .....................   Passed    4.96 sec
    3/3 Test #4806: guest_poll .......................   Passed    5.10 sec
    100% tests passed, 0 tests failed out of 3
    
  • Negative control: with core/libs/prx/libkernel/Socket/src/Socket.cpp, core/libs/prx/libkernel/Socket/src/Udp.cpp reverted to main and the new tests kept, the suite fails:
    1/3 Test #4806: guest_poll .......................Subprocess aborted***Exception:   0.35 sec
    2/3 Test #4808: guest_select .....................Subprocess aborted***Exception:   0.41 sec
    3/3 Test #4807: guest_select_wait ................   Passed    0.08 sec
    33% tests passed, 2 tests failed out of 3
    
    Restoring the change makes it pass again.
  • Code reading:
    • core/libs/prx/libkernel/Socket/src/Socket.cpp: Verified StandardPipe correctly classifies descriptors 0, 1, and 2 using fstat/S_ISFIFO on POSIX and DescriptorIsOpen_nid_no_patch/GuestSockets::PipeReady on Windows while preserving errno via savedError.
    • core/libs/prx/libkernel/Socket/src/Socket.cpp: Verified SelectDescriptors routes standard pipes to net.entries/HostPoll and preserves console fallback readiness for non-pipe standard descriptors.
    • core/libs/prx/libkernel/Socket/src/Udp.cpp: Verified PollDescriptors executes IsPipe/PipeReadiness before standard descriptor console fallback and preserves caller errno on fallback branches.
    • core/libs/tests/GuestPoll.cpp and core/libs/tests/GuestSelect.cpp: Verified WithStandardPipe safely duplicates and restores standard descriptors across empty, queued, EOF, writable, and full-pipe backpressure states without descriptor leaks.
    • core/libs/tests/GuestSelectWait.cpp: Verified WithStandardDevice safely redirects descriptors to /dev/null or NUL and restores descriptors before asserting or rethrowing.
    • Repository rules (AGENTS.md): Verified absence of unauthorized comments in code (only permitted #endif present), no fake stubs or special-casing, Conventional Commit title, and clean cross-platform LP64/LLP64 #ifdef _WIN32 abstraction.
  • Note: the AI-assisted checkbox can stay.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5912737635 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19824#pullrequestreview-5912737635). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-15T20:24:06Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `156f772360`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_poll_tests`, `guest_select_tests`, `guest_select_wait_tests` built cleanly. - **CTest** (`guest_poll`, `guest_select_wait`, `guest_select`): ``` 1/3 Test #4807: guest_select_wait ................ Passed 0.15 sec 2/3 Test #4808: guest_select ..................... Passed 4.96 sec 3/3 Test #4806: guest_poll ....................... Passed 5.10 sec 100% tests passed, 0 tests failed out of 3 ``` - **Negative control**: with `core/libs/prx/libkernel/Socket/src/Socket.cpp`, `core/libs/prx/libkernel/Socket/src/Udp.cpp` reverted to `main` and the new tests kept, the suite fails: ``` 1/3 Test #4806: guest_poll .......................Subprocess aborted***Exception: 0.35 sec 2/3 Test #4808: guest_select .....................Subprocess aborted***Exception: 0.41 sec 3/3 Test #4807: guest_select_wait ................ Passed 0.08 sec 33% tests passed, 2 tests failed out of 3 ``` Restoring the change makes it pass again. - **Code reading**: - core/libs/prx/libkernel/Socket/src/Socket.cpp: Verified StandardPipe correctly classifies descriptors 0, 1, and 2 using fstat/S_ISFIFO on POSIX and DescriptorIsOpen_nid_no_patch/GuestSockets::PipeReady on Windows while preserving errno via savedError. - core/libs/prx/libkernel/Socket/src/Socket.cpp: Verified SelectDescriptors routes standard pipes to net.entries/HostPoll and preserves console fallback readiness for non-pipe standard descriptors. - core/libs/prx/libkernel/Socket/src/Udp.cpp: Verified PollDescriptors executes IsPipe/PipeReadiness before standard descriptor console fallback and preserves caller errno on fallback branches. - core/libs/tests/GuestPoll.cpp and core/libs/tests/GuestSelect.cpp: Verified WithStandardPipe safely duplicates and restores standard descriptors across empty, queued, EOF, writable, and full-pipe backpressure states without descriptor leaks. - core/libs/tests/GuestSelectWait.cpp: Verified WithStandardDevice safely redirects descriptors to /dev/null or NUL and restores descriptors before asserting or rethrowing. - Repository rules (AGENTS.md): Verified absence of unauthorized comments in code (only permitted #endif present), no fake stubs or special-casing, Conventional Commit title, and clean cross-platform LP64/LLP64 #ifdef _WIN32 abstraction. - Note: the AI-assisted checkbox can stay. Looks Good To Me
PrivacyOnion commented 2026-11-15 20:24:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T20:24:07Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 156f772360:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_poll_tests, guest_select_tests, guest_select_wait_tests built cleanly.
  • CTest (guest_poll, guest_select_wait, guest_select):
    1/3 Test #4807: guest_select_wait ................   Passed    0.15 sec
    2/3 Test #4808: guest_select .....................   Passed    4.96 sec
    3/3 Test #4806: guest_poll .......................   Passed    5.10 sec
    100% tests passed, 0 tests failed out of 3
    
  • Negative control: with core/libs/prx/libkernel/Socket/src/Socket.cpp, core/libs/prx/libkernel/Socket/src/Udp.cpp reverted to main and the new tests kept, the suite fails:
    1/3 Test #4806: guest_poll .......................Subprocess aborted***Exception:   0.35 sec
    2/3 Test #4808: guest_select .....................Subprocess aborted***Exception:   0.41 sec
    3/3 Test #4807: guest_select_wait ................   Passed    0.08 sec
    33% tests passed, 2 tests failed out of 3
    
    Restoring the change makes it pass again.
  • Code reading:
    • core/libs/prx/libkernel/Socket/src/Socket.cpp: Verified StandardPipe correctly classifies descriptors 0, 1, and 2 using fstat/S_ISFIFO on POSIX and DescriptorIsOpen_nid_no_patch/GuestSockets::PipeReady on Windows while preserving errno via savedError.
    • core/libs/prx/libkernel/Socket/src/Socket.cpp: Verified SelectDescriptors routes standard pipes to net.entries/HostPoll and preserves console fallback readiness for non-pipe standard descriptors.
    • core/libs/prx/libkernel/Socket/src/Udp.cpp: Verified PollDescriptors executes IsPipe/PipeReadiness before standard descriptor console fallback and preserves caller errno on fallback branches.
    • core/libs/tests/GuestPoll.cpp and core/libs/tests/GuestSelect.cpp: Verified WithStandardPipe safely duplicates and restores standard descriptors across empty, queued, EOF, writable, and full-pipe backpressure states without descriptor leaks.
    • core/libs/tests/GuestSelectWait.cpp: Verified WithStandardDevice safely redirects descriptors to /dev/null or NUL and restores descriptors before asserting or rethrowing.
    • Repository rules (AGENTS.md): Verified absence of unauthorized comments in code (only permitted #endif present), no fake stubs or special-casing, Conventional Commit title, and clean cross-platform LP64/LLP64 #ifdef _WIN32 abstraction.
  • Note: the AI-assisted checkbox can stay.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5912737761 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19824#pullrequestreview-5912737761). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-15T20:24:07Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `156f772360`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_poll_tests`, `guest_select_tests`, `guest_select_wait_tests` built cleanly. - **CTest** (`guest_poll`, `guest_select_wait`, `guest_select`): ``` 1/3 Test #4807: guest_select_wait ................ Passed 0.15 sec 2/3 Test #4808: guest_select ..................... Passed 4.96 sec 3/3 Test #4806: guest_poll ....................... Passed 5.10 sec 100% tests passed, 0 tests failed out of 3 ``` - **Negative control**: with `core/libs/prx/libkernel/Socket/src/Socket.cpp`, `core/libs/prx/libkernel/Socket/src/Udp.cpp` reverted to `main` and the new tests kept, the suite fails: ``` 1/3 Test #4806: guest_poll .......................Subprocess aborted***Exception: 0.35 sec 2/3 Test #4808: guest_select .....................Subprocess aborted***Exception: 0.41 sec 3/3 Test #4807: guest_select_wait ................ Passed 0.08 sec 33% tests passed, 2 tests failed out of 3 ``` Restoring the change makes it pass again. - **Code reading**: - core/libs/prx/libkernel/Socket/src/Socket.cpp: Verified StandardPipe correctly classifies descriptors 0, 1, and 2 using fstat/S_ISFIFO on POSIX and DescriptorIsOpen_nid_no_patch/GuestSockets::PipeReady on Windows while preserving errno via savedError. - core/libs/prx/libkernel/Socket/src/Socket.cpp: Verified SelectDescriptors routes standard pipes to net.entries/HostPoll and preserves console fallback readiness for non-pipe standard descriptors. - core/libs/prx/libkernel/Socket/src/Udp.cpp: Verified PollDescriptors executes IsPipe/PipeReadiness before standard descriptor console fallback and preserves caller errno on fallback branches. - core/libs/tests/GuestPoll.cpp and core/libs/tests/GuestSelect.cpp: Verified WithStandardPipe safely duplicates and restores standard descriptors across empty, queued, EOF, writable, and full-pipe backpressure states without descriptor leaks. - core/libs/tests/GuestSelectWait.cpp: Verified WithStandardDevice safely redirects descriptors to /dev/null or NUL and restores descriptors before asserting or rethrowing. - Repository rules (AGENTS.md): Verified absence of unauthorized comments in code (only permitted #endif present), no fake stubs or special-casing, Conventional Commit title, and clean cross-platform LP64/LLP64 #ifdef _WIN32 abstraction. - Note: the AI-assisted checkbox can stay. Looks Good To Me
PrivacyOnion commented 2026-11-18 16:18:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T16:18:24Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 967cbb82db:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_poll_tests, guest_select_tests, guest_select_wait_tests built cleanly.
  • CTest (guest_poll, guest_select_wait, guest_select):
    1/3 Test #5624: guest_select .....................   Passed    4.74 sec
    2/3 Test #5623: guest_select_wait ................   Passed    0.07 sec
    3/3 Test #5622: guest_poll .......................   Passed    4.81 sec
    100% tests passed, 0 tests failed out of 3
    
  • Negative control: with core/libs/prx/libkernel/Socket/src/Socket.cpp, core/libs/prx/libkernel/Socket/src/Udp.cpp reverted to main and the new tests kept, the suite fails:
    1/3 Test #5622: guest_poll .......................Subprocess aborted***Exception:   0.13 sec
    2/3 Test #5624: guest_select .....................Subprocess aborted***Exception:   0.15 sec
    3/3 Test #5623: guest_select_wait ................   Passed    0.07 sec
    33% tests passed, 2 tests failed out of 3
    
    Restoring the change makes it pass again.
  • Code reading:
    • core/libs/prx/libkernel/Socket/src/Socket.cpp: Verified StandardPipe correctly preserves errno via savedError across fstat and Windows GuestSockets::PipeReady probes and accurately identifies descriptors 0, 1, and 2 as FIFOs/pipes.
    • core/libs/prx/libkernel/Socket/src/Socket.cpp: Verified SelectDescriptors routes standard pipes to net.entries and HostPoll while keeping non-pipe standard descriptors on the console fallback devices list.
    • core/libs/prx/libkernel/Socket/src/Udp.cpp: Verified PollDescriptors evaluates pipe readiness before standard console fallback, handles unknownEvents appropriately, and restores savedError before setting revents on console fallback descriptors.
    • core/libs/tests/GuestPoll.cpp and GuestSelect.cpp: Verified WithStandardPipe creates valid non-standard descriptor endpoints, correctly sets non-blocking write modes where needed, and cleans up all duplicated descriptors even if an exception is thrown.
    • core/libs/tests/GuestSelectWait.cpp: Verified WithStandardDevice opens /dev/null or NUL safely and restores original standard descriptors prior to assertions or exception propagation.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5960611227 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19824#pullrequestreview-5960611227). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-18T16:18:24Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `967cbb82db`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_poll_tests`, `guest_select_tests`, `guest_select_wait_tests` built cleanly. - **CTest** (`guest_poll`, `guest_select_wait`, `guest_select`): ``` 1/3 Test #5624: guest_select ..................... Passed 4.74 sec 2/3 Test #5623: guest_select_wait ................ Passed 0.07 sec 3/3 Test #5622: guest_poll ....................... Passed 4.81 sec 100% tests passed, 0 tests failed out of 3 ``` - **Negative control**: with `core/libs/prx/libkernel/Socket/src/Socket.cpp`, `core/libs/prx/libkernel/Socket/src/Udp.cpp` reverted to `main` and the new tests kept, the suite fails: ``` 1/3 Test #5622: guest_poll .......................Subprocess aborted***Exception: 0.13 sec 2/3 Test #5624: guest_select .....................Subprocess aborted***Exception: 0.15 sec 3/3 Test #5623: guest_select_wait ................ Passed 0.07 sec 33% tests passed, 2 tests failed out of 3 ``` Restoring the change makes it pass again. - **Code reading**: - core/libs/prx/libkernel/Socket/src/Socket.cpp: Verified StandardPipe correctly preserves errno via savedError across fstat and Windows GuestSockets::PipeReady probes and accurately identifies descriptors 0, 1, and 2 as FIFOs/pipes. - core/libs/prx/libkernel/Socket/src/Socket.cpp: Verified SelectDescriptors routes standard pipes to net.entries and HostPoll while keeping non-pipe standard descriptors on the console fallback devices list. - core/libs/prx/libkernel/Socket/src/Udp.cpp: Verified PollDescriptors evaluates pipe readiness before standard console fallback, handles unknownEvents appropriately, and restores savedError before setting revents on console fallback descriptors. - core/libs/tests/GuestPoll.cpp and GuestSelect.cpp: Verified WithStandardPipe creates valid non-standard descriptor endpoints, correctly sets non-blocking write modes where needed, and cleans up all duplicated descriptors even if an exception is thrown. - core/libs/tests/GuestSelectWait.cpp: Verified WithStandardDevice opens /dev/null or NUL safely and restores original standard descriptors prior to assertions or exception propagation. Looks Good To Me
MarcZX10 commented 2026-11-18 16:23:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T16:23:40Z.

Review: APPROVED


Reviewed — looks good

The reviewed change routes redirected standard pipes through pipe readiness handling and adds regression coverage for poll and select at descriptors 0–2.

What I ran

Reviewed head 967cbb82db30517a7cf35aaf8c7136375b173e40. I read the prepared description, commits, diff, manifest, and all five changed repository files at the pinned head using repo_read.py; I did not run commands or tests. The description reports Linux runtime tests and Windows compile-only checks, which I did not independently run.

Results

Check Result Note
Changed code review passed All five reviewed files read
Runtime tests not run Author reports three targeted tests pass
Windows runtime not run Author reports compile-only evidence

Findings

Blocking

None.

Non-blocking

None.

Not verified

I did not independently run the reported Linux tests or Windows compilation, and did not verify console or game behavior. All files listed as reviewed in the manifest were read: Socket.cpp, Udp.cpp, GuestPoll.cpp, GuestSelect.cpp, and GuestSelectWait.cpp. No files were excluded by the manifest.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5960700515 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19824#pullrequestreview-5960700515). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-18T16:23:40Z. **Review:** APPROVED --- # Reviewed — looks good The reviewed change routes redirected standard pipes through pipe readiness handling and adds regression coverage for poll and select at descriptors 0–2. ## What I ran Reviewed head `967cbb82db30517a7cf35aaf8c7136375b173e40`. I read the prepared description, commits, diff, manifest, and all five changed repository files at the pinned head using `repo_read.py`; I did not run commands or tests. The description reports Linux runtime tests and Windows compile-only checks, which I did not independently run. ## Results | Check | Result | Note | |---|---|---| | Changed code review | passed | All five reviewed files read | | Runtime tests | not run | Author reports three targeted tests pass | | Windows runtime | not run | Author reports compile-only evidence | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified I did not independently run the reported Linux tests or Windows compilation, and did not verify console or game behavior. All files listed as reviewed in the manifest were read: `Socket.cpp`, `Udp.cpp`, `GuestPoll.cpp`, `GuestSelect.cpp`, and `GuestSelectWait.cpp`. No files were excluded by the manifest. ## To get this to a good state Nothing is required.
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!19824
No description provided.