fix(libSceNet): stop Sackboy loading retries on peer sockets #5836

Open
MichalSy wants to merge 1 commit from upstream-pr/5836 into main
MichalSy commented 2026-10-14 12:59:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichalSy on 2026-10-14T12:59:56Z.


What

Sackboy: A Big Adventure (PPSA01288) repeatedly recreates its loading screen because sceNetSocket(..., family=2, type=6, protocol=0) returns EPROTONOSUPPORT (0x8041012b). After the shader preparation queues had drained, a 12-second runtime probe still observed 12 new SlateLoadingThread instances interleaved with the same failing socket request.

Translate PS5 peer socket types 6 and 10 to the existing host UDP and TCP transports, and accept the PS5 broadcast option 0x20000 alongside 0x20. The existing descriptor registry, socket lifetime and error handling stay in use. Technical debt records that this does not implement console peer negotiation or virtual-port routing.

The branch contains only this network fix, its loopback regression tests and the debt entry. No matching open PR was found for these socket types or the broadcast alias.

Tested

Arch Linux, GCC 16.2.1, Release.

  • Before the production fix, the new guest_sce_net_peer_transports test aborts at peer socket creation. The game probe independently records repeated 0x8041012b returns.
  • With the fix, guest_sce_net and guest_sce_net_peer_transports pass. The peer test sends and receives actual UDP datagrams and TCP stream data over loopback, checks both broadcast-option values, and closes all descriptors.
  • Sackboy launched through FrameRift on an NVIDIA RTX A3000 Laptop GPU, driver 615.71.09: the corresponding 12-second probe observes no repeated peer socket requests or loading-thread recreation, and the title advances into another loading phase. The runtime comparison uses the same local baseline, including #4873, #5511 and #5181, with only this network change added. It subsequently stops on a separate renderer descriptor-range error; with #5778 locally applied it reaches buffer specialization has an unsupported format. This PR does not claim that Sackboy reaches a playable menu or that the remaining graphics errors are fixed.
  • On the isolated PR branch based directly on upstream main, a fresh Release build of guest_sce_net_tests and guest_datagram_receive_tests passes all six tests: guest_sce_net, guest_sce_net_peer_transports, and the recv, recvfrom, sceNetRecv, sceNetRecvfrom datagram cases.
  • git diff --check, the conventions check including this title/body, and the open-PR overlap check pass. The branch merges cleanly into the current upstream main.
  • Windows was not tested.

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
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA01288 (Sackboy: A Big Adventure loading-screen retry loop; no existing Game bring-up discussion found)
  • GPUs tested: n/a (network-only change; game-run hardware listed above)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4858258963 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5836). Originally posted by [MichalSy](https://github.com/MichalSy) on 2026-10-14T12:59:56Z. --- ### What Sackboy: A Big Adventure (PPSA01288) repeatedly recreates its loading screen because `sceNetSocket(..., family=2, type=6, protocol=0)` returns `EPROTONOSUPPORT` (`0x8041012b`). After the shader preparation queues had drained, a 12-second runtime probe still observed 12 new `SlateLoadingThread` instances interleaved with the same failing socket request. Translate PS5 peer socket types 6 and 10 to the existing host UDP and TCP transports, and accept the PS5 broadcast option `0x20000` alongside `0x20`. The existing descriptor registry, socket lifetime and error handling stay in use. Technical debt records that this does not implement console peer negotiation or virtual-port routing. The branch contains only this network fix, its loopback regression tests and the debt entry. No matching open PR was found for these socket types or the broadcast alias. ### Tested Arch Linux, GCC 16.2.1, Release. - Before the production fix, the new `guest_sce_net_peer_transports` test aborts at peer socket creation. The game probe independently records repeated `0x8041012b` returns. - With the fix, `guest_sce_net` and `guest_sce_net_peer_transports` pass. The peer test sends and receives actual UDP datagrams and TCP stream data over loopback, checks both broadcast-option values, and closes all descriptors. - Sackboy launched through FrameRift on an NVIDIA RTX A3000 Laptop GPU, driver 615.71.09: the corresponding 12-second probe observes no repeated peer socket requests or loading-thread recreation, and the title advances into another loading phase. The runtime comparison uses the same local baseline, including #4873, #5511 and #5181, with only this network change added. It subsequently stops on a separate renderer descriptor-range error; with #5778 locally applied it reaches `buffer specialization has an unsupported format`. This PR does not claim that Sackboy reaches a playable menu or that the remaining graphics errors are fixed. - On the isolated PR branch based directly on upstream `main`, a fresh Release build of `guest_sce_net_tests` and `guest_datagram_receive_tests` passes all six tests: `guest_sce_net`, `guest_sce_net_peer_transports`, and the `recv`, `recvfrom`, `sceNetRecv`, `sceNetRecvfrom` datagram cases. - `git diff --check`, the conventions check including this title/body, and the open-PR overlap check pass. The branch merges cleanly into the current upstream `main`. - Windows was not tested. ### 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 - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA01288 (Sackboy: A Big Adventure loading-screen retry loop; no existing Game bring-up discussion found) - [x] GPUs tested: n/a (network-only change; game-run hardware listed above) - [x] AI-assisted: yes
orishamir commented 2026-10-14 13:56:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by orishamir on 2026-10-14T13:56:39Z.


Windows run, since the description says Windows wasn't tested. Windows 11, RTX 4080, WinLibs GCC 15.2.0 r7, Release, this head (4bb5b7753) merged onto main caee23fd9.

  • guest_sce_net and guest_sce_net_peer_transports pass 5 of 5, and the full ctest has 0 failures out of 1185.
  • With only core/libs/prx/libSceNet/Export.cpp taken back to main, both tests abort (exit 0xC0000409), so the new checks fail without the change on Windows too.

No title run: I don't have PPSA01288.

AI-assisted: yes (Claude Code Opus 5.5)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6170059247 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5836#issuecomment-6170059247). Originally posted by [orishamir](https://github.com/orishamir) on 2026-10-14T13:56:39Z. --- Windows run, since the description says Windows wasn't tested. Windows 11, RTX 4080, WinLibs GCC 15.2.0 r7, Release, this head (4bb5b7753) merged onto `main` caee23fd9. - `guest_sce_net` and `guest_sce_net_peer_transports` pass 5 of 5, and the full `ctest` has 0 failures out of 1185. - With only `core/libs/prx/libSceNet/Export.cpp` taken back to `main`, both tests abort (exit 0xC0000409), so the new checks fail without the change on Windows too. No title run: I don't have PPSA01288. AI-assisted: yes (Claude Code Opus 5.5)
adriadam10 commented 2026-10-15 13:24:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T13:24:55Z.

Review: CHANGES_REQUESTED


Thanks for the Sackboy investigation and the loopback tests (the Windows run by @orishamir also confirms they fail without the change). Two points to fix before merging:

  • core/libs/prx/libSceNet/Export.cpp:92,1069: 0x20000 is not a broadcast option. In shadPS4's SDK-derived net_types.h the SOL_SOCKET options are SO_BROADCAST=0x20, SO_ONESBCAST=0x10000, SO_USECRYPTO=0x20000, SO_USESIGNATURE=0x40000. Mapping 0x20000 to the host SO_BROADCAST turns on a behaviour the title did not ask for. Please cite where the "PS5 broadcast alias" comes from (a call site in the title with the instruction offset, or a reference); otherwise accept 0x20000 as a no-op only if that is what the game needs (listed under Silent stubs/Functional in the debt file) or let it throw as before.
  • Export.cpp:683-689, docs/dev/debt/libSceNet.md:11: types 6/10 are the P2P socket types, whose addressing uses virtual ports (shadPS4 models them separately). Binding them to plain host UDP/TCP returns plausible but different results for any title that really uses vports. If the game only needs creation to succeed, please scope it to exactly what is modelled (e.g. reject a non-zero vport/SO_NAME-style P2P options and any sockaddr_in_p2p use with a clear exception) and state in the PR which game call sequence you observed after sceNetSocket returns.

Build and ctest pass on Linux here (guest_sce_net, guest_sce_net_peer_transports).

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5533818411 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5836#pullrequestreview-5533818411). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-15T13:24:55Z. **Review:** CHANGES_REQUESTED --- Thanks for the Sackboy investigation and the loopback tests (the Windows run by @orishamir also confirms they fail without the change). Two points to fix before merging: - `core/libs/prx/libSceNet/Export.cpp:92,1069`: `0x20000` is not a broadcast option. In shadPS4's SDK-derived `net_types.h` the SOL_SOCKET options are `SO_BROADCAST=0x20`, `SO_ONESBCAST=0x10000`, `SO_USECRYPTO=0x20000`, `SO_USESIGNATURE=0x40000`. Mapping `0x20000` to the host `SO_BROADCAST` turns on a behaviour the title did not ask for. Please cite where the "PS5 broadcast alias" comes from (a call site in the title with the instruction offset, or a reference); otherwise accept `0x20000` as a no-op only if that is what the game needs (listed under Silent stubs/Functional in the debt file) or let it throw as before. - `Export.cpp:683-689`, `docs/dev/debt/libSceNet.md:11`: types 6/10 are the P2P socket types, whose addressing uses virtual ports (shadPS4 models them separately). Binding them to plain host UDP/TCP returns plausible but different results for any title that really uses vports. If the game only needs creation to succeed, please scope it to exactly what is modelled (e.g. reject a non-zero vport/`SO_NAME`-style P2P options and any sockaddr_in_p2p use with a clear exception) and state in the PR which game call sequence you observed after `sceNetSocket` returns. Build and ctest pass on Linux here (`guest_sce_net`, `guest_sce_net_peer_transports`).
xXPBSXx commented 2026-10-21 03:14:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T03:14:23Z.


@MichalSy this PR now conflicts with main in core/libs/prx/libSceNet/Export.cpp (the constants block, where main gained NET_SO_ONESBCAST) and in docs/dev/debt/libSceNet.md.

In case it helps: I rebased your commit onto current main without changing its content, keeping you as its author, and resolved only those two conflicts by keeping both sides (your NET_SO_BROADCAST_PS5 next to main's NET_SO_ONESBCAST, and both debt entries): branch xXPBSXx:carry/5836-sce-net-peer-transports, head 85076d5f65. You can take it with git fetch https://github.com/xXPBSXx/AnyPS5 carry/5836-sce-net-peer-transports and git reset --hard FETCH_HEAD, or rebase yourself; I will not open a second PR for it.

Windows 10 19045, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON, on that head:

  • ctest -R '^(guest_sce_net|guest_sce_net_peer_transports)$' passes 3 of 3 runs.
  • With core/libs/prx/libSceNet/Export.cpp restored to main (your tests kept), both fail (exit code 0xc0000409).
  • The other net and socket tests pass, including guest_ssl_transport_net once built.
  • python tools/check_conventions.py --base upstream/main passes; git merge-tree against current main is clean.
    Not tested: Linux/macOS, a title run (PPSA01288).

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6307118523 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5836#issuecomment-6307118523). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-21T03:14:23Z. --- @MichalSy this PR now conflicts with `main` in `core/libs/prx/libSceNet/Export.cpp` (the constants block, where `main` gained `NET_SO_ONESBCAST`) and in `docs/dev/debt/libSceNet.md`. In case it helps: I rebased your commit onto current `main` without changing its content, keeping you as its author, and resolved only those two conflicts by keeping both sides (your `NET_SO_BROADCAST_PS5` next to `main`'s `NET_SO_ONESBCAST`, and both debt entries): branch `xXPBSXx:carry/5836-sce-net-peer-transports`, head `85076d5f65`. You can take it with `git fetch https://github.com/xXPBSXx/AnyPS5 carry/5836-sce-net-peer-transports` and `git reset --hard FETCH_HEAD`, or rebase yourself; I will not open a second PR for it. Windows 10 19045, WinLibs GCC 15.2.0 r7, Release, `BUILD_TESTING=ON`, on that head: - `ctest -R '^(guest_sce_net|guest_sce_net_peer_transports)$'` passes 3 of 3 runs. - With `core/libs/prx/libSceNet/Export.cpp` restored to `main` (your tests kept), both fail (exit code `0xc0000409`). - The other net and socket tests pass, including `guest_ssl_transport_net` once built. - `python tools/check_conventions.py --base upstream/main` passes; `git merge-tree` against current `main` is clean. Not tested: Linux/macOS, a title run (PPSA01288). AI-assisted (Claude Code).
MarcZX10 commented 2026-10-22 02:06:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T02:06:58Z.


I am reviewing #9506, which adds sceNetSetDnsInfo, sceNetSetDns6Info and sceNetGetDns6Info plus a new registered test and debt entry. The overlap bot could not compare some of these branches because of base conflicts, and this PR author has not yet recorded an agreed merge order. Please confirm whether your current changes overlap these exact exports, CMake/test insertion, or debt section, and whether #9506 can land before your PR or should depend on yours. The #9506 author is being asked to record the agreed order in Depends on and the overlap note.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6330951212 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5836#issuecomment-6330951212). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T02:06:58Z. --- I am reviewing #9506, which adds `sceNetSetDnsInfo`, `sceNetSetDns6Info` and `sceNetGetDns6Info` plus a new registered test and debt entry. The overlap bot could not compare some of these branches because of base conflicts, and this PR author has not yet recorded an agreed merge order. Please confirm whether your current changes overlap these exact exports, CMake/test insertion, or debt section, and whether #9506 can land before your PR or should depend on yours. The #9506 author is being asked to record the agreed order in `Depends on` and the overlap note.
Queuse commented 2026-10-22 15:29:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Queuse on 2026-10-22T15:29:54Z.


@MichalSy I checked your broadcast alias changes while refreshing #9523, #9525, #9542, #9543 and #9544. #9542 adds readback of the existing broadcast/reuse flags; #9544 rejects nonpositive send/receive buffer sizes in the same setter option group that your alias edit changes.

Would landing these focused socket-option PRs before this PR work for you? The alias change would need to preserve the buffer guard and native option readback. If yours needs to land first, I can adapt my branches after it merges. I will record the order once we agree; #9523 before #9542 and #9525 before #9543 remain the existing prerequisites.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6344580750 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5836#issuecomment-6344580750). Originally posted by [Queuse](https://github.com/Queuse) on 2026-10-22T15:29:54Z. --- @MichalSy I checked your broadcast alias changes while refreshing #9523, #9525, #9542, #9543 and #9544. #9542 adds readback of the existing broadcast/reuse flags; #9544 rejects nonpositive send/receive buffer sizes in the same setter option group that your alias edit changes. Would landing these focused socket-option PRs before this PR work for you? The alias change would need to preserve the buffer guard and native option readback. If yours needs to land first, I can adapt my branches after it merges. I will record the order once we agree; #9523 before #9542 and #9525 before #9543 remain the existing prerequisites.
XairRrR commented 2026-10-29 06:37:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T06:37:17Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The branch no longer merges into main: all four files conflict. On this head, type 6 with protocol 17 creates a socket, which the console refuses. Both points come on top of the two open items from the earlier review.

What I ran

  • Head: 4bb5b7753bf6b62fb179e6d89b851de18dfab672
  • main: 2960e9a6e7e1fc99c4ed180c71495b5eb83464c7
  • Linux build: Arch Linux 7.2.11-zen, GCC 16.2.1, Release, Ninja, BUILD_TESTING=ON, in a clean worktree.
  • Hardware: Intel Core i9-14900KF and NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08). The GPU is not relevant to this network-only change.
git fetch -q origin main pull/5836/head:refs/review/5836
git checkout -q --detach origin/main
git merge -q --no-ff --no-edit refs/review/5836   # conflicts, aborted
git checkout -q --detach refs/review/5836
git diff --check origin/main...refs/review/5836
python3 tools/check_conventions.py --base origin/main
cmake --build build -j10 --target guest_sce_net_tests
ctest --test-dir build -R '^guest_sce_net(_peer_transports)?$' --output-on-failure -j4
# negative control: Export.cpp restored to the head's parent, tests kept
git checkout refs/review/5836~1 -- core/libs/prx/libSceNet/Export.cpp
cmake --build build -j10 --target guest_sce_net_tests
ctest --test-dir build -R '^guest_sce_net(_peer_transports)?$' --output-on-failure -j4
# probe: temporary sceNetSocket(2, 6, 17) and (2, 7, 0) calls at the top of CheckPeerSocketTypes, then reverted
build/tests/guest_sce_net_tests --peer-only

Results

Check Result
Merge into main Conflicts in core/libs/prx/libSceNet/CMakeLists.txt, core/libs/prx/libSceNet/Export.cpp, core/libs/tests/GuestSceNet.cpp and docs/dev/debt/libSceNet.md. The head is 13,360 commits behind main.
git diff --check clean
check_conventions.py --base origin/main (on the head) All conventions checks passed.
Build guest_sce_net_tests (on the head) OK
guest_sce_net, guest_sce_net_peer_transports (on the head) 2/2 passed
Negative control both tests abort
sceNetSocket(name, 2, 6, 17) on the head returns descriptor 6; the console refuses with 0x8041012b
Merge conflicts against main
CONFLIT (contenu) : Conflit de fusion dans core/libs/prx/libSceNet/CMakeLists.txt
CONFLIT (contenu) : Conflit de fusion dans core/libs/prx/libSceNet/Export.cpp
CONFLIT (contenu) : Conflit de fusion dans core/libs/tests/GuestSceNet.cpp
CONFLIT (contenu) : Conflit de fusion dans docs/dev/debt/libSceNet.md
ctest on the head
1/2 Test #777: guest_sce_net_peer_transports ....   Passed    0.00 sec
2/2 Test #776: guest_sce_net ....................   Passed    0.33 sec
100% tests passed out of 2
Negative control
2/2 Test #777: guest_sce_net_peer_transports ....Subprocess aborted***Exception:   0.09 sec
0% tests passed, 2 tests failed out of 2
	776 - guest_sce_net (Subprocess aborted)
	777 - guest_sce_net_peer_transports (Subprocess aborted)
Probe output (temporary test edit, reverted)
PROBE type6 proto17 -> 6
PROBE type7 proto0 -> -2143223509

Negative control

I restored core/libs/prx/libSceNet/Export.cpp to the head's parent and kept the new tests. Both guest_sce_net and guest_sce_net_peer_transports abort, so the tests detect the missing change. This agrees with the Windows results already posted in the comments. I could not run the control on a merged tree because the merge conflicts.

Findings

Blocking

  1. Conflicts with main in every changed file. An earlier comment reported conflicts in Export.cpp and the debt file. Since then, CMakeLists.txt (main added guest_net_thread and other tests next to guest_sce_net) and GuestSceNet.cpp (main changed main() and added CheckInitParam) conflict as well. main has also changed the code this PR edits:

    • sceNetSocket now stores s.protocol and s.name and handles a failed ::socket per platform (Export.cpp L935-L973 on main).
    • sceNetSetsockopt rejects buffer sizes below 1 and accepts SO_ONESBCAST (0x10000) as a recorded no-op.

    Please rebase onto current main and keep those changes.

  2. The rebase has to keep the guest socket type separate from the host transport type. Export.cpp:662 stores transportType in s.type. On current main, s.type is also what the guest reads back:

    • SO_TYPE in sceNetGetsockopt (L1574-L1575);
    • socket_type in sceNetGetSockInfo and sceNetGetSockInfo6 (L1815, L1882).

    The console measurement in this thread shows socket_type 6 and 10 for these sockets. After a straight rebase, the guest would read 2 and 1 instead. The internal socket.type == NET_SOCK_STREAM checks need the host transport type, so the record needs two fields: the guest type for readback and the transport type for internal decisions. A test that reads SO_TYPE back on a type 6 and a type 10 socket would cover this. Queuse already asked for this reconciliation; this finding names the lines involved.

  3. Type 6 accepts protocols the console refuses. Export.cpp:635-641 maps the type and forwards protocol to the host unchanged. On the head, sceNetSocket("probe", 2, 6, 17) returned descriptor 6 (probe output above). The same console measurement shows sceNetSocket(..., 2, 6, 17) failing with 0x8041012b / errno 43. The same measurement shows type 10 with protocol 6 is accepted, which this code also does. Please accept only protocol 0 for type 6. Then extend the measurement to the other protocol values for types 6 and 10, or record the untested values in the debt file, and add the refused case to CheckPeerSocketTypes.

  4. The 0x20000 "PS5 broadcast" alias is still unsourced (Export.cpp:92, Export.cpp:1021, debt entry). The earlier review raised this, and the PR has no new commit since. I have no new evidence either way. I confirm only that the value is still mapped to the host SO_BROADCAST. The P2P virtual-port point from the same review is also still open.

Non-blocking

  • CheckPeerSocketTypes runs before the other checks in the full guest_sce_net run as well as in --peer-only, so a peer failure hides every later check in guest_sce_net. Consider running it only for --peer-only, or after the existing checks.

Not verified

  • I did not build or test a merged tree because the merge conflicts. All results above are from the PR head on its own base.
  • I ran no title, so the Sackboy (PPSA01288) claim is unverified.
  • Windows and macOS were not tested here.
  • I did not check what the console returns for 0x20000 in sceNetSetsockopt.

To get this to a good state

  1. Rebase onto current main and resolve the four conflicts, keeping main's protocol/name storage, buffer guard, SO_ONESBCAST handling and test registrations.
  2. Store the guest type (6 or 10) for SO_TYPE and sockinfo readback, separately from the host transport type, and test the readback.
  3. Refuse type 6 with a non-zero protocol, as the console does, and test it.
  4. Answer the earlier review on 0x20000 and virtual ports: give a source, or narrow the change to what is modelled and throw for the rest.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5693782586 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5836#pullrequestreview-5693782586). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-29T06:37:17Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The branch no longer merges into `main`: all four files conflict. On this head, type 6 with protocol 17 creates a socket, which the console refuses. Both points come on top of the two open items from the earlier review. ## What I ran - Head: `4bb5b7753bf6b62fb179e6d89b851de18dfab672` - `main`: `2960e9a6e7e1fc99c4ed180c71495b5eb83464c7` - Linux build: Arch Linux 7.2.11-zen, GCC 16.2.1, Release, Ninja, `BUILD_TESTING=ON`, in a clean worktree. - Hardware: Intel Core i9-14900KF and NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08). The GPU is not relevant to this network-only change. ```sh git fetch -q origin main pull/5836/head:refs/review/5836 git checkout -q --detach origin/main git merge -q --no-ff --no-edit refs/review/5836 # conflicts, aborted git checkout -q --detach refs/review/5836 git diff --check origin/main...refs/review/5836 python3 tools/check_conventions.py --base origin/main cmake --build build -j10 --target guest_sce_net_tests ctest --test-dir build -R '^guest_sce_net(_peer_transports)?$' --output-on-failure -j4 # negative control: Export.cpp restored to the head's parent, tests kept git checkout refs/review/5836~1 -- core/libs/prx/libSceNet/Export.cpp cmake --build build -j10 --target guest_sce_net_tests ctest --test-dir build -R '^guest_sce_net(_peer_transports)?$' --output-on-failure -j4 # probe: temporary sceNetSocket(2, 6, 17) and (2, 7, 0) calls at the top of CheckPeerSocketTypes, then reverted build/tests/guest_sce_net_tests --peer-only ``` ## Results | Check | Result | |---|---| | Merge into `main` | **Conflicts** in `core/libs/prx/libSceNet/CMakeLists.txt`, `core/libs/prx/libSceNet/Export.cpp`, `core/libs/tests/GuestSceNet.cpp` and `docs/dev/debt/libSceNet.md`. The head is 13,360 commits behind `main`. | | `git diff --check` | clean | | `check_conventions.py --base origin/main` (on the head) | `All conventions checks passed.` | | Build `guest_sce_net_tests` (on the head) | OK | | `guest_sce_net`, `guest_sce_net_peer_transports` (on the head) | 2/2 passed | | Negative control | both tests abort | | `sceNetSocket(name, 2, 6, 17)` on the head | returns descriptor 6; the console refuses with `0x8041012b` | <details><summary>Merge conflicts against main</summary> ``` CONFLIT (contenu) : Conflit de fusion dans core/libs/prx/libSceNet/CMakeLists.txt CONFLIT (contenu) : Conflit de fusion dans core/libs/prx/libSceNet/Export.cpp CONFLIT (contenu) : Conflit de fusion dans core/libs/tests/GuestSceNet.cpp CONFLIT (contenu) : Conflit de fusion dans docs/dev/debt/libSceNet.md ``` </details> <details><summary>ctest on the head</summary> ``` 1/2 Test #777: guest_sce_net_peer_transports .... Passed 0.00 sec 2/2 Test #776: guest_sce_net .................... Passed 0.33 sec 100% tests passed out of 2 ``` </details> <details><summary>Negative control</summary> ``` 2/2 Test #777: guest_sce_net_peer_transports ....Subprocess aborted***Exception: 0.09 sec 0% tests passed, 2 tests failed out of 2 776 - guest_sce_net (Subprocess aborted) 777 - guest_sce_net_peer_transports (Subprocess aborted) ``` </details> <details><summary>Probe output (temporary test edit, reverted)</summary> ``` PROBE type6 proto17 -> 6 PROBE type7 proto0 -> -2143223509 ``` </details> ## Negative control I restored `core/libs/prx/libSceNet/Export.cpp` to the head's parent and kept the new tests. Both `guest_sce_net` and `guest_sce_net_peer_transports` abort, so the tests detect the missing change. This agrees with the Windows results already posted in the comments. I could not run the control on a merged tree because the merge conflicts. ## Findings ### Blocking 1. **Conflicts with `main` in every changed file.** An earlier comment reported conflicts in `Export.cpp` and the debt file. Since then, `CMakeLists.txt` (`main` added `guest_net_thread` and other tests next to `guest_sce_net`) and `GuestSceNet.cpp` (`main` changed `main()` and added `CheckInitParam`) conflict as well. `main` has also changed the code this PR edits: - `sceNetSocket` now stores `s.protocol` and `s.name` and handles a failed `::socket` per platform ([Export.cpp L935-L973 on main](https://github.com/boykopovar/AnyPS5/blob/2960e9a6e7e1fc99c4ed180c71495b5eb83464c7/core/libs/prx/libSceNet/Export.cpp#L935-L973)). - `sceNetSetsockopt` rejects buffer sizes below 1 and accepts `SO_ONESBCAST` (`0x10000`) as a recorded no-op. Please rebase onto current `main` and keep those changes. 2. **The rebase has to keep the guest socket type separate from the host transport type.** `Export.cpp:662` stores `transportType` in `s.type`. On current `main`, `s.type` is also what the guest reads back: - `SO_TYPE` in `sceNetGetsockopt` ([L1574-L1575](https://github.com/boykopovar/AnyPS5/blob/2960e9a6e7e1fc99c4ed180c71495b5eb83464c7/core/libs/prx/libSceNet/Export.cpp#L1574-L1575)); - `socket_type` in `sceNetGetSockInfo` and `sceNetGetSockInfo6` ([L1815](https://github.com/boykopovar/AnyPS5/blob/2960e9a6e7e1fc99c4ed180c71495b5eb83464c7/core/libs/prx/libSceNet/Export.cpp#L1815), [L1882](https://github.com/boykopovar/AnyPS5/blob/2960e9a6e7e1fc99c4ed180c71495b5eb83464c7/core/libs/prx/libSceNet/Export.cpp#L1882)). The [console measurement in this thread](https://github.com/boykopovar/AnyPS5/pull/5836#issuecomment-6352779503) shows `socket_type` 6 and 10 for these sockets. After a straight rebase, the guest would read 2 and 1 instead. The internal `socket.type == NET_SOCK_STREAM` checks need the host transport type, so the record needs two fields: the guest type for readback and the transport type for internal decisions. A test that reads `SO_TYPE` back on a type 6 and a type 10 socket would cover this. Queuse already asked for this reconciliation; this finding names the lines involved. 3. **Type 6 accepts protocols the console refuses.** `Export.cpp:635-641` maps the type and forwards `protocol` to the host unchanged. On the head, `sceNetSocket("probe", 2, 6, 17)` returned descriptor 6 (probe output above). The same console measurement shows `sceNetSocket(..., 2, 6, 17)` failing with `0x8041012b` / errno 43. The same measurement shows type 10 with protocol 6 is accepted, which this code also does. Please accept only protocol 0 for type 6. Then extend the measurement to the other protocol values for types 6 and 10, or record the untested values in the debt file, and add the refused case to `CheckPeerSocketTypes`. 4. **The `0x20000` "PS5 broadcast" alias is still unsourced** (`Export.cpp:92`, `Export.cpp:1021`, debt entry). [The earlier review](https://github.com/boykopovar/AnyPS5/pull/5836#pullrequestreview-5533818411) raised this, and the PR has no new commit since. I have no new evidence either way. I confirm only that the value is still mapped to the host `SO_BROADCAST`. The P2P virtual-port point from the same review is also still open. ### Non-blocking - `CheckPeerSocketTypes` runs before the other checks in the full `guest_sce_net` run as well as in `--peer-only`, so a peer failure hides every later check in `guest_sce_net`. Consider running it only for `--peer-only`, or after the existing checks. ## Not verified - I did not build or test a merged tree because the merge conflicts. All results above are from the PR head on its own base. - I ran no title, so the Sackboy (PPSA01288) claim is unverified. - Windows and macOS were not tested here. - I did not check what the console returns for `0x20000` in `sceNetSetsockopt`. ## To get this to a good state 1. Rebase onto current `main` and resolve the four conflicts, keeping `main`'s protocol/name storage, buffer guard, `SO_ONESBCAST` handling and test registrations. 2. Store the guest type (6 or 10) for `SO_TYPE` and sockinfo readback, separately from the host transport type, and test the readback. 3. Refuse type 6 with a non-zero protocol, as the console does, and test it. 4. Answer the earlier review on `0x20000` and virtual ports: give a source, or narrow the change to what is modelled and throw for the rest.
MarcZX10 commented 2026-11-20 07:37:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T07:37:13Z.

Review: APPROVED


Reviewed — looks good

The peer socket aliases map to host UDP/TCP and the broadcast alias to SO_BROADCAST; the inspected implementation and loopback regression coverage show no verified defect.

What I ran

Reviewed head 4bb5b7753bf6b62fb179e6d89b851de18dfab672 using repo_read.py against the prepared review bundle and pinned repository source. No commands or tests were run by me; the description reports test and runtime results.

Read: description.md, commits.md, manifest.json, diff.patch, core/libs/prx/libSceNet/CMakeLists.txt, core/libs/prx/libSceNet/Export.cpp (lines 1–120 and 600–680), core/libs/tests/GuestSceNet.cpp (lines 1–120), and docs/dev/debt/libSceNet.md (lines 1–18). files.json was not available through the reader, so the excluded-file list was not verified. The manifest marks all four changed files as included.

Results

Check Result Note
Source review passed Inspected changed implementation and test setup
Tests run by reviewer not run Reported results are author supplied
Windows behavior not run Description says Windows was not tested

Findings

Blocking

None.

Non-blocking

None.

Not verified

I did not run the reported tests, build, or game probe. Windows behavior is unverified. I read the changed source portions relevant to the transport mapping and test registration; no excluded files were identifiable because files.json could not be read.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5989090851 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5836#pullrequestreview-5989090851). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T07:37:13Z. **Review:** APPROVED --- # Reviewed — looks good The peer socket aliases map to host UDP/TCP and the broadcast alias to `SO_BROADCAST`; the inspected implementation and loopback regression coverage show no verified defect. ## What I ran Reviewed head `4bb5b7753bf6b62fb179e6d89b851de18dfab672` using `repo_read.py` against the prepared review bundle and pinned repository source. No commands or tests were run by me; the description reports test and runtime results. Read: `description.md`, `commits.md`, `manifest.json`, `diff.patch`, `core/libs/prx/libSceNet/CMakeLists.txt`, `core/libs/prx/libSceNet/Export.cpp` (lines 1–120 and 600–680), `core/libs/tests/GuestSceNet.cpp` (lines 1–120), and `docs/dev/debt/libSceNet.md` (lines 1–18). `files.json` was not available through the reader, so the excluded-file list was not verified. The manifest marks all four changed files as included. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Inspected changed implementation and test setup | | Tests run by reviewer | not run | Reported results are author supplied | | Windows behavior | not run | Description says Windows was not tested | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified I did not run the reported tests, build, or game probe. Windows behavior is unverified. I read the changed source portions relevant to the transport mapping and test registration; no excluded files were identifiable because `files.json` could not be read. ## To get this to a good state Nothing is required.
ligmaSec commented 2026-12-03 17:31:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T17:31:09Z.

Review: COMMENTED


The new peer transports are indistinguishable from raw host TCP and UDP after sceNetSocket returns. The implementation and loopback tests establish that ordinary socket I/O works, while the debt entry identifies virtual-port routing and negotiation as unknown. Can the implementation preserve the peer type and refuse peer operations outside the supported subset explicitly? Otherwise the caller can receive success even though its peer-specific address or routing information had no effect.

I also checked the merge result against main at 9fcd37e4ea. It conflicts in the Net export, its CMake registration, and the shared guest fixture, so the existing PR test report predates those changes.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6175041101 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5836#pullrequestreview-6175041101). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T17:31:09Z. **Review:** COMMENTED --- The new peer transports are indistinguishable from raw host TCP and UDP after `sceNetSocket` returns. The implementation and loopback tests establish that ordinary socket I/O works, while the debt entry identifies virtual-port routing and negotiation as unknown. Can the implementation preserve the peer type and refuse peer operations outside the supported subset explicitly? Otherwise the caller can receive success even though its peer-specific address or routing information had no effect. I also checked the merge result against `main` at `9fcd37e4ea`. It conflicts in the Net export, its CMake registration, and the shared guest fixture, so the existing PR test report predates those changes. 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/5836:upstream-pr/5836'
git switch 'upstream-pr/5836'

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