feat(libSceRudp): implement the poll exports #7495
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7495"
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 nekomancer01 on 2026-10-18T09:35:26Z.
What
Implements
sceRudpPollCreate,sceRudpPollControl,sceRudpPollWaitandsceRudpPollDestroy, imported by PPSA31327 (Yakuza 0 Director's Cut).SceRudpPollEvent, the operations (1 add, 2 modify, 3 remove) and the argument checks follow the PS Vita library in Vita3K.RUDP_ERROR_INVALID_POLL_ID(0x8077001F) andRUDP_ERROR_TOO_MANY_CONTEXTS(0x80770020) match the PS3 codes in RPCS3. Vita3K does not implementsceRudpPollDestroy;int sceRudpPollDestroy(int pollId)is inferred.sceRudpPollWaitreturns 0 when its timeout elapses. Destroying the poll or callingsceRudpEndwakes a waiter, which then returnsRUDP_ERROR_INVALID_POLL_IDorRUDP_ERROR_NOT_INITIALIZED.sceRudpTerminateremoves the context from every poll;sceRudpEnddestroys all polls.docs/dev/debt/libSceRudp.md.Tested
Ubuntu 26.04 (WSL2), GCC, Release, full build with
BUILD_TESTING=ON. Newguest_rudp_polltest covers argument errors, capacity, duplicate add, modify/remove of absent contexts, timeout elapse, removal on terminate, and waiters woken bysceRudpPollDestroyandsceRudpEnd. Fullctest: 1433 passed, 0 failed (59 Vulkan/VideoOut tests skipped, no Vulkan device under WSL). Not tested with a title. Merges cleanly with #7087, the other open PR that changeslibSceRudp.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T10:31:34Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/CMakeLists.txtcore/libs/CMakeLists.txtcore/libs/CMakeLists.txtcore/libs/CMakeLists.txtcore/libs/CMakeLists.txtImported from boykopovar/AnyPS5. Originally posted by wachi35676 on 2026-10-18T12:05:40Z.
Windows results (the description lists WSL only): Windows 11, WinLibs GCC 15.2.0 (MinGW), Release, this PR applied onto
main3e3e8b905.guest_rudp_pollpasses 30/30, and the other rudp tests andguest_offline_importspass. Onmainthe new test aborts. A probe with longsceRudpPollWaittimeouts on MinGW stays blocked, then returnsRUDP_ERROR_INVALID_POLL_IDaftersceRudpPollDestroy, with no early return. Timeouts tried: INT64_MAX/2000, 2^40, 2^32 and 3.6e9 µs.Two differences from the cited Vita3K code:
sceRudpPollControlchecksentries.size() >= max_size(TOO_MANY_CONTEXTS) before the duplicate check (INVALID_CONTEXT_ID). This PR checks for the duplicate first: re-adding a context to a full size-1 poll returns0x80770003, where Vita3K returns0x80770020, and the new test asserts0x80770003. Either follow Vita3K's order or note the choice in the debt entry.sceRudpPollWaitreturns 0 at once when the poll has no entries. This PR waits for the full timeout. That is fine, but it isn't from Vita3K.AI-assisted: yes (Claude Code); results above were run on this machine.
Imported from boykopovar/AnyPS5. Originally posted by nekomancer01 on 2026-10-18T12:24:30Z.
Thank you for testing it using a Windows run.
sceRudpPollControlnow checks capacity before duplicates, as Vita3K does, and the test assertsTOO_MANY_CONTEXTSfor re-adding to a full poll, plusINVALID_CONTEXT_IDfor a duplicate in a poll with room left.sceRudpPollDestroynow also rejects a negative id withINVALID_ARGUMENT, like the other poll calls.epoll_waiton an empty set; Vita3K's early return logs a warning and looks like an emulator shortcut. The difference from Vita3K is now noted in the debt entry.Overlap comment: checked the four PRs manually. #5021, #6222 and #7201 change unrelated parts of
core/libs/CMakeLists.txt. #6044 moves all library tests into subfolders; if it lands first I'll moveGuestRudpPoll.cppthe same way.Windows 11, WinLibs GCC 15.2.0 (MinGW):
guest_rudp_poll30/30 and the other Rudp tests pass, results from @wachi35676 in the comments.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T16:29:26Z.
Progress report (
8a7ba4b→e416409)📈 System libraries: 65.23% (+0.06%, +4 implemented functions)
✅ 4 implemented
sceRudpPollControlsceRudpPollCreatesceRudpPollDestroysceRudpPollWaitImported from boykopovar/AnyPS5. Originally posted by nekomancer01 on 2026-10-20T00:17:25Z.
Rebased onto main to resolve the debt file conflict after #7087; the check-order fix is now a8352d301. Also shortened the poll debt entry to the new 1000-character limit (fbb8dff23).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-20T10:13:07Z.
Re-checked the shortened poll debt entry (docs only since the last review; code and test unchanged); no conflict with main; merged.