test(net): accept variable stdio readiness #23167

Merged
DonRyuzaki merged 1 commit from upstream-pr/23167 into main 2026-11-18 20:07:29 +00:00
DonRyuzaki commented 2026-11-18 19:46:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by DonRyuzaki on 2026-11-18T19:46:35Z.


What

Current main can select redirected standard streams backed by host pipes. guest_sce_net assumed stdin is never readable and stdout/stderr are always writable; those readiness states can vary under CI redirection. Check that select returns only requested bits and that its count matches the ready bits, while retaining exact readiness checks for controlled files and pipes in guest_select.

This is a test-only follow-up to merged #19824. It also addresses the unrelated Windows test failure currently seen on #16632; it does not change FreeType behavior.

Tested

  • Base upstream main 6286d364496d41fcff8b032742ba0ace2972b6a1; branch head b73dd77bda1680a0d88db26da4fbe29359ed6929. Only core/libs/tests/GuestSceNet.cpp changes.
  • Ubuntu 24.04 under WSL2, GCC 13.3, Release, BUILD_TESTING=ON: built guest_sce_net_tests on current main with the exact proposed test file overlaid; ctest --test-dir build --no-tests=error --output-on-failure -R '^guest_sce_net$' passed 1/1. The temporary overlay was removed and the other PR worktree restored clean.
  • git diff --check upstream/main HEAD passed. python3 tools/check_conventions.py --base upstream/main passed on this head. The required --base origin/main invocation also ran, but the fork’s origin/main is stale and included unrelated upstream findings.
  • tools/pr_overlap.py --branch could not start because gh is unavailable. Manual comparison found open #22573, #5836, #16826, #21705 and #22992 touch separate GuestSceNet.cpp hunks; none changes the stdio assertion.
  • No local Windows runtime, title, console or GPU execution is claimed. The hosted Windows check will test the CI case.

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: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5382925439 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23167). Originally posted by [DonRyuzaki](https://github.com/DonRyuzaki) on 2026-11-18T19:46:35Z. --- ### What Current main can select redirected standard streams backed by host pipes. `guest_sce_net` assumed stdin is never readable and stdout/stderr are always writable; those readiness states can vary under CI redirection. Check that select returns only requested bits and that its count matches the ready bits, while retaining exact readiness checks for controlled files and pipes in `guest_select`. This is a test-only follow-up to merged #19824. It also addresses the unrelated Windows test failure currently seen on #16632; it does not change FreeType behavior. ### 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. --> - Base upstream main `6286d364496d41fcff8b032742ba0ace2972b6a1`; branch head `b73dd77bda1680a0d88db26da4fbe29359ed6929`. Only `core/libs/tests/GuestSceNet.cpp` changes. - Ubuntu 24.04 under WSL2, GCC 13.3, Release, `BUILD_TESTING=ON`: built `guest_sce_net_tests` on current main with the exact proposed test file overlaid; `ctest --test-dir build --no-tests=error --output-on-failure -R '^guest_sce_net$'` passed 1/1. The temporary overlay was removed and the other PR worktree restored clean. - `git diff --check upstream/main HEAD` passed. `python3 tools/check_conventions.py --base upstream/main` passed on this head. The required `--base origin/main` invocation also ran, but the fork’s `origin/main` is stale and included unrelated upstream findings. - `tools/pr_overlap.py --branch` could not start because `gh` is unavailable. Manual comparison found open #22573, #5836, #16826, #21705 and #22992 touch separate `GuestSceNet.cpp` hunks; none changes the stdio assertion. - No local Windows runtime, title, console or GPU execution is claimed. The hosted Windows check will test the CI case. ### 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: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
PrivacyOnion commented 2026-11-18 19:55:24 +00:00 (Migrated from github.com)

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

Review: APPROVED


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

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_sce_net_tests built cleanly.
  • CTest (guest_sce_net, guest_net_inet_pton_source_faults):
    1/2 Test #4705: guest_net_inet_pton_source_faults ...   Passed    0.04 sec
    2/2 Test #4704: guest_sce_net .......................   Passed    1.74 sec
    100% tests passed, 0 tests failed out of 2
    
  • Code reading:
    • Verified bitmask assertions in core/libs/tests/GuestSceNet.cpp lines 3189-3191: ensures ready bits in stdio_readable[0] and stdio_writable[0] are strictly subsets of the requested masks (0b001 and 0b110 respectively)
    • Verified return value consistency in core/libs/tests/GuestSceNet.cpp line 3190: verifies that select_nid_postfix return count equals the exact sum of set bits across stdio_readable and stdio_writable
    • Verified stdin-only select check in core/libs/tests/GuestSceNet.cpp lines 3193-3194: ensures stdio_readable[0] <= 1 and returned ready count equals stdio_readable[0]
    • Audited 64-bit integer bit shifts and masking for potential undefined behavior or truncation on LP64 and LLP64 platforms
    • Checked compliance with AGENTS.md: zero code comments added, no forbidden files or stubs, and conventions checks passed cleanly

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5963980448 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23167#pullrequestreview-5963980448). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-18T19:55:24Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `b73dd77bda`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_sce_net_tests` built cleanly. - **CTest** (`guest_sce_net`, `guest_net_inet_pton_source_faults`): ``` 1/2 Test #4705: guest_net_inet_pton_source_faults ... Passed 0.04 sec 2/2 Test #4704: guest_sce_net ....................... Passed 1.74 sec 100% tests passed, 0 tests failed out of 2 ``` - **Code reading**: - Verified bitmask assertions in core/libs/tests/GuestSceNet.cpp lines 3189-3191: ensures ready bits in stdio_readable[0] and stdio_writable[0] are strictly subsets of the requested masks (0b001 and 0b110 respectively) - Verified return value consistency in core/libs/tests/GuestSceNet.cpp line 3190: verifies that select_nid_postfix return count equals the exact sum of set bits across stdio_readable and stdio_writable - Verified stdin-only select check in core/libs/tests/GuestSceNet.cpp lines 3193-3194: ensures stdio_readable[0] <= 1 and returned ready count equals stdio_readable[0] - Audited 64-bit integer bit shifts and masking for potential undefined behavior or truncation on LP64 and LLP64 platforms - Checked compliance with AGENTS.md: zero code comments added, no forbidden files or stubs, and conventions checks passed cleanly Looks Good To Me
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!23167
No description provided.