fix(libSceRudp): correct End and Terminate functions #3973

Merged
MarcZX10 merged 2 commits from upstream-pr/3973 into main 2026-10-13 11:40:05 +00:00
MarcZX10 commented 2026-10-11 20:17:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T20:17:40Z.


What

Carries David's sceRudpEnd/sceRudpTerminate correction from issue #3445, preserving his implementation commit author. sceRudpEnd() shuts down the library and clears its contexts; sceRudpTerminate(ctx_id) releases one context. The function names and argument counts were reversed in the previous implementation.

Updates the context-query and pump tests to call the corrected functions, retaining the newer sceRudpGetMaxSegmentSize coverage from current main.

The implementation is supported by the console measurements in #3073 and matching declarations/behavior in Orbital, RPCS3, and Vita3K. The unrelated RUDP exports from #3445 are not included.

Tested

  • Before this rebase, the PR description reported Linux GCC 12.2 Release tests for guest_rudp_status_tests and guest_offline_imports_tests (2/2); this result is from the pre-rebase head.
  • Arekatla reports Windows 11 runs for the swap and test correction on a branch based on e013f8c9c: guest_rudp_status, guest_rudp_context_queries, guest_rudp_pump, and guest_offline_imports passed. This is not a run of the current rebased head.
  • Current rebased head: git diff --check upstream/main...HEAD passed. No build or runtime tests were run after the latest rebase onto main fc1f063f5.

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
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4822032670 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3973). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-11T20:17:40Z. --- ### What Carries David's `sceRudpEnd`/`sceRudpTerminate` correction from issue #3445, preserving his implementation commit author. `sceRudpEnd()` shuts down the library and clears its contexts; `sceRudpTerminate(ctx_id)` releases one context. The function names and argument counts were reversed in the previous implementation. Updates the context-query and pump tests to call the corrected functions, retaining the newer `sceRudpGetMaxSegmentSize` coverage from current `main`. The implementation is supported by the console measurements in #3073 and matching declarations/behavior in Orbital, RPCS3, and Vita3K. The unrelated RUDP exports from #3445 are not included. ### Tested - Before this rebase, the PR description reported Linux GCC 12.2 Release tests for `guest_rudp_status_tests` and `guest_offline_imports_tests` (2/2); this result is from the pre-rebase head. - Arekatla reports Windows 11 runs for the swap and test correction on a branch based on `e013f8c9c`: `guest_rudp_status`, `guest_rudp_context_queries`, `guest_rudp_pump`, and `guest_offline_imports` passed. This is not a run of the current rebased head. - Current rebased head: `git diff --check upstream/main...HEAD` passed. No build or runtime tests were run after the latest rebase onto `main` `fc1f063f5`. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical debt file - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] AI-assisted: yes
oneandonlydean commented 2026-10-12 00:22:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T00:22:24Z.


guest_rudp_context_queries and guest_rudp_pump abort with this change: both still call sceRudpTerminate() with the old meaning (GuestRudpPump.cpp). Please update those two tests with the swap.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6115550824 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3973#issuecomment-6115550824). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-12T00:22:24Z. --- `guest_rudp_context_queries` and `guest_rudp_pump` abort with this change: both still call `sceRudpTerminate()` with the old meaning (`GuestRudpPump.cpp`). Please update those two tests with the swap.
ArekatlaNishanthchowdary commented 2026-10-12 04:57:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ArekatlaNishanthchowdary on 2026-10-12T04:57:18Z.


