Repository navigation
feat(libSceRudp): implement sceRudpGetMaxSegmentSize - #4255
Merged
oneandonlydean merged 1 commit intoOct 12, 2026
Merged
oneandonlydean merged 1 commit into
oneandonlydean merged 1 commit into
Conversation
This was referenced Oct 12, 2026
Contributor
Author
|
@xXPBSXx since you have Demon Slayer (PPSA03490) set up on Windows: could you run it with this branch on top of current AI-assisted: yes |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements
sceRudpGetMaxSegmentSize(vfrL8gPlm2Y) in libSceRudp with the values measured on a PS5, replacing theNotImplemented_nid_no_patchthrow from #3823.Demon Slayer -Kimetsu no Yaiba- The Hinokami Chronicles (PPSA03490) stops on it. @xXPBSXx reported on #4238 that a run on
maind0ca839 ends withwhat(): sceRudpGetMaxSegmentSize not implemented, thrown fromlibSceRudp.prx, and on #3073 that with the PlayGo chunk check restored the title mounts its pak directories and then aborts there.The review of #3823 (adriadam10) asked for either a throw or "a real value with a cited source", with the signature listed as inferred in TechnicalDebt. The source is @hugodearaujo's measurement on a PS5 (firmware 13.60), the same series
4c4e789a3already uses forsceRudpInitandsceRudpGetStatus:sceRudpInitsceRudpGetMaxSegmentSize(&v)0x80770001,vuntouchedv= 1410 (0x582)sceRudpGetMaxSegmentSize(NULL)0x807700010x80770004The call follows that table: under
g_mutex, it returnsRUDP_ERROR_NOT_INITIALIZEDwhen the library is not initialised (checked before the pointer, as the console does),RUDP_ERROR_INVALID_ARGUMENTfor a null pointer, and otherwise writes 1410 and returns 0. AftersceRudpTerminateit returnsRUDP_ERROR_NOT_INITIALIZEDagain.The parameter is
uint16_t*, which is inferred. The measurement does not say how many bytes the console writes. The title passes a pointer to a 16-bit value it set to 0, treats a nonzero result as failure and reads the 16-bit value on success (call-site trace in #3073). The PS3 counterpart takes the segment size asu16(RPCS3cellRudpSetMaxSegmentSize(u16 mss)). So only 16 bits are written, which cannot overrun the title's variable. No header or emulator gives a parameter list: OpenOrbisRudp.hdeclaresvoid sceRudpGetMaxSegmentSize(), and shadPS4, Vita3K and RPCS3 (cellRudpGetMaxSegmentSize) stub it without parameters. TechnicalDebt records what was measured and what is inferred.Tested
guest_rudp_pumpnow checkssceRudpGetMaxSegmentSizeinstead of expecting a throw:sceRudpInit, it returns0x80770001for a valid and for a null pointer, and leaves the value at0x5a5a.sceRudpInit, a null pointer returns0x80770004. A valid pointer gets 1410 with result 0, and a write into the middle element of auint16_t[3]leaves both neighbours untouched.sceRudpTerminate, it returns0x80770001again and does not write.sceRudpNetReceivedstill throws.GuestRudpPump.cppandExport.cpplinked with aNotImplemented_nid_no_patchthat throws, Debug and-O1): passes. Three mutants each abort: a value of 1400 fails at the 1410 check, a 32-bit write fails at the neighbour check (and is caught as a misaligned store under UBSan), and checking the pointer before initialisation fails at the null-before-init check.x86_64-linux-gnuandx86_64-windows-gnu(Export.cpp,GuestRudpPump.cpp): no errors.python3 tools/check_conventions.pywith this description: all checks pass.LowLevelFatalErrorin the first post of Demon Slayer (PPSA03490) on Windows: Unreal LowLevelFatalError into the title's libc fatal path (libc.prx.guest.prx+0x141b0) #4238 is not shown here.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository