fix(libSceNet): stop Sackboy loading retries on peer sockets #5836
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5836"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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)returnsEPROTONOSUPPORT(0x8041012b). After the shader preparation queues had drained, a 12-second runtime probe still observed 12 newSlateLoadingThreadinstances 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
0x20000alongside0x20. 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.
guest_sce_net_peer_transportstest aborts at peer socket creation. The game probe independently records repeated0x8041012breturns.guest_sce_netandguest_sce_net_peer_transportspass. The peer test sends and receives actual UDP datagrams and TCP stream data over loopback, checks both broadcast-option values, and closes all descriptors.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.main, a fresh Release build ofguest_sce_net_testsandguest_datagram_receive_testspasses all six tests:guest_sce_net,guest_sce_net_peer_transports, and therecv,recvfrom,sceNetRecv,sceNetRecvfromdatagram 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 upstreammain.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repositoryImported 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 ontomaincaee23fd9.guest_sce_netandguest_sce_net_peer_transportspass 5 of 5, and the fullctesthas 0 failures out of 1185.core/libs/prx/libSceNet/Export.cpptaken back tomain, 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)
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:0x20000is not a broadcast option. In shadPS4's SDK-derivednet_types.hthe SOL_SOCKET options areSO_BROADCAST=0x20,SO_ONESBCAST=0x10000,SO_USECRYPTO=0x20000,SO_USESIGNATURE=0x40000. Mapping0x20000to the hostSO_BROADCASTturns 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 accept0x20000as 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 aftersceNetSocketreturns.Build and ctest pass on Linux here (
guest_sce_net,guest_sce_net_peer_transports).Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T03:14:23Z.
@MichalSy this PR now conflicts with
mainincore/libs/prx/libSceNet/Export.cpp(the constants block, wheremaingainedNET_SO_ONESBCAST) and indocs/dev/debt/libSceNet.md.In case it helps: I rebased your commit onto current
mainwithout changing its content, keeping you as its author, and resolved only those two conflicts by keeping both sides (yourNET_SO_BROADCAST_PS5next tomain'sNET_SO_ONESBCAST, and both debt entries): branchxXPBSXx:carry/5836-sce-net-peer-transports, head85076d5f65. You can take it withgit fetch https://github.com/xXPBSXx/AnyPS5 carry/5836-sce-net-peer-transportsandgit 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.core/libs/prx/libSceNet/Export.cpprestored tomain(your tests kept), both fail (exit code0xc0000409).guest_ssl_transport_netonce built.python tools/check_conventions.py --base upstream/mainpasses;git merge-treeagainst currentmainis clean.Not tested: Linux/macOS, a title run (PPSA01288).
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T02:06:58Z.
I am reviewing #9506, which adds
sceNetSetDnsInfo,sceNetSetDns6InfoandsceNetGetDns6Infoplus 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 inDepends onand the overlap note.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.
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
4bb5b7753bf6b62fb179e6d89b851de18dfab672main:2960e9a6e7e1fc99c4ed180c71495b5eb83464c7BUILD_TESTING=ON, in a clean worktree.Results
maincore/libs/prx/libSceNet/CMakeLists.txt,core/libs/prx/libSceNet/Export.cpp,core/libs/tests/GuestSceNet.cppanddocs/dev/debt/libSceNet.md. The head is 13,360 commits behindmain.git diff --checkcheck_conventions.py --base origin/main(on the head)All conventions checks passed.guest_sce_net_tests(on the head)guest_sce_net,guest_sce_net_peer_transports(on the head)sceNetSocket(name, 2, 6, 17)on the head0x8041012bMerge conflicts against main
ctest on the head
Negative control
Probe output (temporary test edit, reverted)
Negative control
I restored
core/libs/prx/libSceNet/Export.cppto the head's parent and kept the new tests. Bothguest_sce_netandguest_sce_net_peer_transportsabort, 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
Conflicts with
mainin every changed file. An earlier comment reported conflicts inExport.cppand the debt file. Since then,CMakeLists.txt(mainaddedguest_net_threadand other tests next toguest_sce_net) andGuestSceNet.cpp(mainchangedmain()and addedCheckInitParam) conflict as well.mainhas also changed the code this PR edits:sceNetSocketnow storess.protocolands.nameand handles a failed::socketper platform (Export.cpp L935-L973 on main).sceNetSetsockoptrejects buffer sizes below 1 and acceptsSO_ONESBCAST(0x10000) as a recorded no-op.Please rebase onto current
mainand keep those changes.The rebase has to keep the guest socket type separate from the host transport type.
Export.cpp:662storestransportTypeins.type. On currentmain,s.typeis also what the guest reads back:SO_TYPEinsceNetGetsockopt(L1574-L1575);socket_typeinsceNetGetSockInfoandsceNetGetSockInfo6(L1815, L1882).The console measurement in this thread shows
socket_type6 and 10 for these sockets. After a straight rebase, the guest would read 2 and 1 instead. The internalsocket.type == NET_SOCK_STREAMchecks 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 readsSO_TYPEback on a type 6 and a type 10 socket would cover this. Queuse already asked for this reconciliation; this finding names the lines involved.Type 6 accepts protocols the console refuses.
Export.cpp:635-641maps the type and forwardsprotocolto the host unchanged. On the head,sceNetSocket("probe", 2, 6, 17)returned descriptor 6 (probe output above). The same console measurement showssceNetSocket(..., 2, 6, 17)failing with0x8041012b/ 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 toCheckPeerSocketTypes.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 hostSO_BROADCAST. The P2P virtual-port point from the same review is also still open.Non-blocking
CheckPeerSocketTypesruns before the other checks in the fullguest_sce_netrun as well as in--peer-only, so a peer failure hides every later check inguest_sce_net. Consider running it only for--peer-only, or after the existing checks.Not verified
0x20000insceNetSetsockopt.To get this to a good state
mainand resolve the four conflicts, keepingmain's protocol/name storage, buffer guard,SO_ONESBCASThandling and test registrations.SO_TYPEand sockinfo readback, separately from the host transport type, and test the readback.0x20000and virtual ports: give a source, or narrow the change to what is modelled and throw for the rest.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
4bb5b7753bf6b62fb179e6d89b851de18dfab672usingrepo_read.pyagainst 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), anddocs/dev/debt/libSceNet.md(lines 1–18).files.jsonwas not available through the reader, so the excluded-file list was not verified. The manifest marks all four changed files as included.Results
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.jsoncould not be read.To get this to a good state
Nothing is required.
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
sceNetSocketreturns. 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
mainat9fcd37e4ea. 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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.