Both test updates are in 0f2a0215a on ArekatlaNishanthchowdary:feat/rudp-absent-calls, the commit after the swap on that branch, rebased onto current main (e013f8c9c). It can be cherry-picked onto this PR as is:

  • guest_rudp_context_queries: sceRudpEnd(context) / sceRudpTerminate() become sceRudpTerminate(context) / sceRudpEnd().
  • guest_rudp_pump: sceRudpTerminate() becomes sceRudpEnd().

Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release, swap plus that commit on current main: guest_rudp_status, guest_rudp_context_queries, guest_rudp_pump and guest_offline_imports pass; tools/check_conventions.py --base origin/main passes. Full ctest not run.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6118023404 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3973#issuecomment-6118023404). Originally posted by [ArekatlaNishanthchowdary](https://github.com/ArekatlaNishanthchowdary) on 2026-10-12T04:57:18Z. --- Both test updates are in `0f2a0215a` on [`ArekatlaNishanthchowdary:feat/rudp-absent-calls`](https://github.com/ArekatlaNishanthchowdary/AnyPS5/tree/feat/rudp-absent-calls), the commit after the swap on that branch, rebased onto current `main` (`e013f8c9c`). It can be cherry-picked onto this PR as is: - `guest_rudp_context_queries`: `sceRudpEnd(context)` / `sceRudpTerminate()` become `sceRudpTerminate(context)` / `sceRudpEnd()`. - `guest_rudp_pump`: `sceRudpTerminate()` becomes `sceRudpEnd()`. Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release, swap plus that commit on current `main`: `guest_rudp_status`, `guest_rudp_context_queries`, `guest_rudp_pump` and `guest_offline_imports` pass; `tools/check_conventions.py --base origin/main` passes. Full `ctest` not run. AI-assisted: yes (Claude Code).
MarcZX10 commented 2026-10-13 07:13:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T07:13:35Z.


Thanks for preparing the test correction and reporting the Windows results. The current PR still does not include the test updates. I will review the offered commit against the current head and carry it with your authorship preserved if it applies cleanly, then rerun the focused tests.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6140340443 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3973#issuecomment-6140340443). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T07:13:35Z. --- Thanks for preparing the test correction and reporting the Windows results. The current PR still does not include the test updates. I will review the offered commit against the current head and carry it with your authorship preserved if it applies cleanly, then rerun the focused tests.
MarcZX10 commented 2026-10-13 07:45:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T07:45:30Z.


Rebased onto current main and carried Arekatla’s offered test commit with their authorship preserved. Both context-query calls now use sceRudpTerminate(context) followed by sceRudpEnd(); the pump test calls sceRudpEnd(). I resolved the overlap with newer main by keeping its sceRudpGetMaxSegmentSize test coverage and applying only the shutdown-call correction.

The earlier Linux and Windows results are recorded with their reported pre-rebase bases; this updated head has not been rebuilt or rerun. git diff --check passes on the current patch. Thanks, Arekatla, for preparing the focused correction.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6140829616 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3973#issuecomment-6140829616). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T07:45:30Z. --- Rebased onto current `main` and carried Arekatla’s offered test commit with their authorship preserved. Both context-query calls now use `sceRudpTerminate(context)` followed by `sceRudpEnd()`; the pump test calls `sceRudpEnd()`. I resolved the overlap with newer main by keeping its `sceRudpGetMaxSegmentSize` test coverage and applying only the shutdown-call correction. The earlier Linux and Windows results are recorded with their reported pre-rebase bases; this updated head has not been rebuilt or rerun. `git diff --check` passes on the current patch. Thanks, Arekatla, for preparing the focused correction.
adriadam10 commented 2026-10-13 10:16:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T10:16:15Z.


Checked the End/Terminate swap on current main plus this PR: guest_rudp_status, guest_rudp_context_queries, guest_rudp_pump, guest_offline_imports pass, and all four fail with Export.cpp reverted. The new GuestRudpStatus checks cover not-initialized, double terminate and re-init. Merging once the full Build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6143338359 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3973#issuecomment-6143338359). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-13T10:16:15Z. --- Checked the End/Terminate swap on current main plus this PR: `guest_rudp_status`, `guest_rudp_context_queries`, `guest_rudp_pump`, `guest_offline_imports` pass, and all four fail with `Export.cpp` reverted. The new `GuestRudpStatus` checks cover not-initialized, double terminate and re-init. Merging once the full Build is green.
Sign in to join this conversation.
No reviewers
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!3973
No description provided.