test(libSceNet): allow more timed sends before the blocking-send test expects EAGAIN #8918

Merged
xXPBSXx merged 1 commit from upstream-pr/8918 into main 2026-10-21 19:23:14 +00:00
xXPBSXx commented 2026-10-21 06:10:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T06:10:05Z.


What

Allow up to 64 timed sends (was 16) in NetBlockingSend before the test expects EAGAIN. The loop still stops at the first EAGAIN and the byte-count checks are unchanged, so it asserts what it did before. On a Linux host whose loopback receive buffer autotunes up to 32 MiB (net.ipv4.tcp_rmem max 33554432), 16 sends of at most 4 MiB do not fill it and net_dontwait_blocking_send, _sendto and _sendmsg fail with "peer never exhausted the send buffers".

Fixes #8917

Tested

  • Linux (WSL2 Ubuntu 24.04, GCC 13.3, Release; a virtualised kernel, not bare-metal): the three tests fail on main fa9eb5cfac and pass with the change (4 of 4 of -R net_dontwait_blocking, about 5.3 s each). In that full ctest run 3 of 1771 tests failed, all three these.
  • Windows 10, MinGW-w64 GCC 15.2, Release: the three tests pass (1.5 to 3 s).
  • python tools/check_conventions.py --base upstream/main passes; git merge-tree against main is clean.
  • Not tested: macOS; a Linux host with the stock 6 MiB receive-buffer maximum (I did not measure whether the tests are already green there).

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 #8917
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4947219411 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8918). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-21T06:10:05Z. --- ### What Allow up to 64 timed sends (was 16) in `NetBlockingSend` before the test expects EAGAIN. The loop still stops at the first EAGAIN and the byte-count checks are unchanged, so it asserts what it did before. On a Linux host whose loopback receive buffer autotunes up to 32 MiB (`net.ipv4.tcp_rmem` max 33554432), 16 sends of at most 4 MiB do not fill it and `net_dontwait_blocking_send`, `_sendto` and `_sendmsg` fail with "peer never exhausted the send buffers". Fixes #8917 ### Tested - Linux (WSL2 Ubuntu 24.04, GCC 13.3, Release; a virtualised kernel, not bare-metal): the three tests fail on `main` fa9eb5cfac and pass with the change (4 of 4 of `-R net_dontwait_blocking`, about 5.3 s each). In that full ctest run 3 of 1771 tests failed, all three these. - Windows 10, MinGW-w64 GCC 15.2, Release: the three tests pass (1.5 to 3 s). - `python tools/check_conventions.py --base upstream/main` passes; `git merge-tree` against `main` is clean. - Not tested: macOS; a Linux host with the stock 6 MiB receive-buffer maximum (I did not measure whether the tests are already green there). ### Checklist - [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 #8917 - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes AI-assisted (Claude Code).
MarcZX10 commented 2026-10-21 06:15:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T06:15:37Z.


I opened #8922 before I saw this PR, so both changes target #8917. Your exact-head Linux and Windows runs are useful. One alternative worth considering: set the receiver to a small SO_RCVBUF in this unread-peer timeout block on Linux, leaving the Windows setup unchanged. I reproduced the first partial send followed by a timeout within two retries with a 4 KiB receiver buffer. That makes the retry count independent of a host's tcp_rmem maximum and avoids spending several seconds probing a large receive window. #8922 has that focused change; please use whichever approach you think fits the test best.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6309431481 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8918#issuecomment-6309431481). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T06:15:37Z. --- I opened #8922 before I saw this PR, so both changes target #8917. Your exact-head Linux and Windows runs are useful. One alternative worth considering: set the receiver to a small `SO_RCVBUF` in this unread-peer timeout block on Linux, leaving the Windows setup unchanged. I reproduced the first partial send followed by a timeout within two retries with a 4 KiB receiver buffer. That makes the retry count independent of a host's `tcp_rmem` maximum and avoids spending several seconds probing a large receive window. #8922 has that focused change; please use whichever approach you think fits the test best.
MarcZX10 commented 2026-10-21 06:16:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T06:16:02Z.


