Skip to content

feat(libSceRudp): accept sceRudpEnableInternalIOThread2 like the first IO thread call - #6021

Closed
KernelPanicNT wants to merge 1 commit into
boykopovar:mainfrom
KernelPanicNT:feat/libscerudp-internal-io-thread2
Closed

KernelPanicNT wants to merge 1 commit into
boykopovar:mainfrom
KernelPanicNT:feat/libscerudp-internal-io-thread2

Conversation

@KernelPanicNT

@KernelPanicNT KernelPanicNT commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What

Gives sceRudpEnableInternalIOThread2, declared without parameters by #3853, its signature and makes it answer as sceRudpEnableInternalIOThread already does.

Source of the behaviour. No console measurement is involved.

  • Signature: Orbital's IDA type database lists int sceRudpEnableInternalIOThread2(uint32_t stackSize, uint32_t priority, SceKernelCpumask affinityMask), the first call's two parameters plus an affinity mask. This is the PS4 signature. No source gives a PS5 signature; shadPS4 and OpenOrbis (PS4) and Vita3K (Vita) declare the call without parameters. SceKernelCpumask is the existing KernelCpumask (uint64_t) in SceTypes.hpp.
  • Results: the first call, written by OverkillLabs in the offline Rudp stack (commit 3230352, merged as a5e7d1f), returns RUDP_ERROR_NOT_INITIALIZED (0x80770001) before sceRudpInit and 0 after it, without starting a thread. Its behaviour is not changed here; the second call takes the same path.
  • Why no thread is started: no context here ever holds pending data to process, because sceRudpWrite, sceRudpRead and sceRudpGetStatus report a reset or idle context. fix(rudp): provide the calls PPSA03490 still lacks #3823 (xXPBSXx) recorded that justification for sceRudpProcessEvents and sceRudpNetFlush. It covers only this "nothing to process" part. Those pump calls can be repeated without changing any state, while enabling the IO thread is a one-shot state change, so fix(rudp): provide the calls PPSA03490 still lacks #3823 says nothing about a second enable.
  • Second enable within one sceRudpInit/sceRudpEnd cycle: not modelled for either call; it returns 0 here. The Vita3K fork that docs/dev/debt/libSceRudp.md already cites returns SCE_RUDP_ERROR_THREAD_IN_USE (0x80770010) from its sceRudpEnableInternalIOThread once its thread has started and leaves sceRudpEnableInternalIOThread2 unimplemented. The console result is unknown. The test does not pin this case, and the debt entry records it. Argument validation (zero stack size or priority, mask range) is not modelled either and is not tested.

Changes:

  • sceRudpEnableInternalIOThread2(stackSize, priority, affinityMask) forwards to sceRudpEnableInternalIOThread(stackSize, priority). The affinity mask is not applied, as the stack size and priority are not applied by the first call.
  • guest_rudp_pump: both calls return RUDP_ERROR_NOT_INITIALIZED before sceRudpInit. Each call is then made once in its own sceRudpInit/sceRudpEnd cycle: it returns 0 inside the cycle and RUDP_ERROR_NOT_INITIALIZED after sceRudpEnd. No cycle enables twice.
  • docs/dev/debt/libSceRudp.md: the function is removed from the "declared without parameters" entry. A Silent stubs entry now covers both sceRudpEnableInternalIOThread and sceRudpEnableInternalIOThread2 (success after sceRudpInit without starting a thread), next to the pump calls placed there in fix(rudp): provide the calls PPSA03490 still lacks #3823. It records that a second enable within one cycle is not modelled (Vita3K fork: SCE_RUDP_ERROR_THREAD_IN_USE; console unknown), that arguments are not validated, and the PS4-only signature (Orbital, pinned to the same commit as above).

Nothing stays throwing in this function. sceRudpGetOption and sceRudpGetRemoteInfo, declared in the same entry by #3853 (billythemenace2), still throw: no source gives their signatures.

Progress: libSceRudp 20/24 → 21/24 (tools/progress.py).

Tested

Head 93c85830907510660f79cb67216224b8a4e56a74, base e27ff7c545cb5ac669612567d853956ffa02ebe6.

  • Linux (Ubuntu 24.04, GCC 14.2.0, Ninja, Release, BUILD_TESTING=ON, AMD EPYC 7763 (GitHub Codespaces), tests run natively): guest_rudp_pump_tests, guest_rudp_status_tests and guest_rudp_context_queries_tests each pass in 5 of 5 runs, the test executable being run directly five times.
  • Negative control: keep the tests and replace only core/libs/prx/libSceRudp/Export.cpp with the base version: guest_rudp_pump_tests fails with sceRudpEnableInternalIOThread2 not implemented; guest_rudp_status_tests, guest_rudp_context_queries_tests still pass there, as expected for regression coverage. Restoring the PR source and rebuilding, guest_rudp_pump_tests, guest_rudp_status_tests and guest_rudp_context_queries_tests each pass in 5 of 5 runs again.
  • Windows, full Build workflow on my fork (run 38618151303), this head built together with the other queued branches and merged into the fork's main at 2b7e3ce69fd889deceb6b52ac1fbf13e7c0d1084, WinLibs MinGW-w64 GCC 15.2.0, Release, BUILD_TESTING=ON: 1212/1212 tests pass; the relinker (Linux, Windows, macOS), register-context and write-watch jobs of the same run also pass.
  • Conventions checker and git diff --check pass. The Linux job of the Build workflow now targets the project's self-hosted runner, so it was not run on the fork; no title was run.

Duplicate and overlap check

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 (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Claude)

🤖 Generated with Claude Code

…t IO thread call

The signature (uint32_t stackSize, uint32_t priority, SceKernelCpumask
affinityMask) is the PS4 one from Orbital's IDA type database. It
answers as sceRudpEnableInternalIOThread: RUDP_ERROR_NOT_INITIALIZED
before sceRudpInit and success after it. Neither call starts a thread,
since no context ever holds pending data to process, so the affinity is
not applied, as the stack size and priority already are not.

A second enable within one sceRudpInit/sceRudpEnd cycle is not modelled
for either call: the Vita3K fork returns SCE_RUDP_ERROR_THREAD_IN_USE
there and the console result is unknown. The test makes each enable
call once per cycle and the debt entry records the gap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Progress report (19fc5a8 → 93c8583)

📈 System libraries: 88.72% (+0.03%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceRudp sceRudpEnableInternalIOThread2

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 6044 core/libs/tests/GuestRudpPump.cpp

@adriadam10 adriadam10 self-assigned this Oct 16, 2026
@adriadam10

Copy link
Copy Markdown
Collaborator

Closing for now: no title is known to reach sceRudpEnableInternalIOThread2. PPSA06888 imports it but, per #3853, does not call it during start-up, and the PR lists Unblocks: none. This turns a throw into a success on a signature only known from PS4 (Orbital), with no console measurement. oneandonlydean asked on #5613 to hold PRs that don't name a title needing the change while the queue is this long.

The code and the test are fine (build and the libs ctest scope pass; guest_rudp_pump fails without the Export.cpp change). If a title stops on this call on current main, please reopen with its PPSA id and the log line.

@adriadam10 adriadam10 closed this Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants