feat(libSceRudp): answer flush, remote info and buffer status for unconnected contexts #13718
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13718"
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 zaryabzip on 2026-10-31T02:30:55Z.
What
Three of the six libSceRudp exports in #13682 get bodies. They follow @BunnyFl's firmware 13.42 run of the real exports, done under an emulator with imports stubbed, not on a console.
sceRudpFlush(int ctxId)0x80770001;ctxId < 00x80770004; unknown or terminated id0x807700030x80770011(NOT_ACCEPTABLE)sceRudpGetRemoteInfo(ctxId, addr, addrLen, vport)(declaration unchanged)0x80770011, outputs untouchedsceRudpGetContextBufferStatus(int ctxId, void* out, size_t size)ctxId < 0, nulloutorsizeoutside 1 to 16 (a 64-bit compare)0x80770004; unknown or terminated idsizezero bytes, returns 0No context here ever connects, because there is no reliable-UDP stack on the host. The run gave
0x80770011forFlushandGetRemoteInfoon created, bound and listening contexts.GetContextBufferStatuswrote zeros for every context state it reached. The only other answers in the run came from connected states (internal states 4 and 5) that BunnyFl reached by writing the state field by hand, and nothing here can reach them.FlushandGetContextBufferStatusnow take the arguments from the run instead of none.Accept,ListenandGetLocalInfostay throwing for now. They needsceRudpBindto keep the socket id, virtual port and mux mode, and the run shows main'sBindarguments are named and checked differently, so they belong with aBindfix in a separate PR. The debt entry for these three cites the run and states that the connected states are unreachable. libSceRudp goes from 28 to 31 of 35.The new
GuestRudpUnconnected.cppcovers each check in order: beforesceRudpInit, on unknown and negative ids, on a created context, aftersceRudpTerminateand aftersceRudpEnd. It also checks that the outputs stay untouched on every error. It resolvesFlushandGetContextBufferStatusat runtime through function types that match the new declarations, becausemaindeclares them without parameters. So the test builds onmainand aborts there at the first call.Tested
Windows 11 (WinLibs MinGW-w64 GCC 15.2.0 UCRT r7, CMake 4.3.1, Ninja 1.13.2) and Ubuntu 24.04 on WSL2 (GCC 13.3.0, CMake 3.28.3, Ninja 1.11.1), both with the head
0e08e95853merged intomaind30e04fb8a.libSceRudp/include/Api.hpprebuilds with no warnings, and so does each header compiled on its own.ctest -R "guest_rudp|guest_offline_imports": 8 of 8 pass on both hosts, including the newguest_rudp_unconnected(Rudp unconnected tests passed). Each passes 3 of 3 on--repeat until-fail:3.rudp_poll_wait_exception(Windows only) also passes.mainwith only the new test file and itsCMakeLists.txtblock, the test builds and then aborts withsceRudpFlush not implementedon both hosts (Windows exit 0xc0000409, Linux SIGABRT).tools/check_conventions.pypasses, andtools/pr_overlap.pyreports no overlap with open pull requests.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 repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T02:37:29Z.
Review: APPROVED
Reviewed — looks good
The exact-head implementation matches the reported unconnected-context results, and I found no blocking defect in the changed code.
What I ran
Reviewed head
0e08e9585348289b391457015c9382483758ea6d, based on currentmain0cc02f7cde69941f651819b1f7a80f7aa722a08b; the merge preview was clean. Environment: Linux 6.1.0-54-amd64, Python 3.11.2, GCC 12.2.0. I did not compile or run C++ tests locally.Results
add_test_executableandadd_test(NAME guest_rudp_unconnected ...)are present.guest_rudp_unconnectedand relatedguest_rudp/guest_offline_importstests passed 8/8 on Windows and Ubuntu/WSL2, each 3/3 under--repeat until-fail:3; Windowsrudp_poll_wait_exceptionalso passed. These are author-reported, not locally reproduced.Unedited output from local checks
Convention check:
ABI audit:
The test-quality heuristic's output:
Negative control
mainsceRudpFlushstubSources
0e08e95and flush implementation, buffer-status implementationNot verified
No local compilation or test execution, physical-console behavior, or real network connection. The firmware observations were made under an emulator with imports stubbed. Hosted Windows CI was still running; Linux and relinker-related jobs were skipped.