Clarification: #8918 was already open when I created #8922; I failed to notice it in my duplicate check. Sorry for the overlap. #8922 is an alternative test setup, not an additional behavior fix. Your PR has stronger end-to-end evidence (including the three Linux and Windows tests); mine has only a Linux socket smoke reproduction and conventions checks, but constrains the receiver buffer instead of raising the retry bound. Please feel free to use whichever approach the maintainers prefer.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6309437266 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8918#issuecomment-6309437266). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T06:16:02Z. --- Clarification: #8918 was already open when I created #8922; I failed to notice it in my duplicate check. Sorry for the overlap. #8922 is an alternative test setup, not an additional behavior fix. Your PR has stronger end-to-end evidence (including the three Linux and Windows tests); mine has only a Linux socket smoke reproduction and conventions checks, but constrains the receiver buffer instead of raising the retry bound. Please feel free to use whichever approach the maintainers prefer.
veosett commented 2026-10-21 08:55:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by veosett on 2026-10-21T08:55:58Z.


Independent Windows/Linux comparison of the two alternatives for #8917: #8918 at aa56b002285182763ac422483bd384d309568ee5 and #8922 at de573c6d1ef287fe20a5e90f728712fef8e3bb0c.

Each unchanged patch was applied separately to the same current main, f894ba69d30055259a56907563f438379d1275a3. The local integration commits were 704bf4ae1ea7b1981df172820b5ec30f6526e8ec for #8918 and 3e1fbde9a8ec0767ce474d0eb28efaf58bb27fba for #8922. Each diff contains only its original NetBlockingSend.cpp change. These are integration results on the newer main, rather than builds of the PRs' older bases.

Release builds succeeded on Ubuntu 24.04 WSL (GCC 13.3) and Windows 11 Pro 10.0.26100 (supported WinLibs GCC 15.2.0 r7).

Blocking-send tests Main, once per test #8918, three repeats per test #8922, three repeats per test
Ubuntu 24.04 WSL All 3 fail: peer never exhausted the send buffers 9/9 pass 9/9 pass
Windows 11 3/3 pass 9/9 pass 9/9 pass

Every candidate run delivered and compared all 4,194,304 payload bytes and passed the existing timeout, abort and guest-nonblocking assertions. There were no skips or CTest timeouts. The longest affected candidate invocation across both hosts and patches was 5.10 s, within the unchanged 20 s timeout.

The eight neighboring net_dontwait_{send,sendto,sendmsg,recv,recvfrom,recvmsg,duplex,blocking} tests and guest_sce_net also passed once each on both hosts, on main and the #8922 integration. Those nine neighbors were not rerun for #8918.

Linux already had the reported limits: net.ipv4.tcp_rmem = 4096 131072 33554432, net.ipv4.tcp_wmem = 4096 16384 4194304, and both net.core.rmem_max and net.core.wmem_max were 4194304. These settings were read without changing them.

ctest --test-dir <build> -R '^net_dontwait_blocking_(send|sendto|sendmsg)$' -V --parallel 1 --repeat until-fail:3
ctest --test-dir <build> -R '^(net_dontwait_(send|sendto|sendmsg|recv|recvfrom|recvmsg|duplex|blocking)|guest_sce_net)$' -V --parallel 1

Main used the same commands without the repeat option. Both alternatives fix the reproduced Linux failure in this environment; only one needs to land. I favor #8922 for this fixture because it explicitly bounds the unread receiver queue in the timeout case, keeping the existing retry budget.

