libSceRudp: seven absent exports Demon Slayer imports, and End/Terminate swapped; fix branch ready #3445

Closed
opened 2026-10-11 10:44:17 +00:00 by screamm · 3 comments
screamm commented 2026-10-11 10:44:17 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-11T10:44:17Z.


libSceRudp lacks seven exports that Demon Slayer (PPSA03490) imports: sceRudpNetFlush, sceRudpProcessEvents, sceRudpGetMaxSegmentSize, sceRudpGetNumberOfPacketsToRead, sceRudpGetSizeWritable, sceRudpGetSizeReadable, sceRudpNetReceived (#3073: "7 absent, all in libSceRudp", with console measurements by hugodearaujo on firmware 13.60). On top of that main has sceRudpEnd and sceRudpTerminate swapped.

Fix branch ready: screamm:feat/rudp-absent-calls (two commits on main cfbd516c: 7b33fe41 fix(libSceRudp): swap sceRudpEnd and sceRudpTerminate, a5b1cf2b feat(libSceRudp): implement the net flush, event and size queries). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commits as they are.

  • The swap: sceRudpEnd(void) shuts the library down and sceRudpTerminate(int ctx) releases a context; three sources agree (the #3073 measurement "after sceRudpEnd() all three return 0x80770001 again", Orbital db_types.json lines 1971 and 1996, RPCS3 cellRudp.cpp and the Vita3K fork SceLibRudp.cpp); the bodies are exchanged, nothing else changes, guest_offline_imports follows.
  • GetMaxSegmentSize writes the measured 1410 (null pointer 0x80770004); ProcessEvents (sleeps the microsecond timeout as fpPS4 does) and NetFlush return 0 after init; all three return 0x80770001 before init as measured. The context queries check not-initialised, negative id (0x80770004), unknown id (0x80770003), then answer 0 packets and 0x80770011 (NOT_ACCEPTABLE) for the size queries on any context, since no context can connect offline (check order and the unconnected gate from the Vita3K fork). NetReceived throws (unmeasured, uncalled); ProcessEvents/NetFlush throw once the internal I/O thread is enabled (the measurement does not cover it). TechnicalDebt lists measured vs. assumed.
  • guest_rudp_status runs each call before init, after init without a context, on created, bound and initiated contexts, after terminate, with the I/O thread on, after End and after a second init.

Tested on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON, full build including libs: guest_rudp_status and guest_offline_imports 3/3; ctest -j8 -E "^agc_driver_|^video_out_flip" 527/528, the one failure being windows_exceptions which fails on unchanged main since #1423 (#3411); with main's Export.cpp both tests fail; tools/check_conventions.py --base main and git diff --check pass. Not run on Linux, no title run.

Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5800335096 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3445). Originally posted by [screamm](https://github.com/screamm) on 2026-10-11T10:44:17Z. --- libSceRudp lacks seven exports that Demon Slayer (PPSA03490) imports: `sceRudpNetFlush`, `sceRudpProcessEvents`, `sceRudpGetMaxSegmentSize`, `sceRudpGetNumberOfPacketsToRead`, `sceRudpGetSizeWritable`, `sceRudpGetSizeReadable`, `sceRudpNetReceived` (#3073: "7 absent, all in libSceRudp", with console measurements by hugodearaujo on firmware 13.60). On top of that `main` has `sceRudpEnd` and `sceRudpTerminate` swapped. **Fix branch ready:** [`screamm:feat/rudp-absent-calls`](https://github.com/screamm/AnyPS5/tree/feat/rudp-absent-calls) (two commits on `main` `cfbd516c`: `7b33fe41` `fix(libSceRudp): swap sceRudpEnd and sceRudpTerminate`, `a5b1cf2b` `feat(libSceRudp): implement the net flush, event and size queries`). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commits as they are. - The swap: `sceRudpEnd(void)` shuts the library down and `sceRudpTerminate(int ctx)` releases a context; three sources agree (the #3073 measurement "after `sceRudpEnd()` all three return `0x80770001` again", Orbital `db_types.json` lines 1971 and 1996, RPCS3 `cellRudp.cpp` and the Vita3K fork `SceLibRudp.cpp`); the bodies are exchanged, nothing else changes, `guest_offline_imports` follows. - `GetMaxSegmentSize` writes the measured 1410 (null pointer `0x80770004`); `ProcessEvents` (sleeps the microsecond timeout as fpPS4 does) and `NetFlush` return 0 after init; all three return `0x80770001` before init as measured. The context queries check not-initialised, negative id (`0x80770004`), unknown id (`0x80770003`), then answer 0 packets and `0x80770011` (`NOT_ACCEPTABLE`) for the size queries on any context, since no context can connect offline (check order and the unconnected gate from the Vita3K fork). `NetReceived` throws (unmeasured, uncalled); `ProcessEvents`/`NetFlush` throw once the internal I/O thread is enabled (the measurement does not cover it). TechnicalDebt lists measured vs. assumed. - `guest_rudp_status` runs each call before init, after init without a context, on created, bound and initiated contexts, after terminate, with the I/O thread on, after End and after a second init. **Tested** on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, `BUILD_TESTING=ON`, full build including `libs`: `guest_rudp_status` and `guest_offline_imports` 3/3; `ctest -j8 -E "^agc_driver_|^video_out_flip"` 527/528, the one failure being `windows_exceptions` which fails on unchanged `main` since #1423 (#3411); with `main`'s `Export.cpp` both tests fail; `tools/check_conventions.py --base main` and `git diff --check` pass. Not run on Linux, no title run. Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).
blawesom commented 2026-10-11 13:08:48 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T13:08:48Z.


Independent verification on Linux: CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON.

Note first: this branch partially overlaps main now. 58bf763e8 has since implemented sceRudpGetNumberOfPacketsToRead, sceRudpGetSizeWritable and sceRudpGetSizeReadable, and 4c4e789a3 settled sceRudpEnd(int) (per-context) and sceRudpTerminate(void) (global) — the opposite of this branch's End/Terminate signatures. The rebased branch therefore:

  • drops the three duplicated query implementations (main's newer versions kept),
  • keeps main's End/Terminate shapes and reworks the branch's tests (and GuestOfflineImports) to them,
  • keeps this branch's four genuinely new exports — sceRudpProcessEvents, sceRudpNetFlush, sceRudpNetReceived and sceRudpGetMaxSegmentSize — and the g_io_thread tracking.

Verified: tools/check_conventions.py and git diff --check pass; guest_rudp_status, guest_rudp_context_queries and guest_offline_imports pass; full suite 832/832 on AMD RX 9070 XT / RADV.

The rebased branch is available at blawesom:verify/3445 for anyone carrying — the four new exports and their tests are unchanged, the overlap adaptations are as above.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6109355610 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3445#issuecomment-6109355610). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-11T13:08:48Z. --- Independent verification on **Linux**: CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`. **Note first: this branch partially overlaps main now.** `58bf763e8` has since implemented `sceRudpGetNumberOfPacketsToRead`, `sceRudpGetSizeWritable` and `sceRudpGetSizeReadable`, and `4c4e789a3` settled `sceRudpEnd(int)` (per-context) and `sceRudpTerminate(void)` (global) — the opposite of this branch's End/Terminate signatures. The rebased branch therefore: - drops the three duplicated query implementations (main's newer versions kept), - keeps main's End/Terminate shapes and reworks the branch's tests (and `GuestOfflineImports`) to them, - keeps this branch's four genuinely new exports — `sceRudpProcessEvents`, `sceRudpNetFlush`, `sceRudpNetReceived` and `sceRudpGetMaxSegmentSize` — and the `g_io_thread` tracking. Verified: `tools/check_conventions.py` and `git diff --check` pass; `guest_rudp_status`, `guest_rudp_context_queries` and `guest_offline_imports` pass; full suite **832/832** on AMD RX 9070 XT / RADV. The rebased branch is available at [`blawesom:verify/3445`](https://github.com/blawesom/AnyPS5/tree/verify/3445) for anyone carrying — the four new exports and their tests are unchanged, the overlap adaptations are as above.
ArekatlaNishanthchowdary commented 2026-10-11 17:44:13 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ArekatlaNishanthchowdary on 2026-10-11T17:44:13Z.


Corrected: when I first posted this I had missed #3823, which was already open and adds sceRudpProcessEvents, sceRudpNetFlush, sceRudpGetMaxSegmentSize and sceRudpNetReceived. My branch no longer carries those; it is reduced to the part #3823 does not cover, the sceRudpEnd / sceRudpTerminate swap.

Branch: ArekatlaNishanthchowdary:feat/rudp-absent-calls (48ad3fd44, force-pushed over 3afdbca85), two commits on current main (a11c8f7f7):

  • 97dbd517b: @screamm's fix(libSceRudp): swap sceRudpEnd and sceRudpTerminate, unchanged, authorship kept.
  • 48ad3fd44: guest_rudp_context_queries (added on main in 58bf763e8) called sceRudpEnd(context) and sceRudpTerminate(); it follows the swap.

The second commit of the original branch is dropped: main already has the three context queries, and #3823 covers the other four calls.

Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release:

  • guest_rudp_status, guest_rudp_context_queries and guest_offline_imports pass. Full ctest not run on the reduced branch.
  • tools/check_conventions.py --base origin/main passes. No title or homebrew run. Linux not run.

My one open-PR slot is taken by #3744, so I will open the swap as a PR once that is merged or closed.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111850449 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3445#issuecomment-6111850449). Originally posted by [ArekatlaNishanthchowdary](https://github.com/ArekatlaNishanthchowdary) on 2026-10-11T17:44:13Z. --- Corrected: when I first posted this I had missed #3823, which was already open and adds `sceRudpProcessEvents`, `sceRudpNetFlush`, `sceRudpGetMaxSegmentSize` and `sceRudpNetReceived`. My branch no longer carries those; it is reduced to the part #3823 does not cover, the `sceRudpEnd` / `sceRudpTerminate` swap. Branch: [`ArekatlaNishanthchowdary:feat/rudp-absent-calls`](https://github.com/ArekatlaNishanthchowdary/AnyPS5/tree/feat/rudp-absent-calls) (`48ad3fd44`, force-pushed over `3afdbca85`), two commits on current `main` (`a11c8f7f7`): - `97dbd517b`: @screamm's `fix(libSceRudp): swap sceRudpEnd and sceRudpTerminate`, unchanged, authorship kept. - `48ad3fd44`: `guest_rudp_context_queries` (added on `main` in `58bf763e8`) called `sceRudpEnd(context)` and `sceRudpTerminate()`; it follows the swap. The second commit of the original branch is dropped: `main` already has the three context queries, and #3823 covers the other four calls. Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release: - `guest_rudp_status`, `guest_rudp_context_queries` and `guest_offline_imports` pass. Full `ctest` not run on the reduced branch. - `tools/check_conventions.py --base origin/main` passes. No title or homebrew run. Linux not run. My one open-PR slot is taken by #3744, so I will open the swap as a PR once that is merged or closed. AI-assisted: yes (Claude Code).
oneandonlydean commented 2026-10-14 00:08:33 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T00:08:33Z.


Closing: #3823 added the four missing calls, the other three were already on main, and #3973 fixed End/Terminate. Comment here if PPSA03490 still stops in libSceRudp on current main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6157868247 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3445#issuecomment-6157868247). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T00:08:33Z. --- Closing: #3823 added the four missing calls, the other three were already on main, and #3973 fixed End/Terminate. Comment here if PPSA03490 still stops in libSceRudp on current main.
Sign in to join this conversation.
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#3445
No description provided.