No full suite, macOS, title or console run, and no claim of a production networking change. AI-assisted verification; I ran the builds and tests locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6312058608 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8918#issuecomment-6312058608). Originally posted by [veosett](https://github.com/veosett) on 2026-10-21T08:55:58Z. --- Independent Windows/Linux comparison of the two alternatives for #8917: #8918 at `aa56b002285182763ac422483bd384d309568ee5` and #8922 at `de573c6d1ef287fe20a5e90f728712fef8e3bb0c`. Each unchanged patch was applied separately to the same current `main`, `f894ba69d30055259a56907563f438379d1275a3`. The local integration commits were `704bf4ae1ea7b1981df172820b5ec30f6526e8ec` for #8918 and `3e1fbde9a8ec0767ce474d0eb28efaf58bb27fba` for #8922. Each diff contains only its original `NetBlockingSend.cpp` change. These are integration results on the newer main, rather than builds of the PRs' older bases. Release builds succeeded on Ubuntu 24.04 WSL (GCC 13.3) and Windows 11 Pro 10.0.26100 (supported WinLibs GCC 15.2.0 r7). | Blocking-send tests | Main, once per test | #8918, three repeats per test | #8922, three repeats per test | | --- | --- | --- | --- | | Ubuntu 24.04 WSL | All 3 fail: `peer never exhausted the send buffers` | 9/9 pass | 9/9 pass | | Windows 11 | 3/3 pass | 9/9 pass | 9/9 pass | Every candidate run delivered and compared all 4,194,304 payload bytes and passed the existing timeout, abort and guest-nonblocking assertions. There were no skips or CTest timeouts. The longest affected candidate invocation across both hosts and patches was 5.10 s, within the unchanged 20 s timeout. The eight neighboring `net_dontwait_{send,sendto,sendmsg,recv,recvfrom,recvmsg,duplex,blocking}` tests and `guest_sce_net` also passed once each on both hosts, on main and the #8922 integration. Those nine neighbors were not rerun for #8918. Linux already had the reported limits: `net.ipv4.tcp_rmem = 4096 131072 33554432`, `net.ipv4.tcp_wmem = 4096 16384 4194304`, and both `net.core.rmem_max` and `net.core.wmem_max` were 4194304. These settings were read without changing them. ```sh ctest --test-dir <build> -R '^net_dontwait_blocking_(send|sendto|sendmsg)$' -V --parallel 1 --repeat until-fail:3 ctest --test-dir <build> -R '^(net_dontwait_(send|sendto|sendmsg|recv|recvfrom|recvmsg|duplex|blocking)|guest_sce_net)$' -V --parallel 1 ``` Main used the same commands without the repeat option. Both alternatives fix the reproduced Linux failure in this environment; only one needs to land. I favor #8922 for this fixture because it explicitly bounds the unread receiver queue in the timeout case, keeping the existing retry budget. No full suite, macOS, title or console run, and no claim of a production networking change. AI-assisted verification; I ran the builds and tests locally.
xXPBSXx commented 2026-10-21 09:28:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T09:28:30Z.


Thanks @veosett for the side-by-side run and @MarcZX10 for the alternative.

My own Linux run (Ubuntu 24.04 on WSL2, GCC 13.3, Release, net.ipv4.tcp_rmem max 33554432; a virtualised kernel, not bare-metal) agrees with the table: main fails net_dontwait_blocking_send, _sendto and _sendmsg; #8918 passes them (about 5.3 s per test in my run) and #8922 at de573c6d1e passes all three three times each (9 of 9, about 3 s per test; the two numbers come from separate runs). Windows for both is covered by veosett's table, so I did not run it again.

The two differ in construction: #8918 raises the retry bound from 16 to 64, which relies on the receive-buffer ceiling of the host; #8922 caps the receiver at a small SO_RCVBUF on Linux, so the number of retries does not depend on tcp_rmem by construction (I only ran it with the 33554432 maximum).

Only one of them needs to land. I am happy to close #8918 in favour of #8922 if the maintainers prefer it, and I will leave it open until you or @MarcZX10 say so.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6312657618 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8918#issuecomment-6312657618). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-21T09:28:30Z. --- Thanks @veosett for the side-by-side run and @MarcZX10 for the alternative. My own Linux run (Ubuntu 24.04 on WSL2, GCC 13.3, Release, `net.ipv4.tcp_rmem` max 33554432; a virtualised kernel, not bare-metal) agrees with the table: `main` fails `net_dontwait_blocking_send`, `_sendto` and `_sendmsg`; #8918 passes them (about 5.3 s per test in my run) and #8922 at `de573c6d1e` passes all three three times each (9 of 9, about 3 s per test; the two numbers come from separate runs). Windows for both is covered by veosett's table, so I did not run it again. The two differ in construction: #8918 raises the retry bound from 16 to 64, which relies on the receive-buffer ceiling of the host; #8922 caps the receiver at a small `SO_RCVBUF` on Linux, so the number of retries does not depend on `tcp_rmem` by construction (I only ran it with the 33554432 maximum). Only one of them needs to land. I am happy to close #8918 in favour of #8922 if the maintainers prefer it, and I will leave it open until you or @MarcZX10 say so. AI-assisted (Claude Code).
adriadam10 commented 2026-10-21 19:24:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-21T19:24:10Z.


Checked the one-line change (16 → 64 timed sends; 64 × 4 MiB exceeds the 32 MiB autotuned receive maximum), the unchanged byte-count checks, and the Linux/Windows runs reported by @veosett and the author; merged. #8922 overlaps on the same issue and can be closed or rebased as the author sees fit.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6324592262 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8918#issuecomment-6324592262). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-21T19:24:10Z. --- Checked the one-line change (16 → 64 timed sends; 64 × 4 MiB exceeds the 32 MiB autotuned receive maximum), the unchanged byte-count checks, and the Linux/Windows runs reported by @veosett and the author; merged. #8922 overlaps on the same issue and can be closed or rebased as the author sees fit.
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!8918
No description provided.