feat(libSceNet): declare 21 exports with known signatures #2266

Closed
brycebrower2008 wants to merge 1 commit from upstream-pr/2266 into main
brycebrower2008 commented 2026-10-09 14:03:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by brycebrower2008 on 2026-10-09T14:03:26Z.


What

Declares 21 libSceNet exports that the PS5 module has and no library defined, as throwing stubs: sceNetEtherStrton, sceNetGet/SetDnsInfo, sceNetGet/SetDns6Info, sceNetGetIfName, sceNetGetRandom, sceNetGetStatisticsInfo, sceNetGetSystemTime, sceNetInetPtonEx, sceNetIoctl, sceNetMemoryAllocate/Free, the five sceNetShow*WithMemory calls, sceNetThreadCreate/Join and sceNetUsleep.

Signatures follow shadPS4's net.h (PS4); TechnicalDebt records that they are not confirmed for the PS5. sceNetGetIfList is also exported but has no agreed signature (shadPS4 declares none, OpenOrbis a guessed one), so it is left out.

How the functions were chosen: each one is in the PS5 module's export list in ps5-payload-dev/sdk sce_stubs (generated from firmware .sprx exports), its name hashes to the NID shadPS4 registers, no library in main defines that NID, and none of the open pull requests adds it (checked against the APS5_VABI definitions in the head of every open PR). Only functions with a published signature are included; exports whose signature nobody has published are left out rather than declared without parameters.

Tested

Linux (Ubuntu 24.04, GCC 13.3), full build with BUILD_TESTING=ON, with this branch merged together with the other three declaration PRs. ninja libs builds and NID-patches every library; patched_libraries, guest_http, guest_http_response_header, guest_http2, progress_report, nid_patcher_dynamic_strings, nid_patcher_symbol_versions and strict_nid_filter pass. readelf --dyn-syms on the patched .prx files shows each new function exported under its NID. guest_sce_net aborts in the test container on unmodified main too, because the container has no IPv6 (socket(AF_INET6) fails with EAFNOSUPPORT). tools/check_conventions.py --base origin/main passes. No title or homebrew run: these are throwing stubs, so they only change which imports bind at startup.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4801502460 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2266). Originally posted by [brycebrower2008](https://github.com/brycebrower2008) on 2026-10-09T14:03:26Z. --- ### What Declares 21 libSceNet exports that the PS5 module has and no library defined, as throwing stubs: `sceNetEtherStrton`, `sceNetGet/SetDnsInfo`, `sceNetGet/SetDns6Info`, `sceNetGetIfName`, `sceNetGetRandom`, `sceNetGetStatisticsInfo`, `sceNetGetSystemTime`, `sceNetInetPtonEx`, `sceNetIoctl`, `sceNetMemoryAllocate/Free`, the five `sceNetShow*WithMemory` calls, `sceNetThreadCreate/Join` and `sceNetUsleep`. Signatures follow shadPS4's [net.h](https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/net/net.h) (PS4); TechnicalDebt records that they are not confirmed for the PS5. `sceNetGetIfList` is also exported but has no agreed signature (shadPS4 declares none, OpenOrbis a guessed one), so it is left out. How the functions were chosen: each one is in the PS5 module's export list in [ps5-payload-dev/sdk `sce_stubs`](https://github.com/ps5-payload-dev/sdk/tree/master/sce_stubs) (generated from firmware `.sprx` exports), its name hashes to the NID shadPS4 registers, no library in `main` defines that NID, and none of the open pull requests adds it (checked against the `APS5_VABI` definitions in the head of every open PR). Only functions with a published signature are included; exports whose signature nobody has published are left out rather than declared without parameters. ### Tested Linux (Ubuntu 24.04, GCC 13.3), full build with `BUILD_TESTING=ON`, with this branch merged together with the other three declaration PRs. `ninja libs` builds and NID-patches every library; `patched_libraries`, `guest_http`, `guest_http_response_header`, `guest_http2`, `progress_report`, `nid_patcher_dynamic_strings`, `nid_patcher_symbol_versions` and `strict_nid_filter` pass. `readelf --dyn-syms` on the patched `.prx` files shows each new function exported under its NID. `guest_sce_net` aborts in the test container on unmodified `main` too, because the container has no IPv6 (`socket(AF_INET6)` fails with `EAFNOSUPPORT`). `tools/check_conventions.py --base origin/main` passes. No title or homebrew run: these are throwing stubs, so they only change which imports bind at startup. ### 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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
Dextroid17 commented 2026-10-09 15:10:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-09T15:10:52Z.

Review: COMMENTED


Verified on Linux.

  • base d70b8998 (upstream/main) + head c94515c1.

  • Artifact control on the built module: unpatched/libSceNet.prx carries 19 of the 19 declared functions with this PR, and 0 of them without it (main's module). Pre-existing neighbours (sceNetInit_nid_postfix, sceNetBind_nid_postfix) are present in both arms, so nothing was displaced.

  • Citations checked against the source, not taken on trust. Four spot-checked against shadPS4/src/core/libraries/net/net.h (fetched, 12,697 bytes):

    shadPS4 this PR
    sceNetEtherStrton const char* str, OrbisNetEtherAddr* n const char* str, NetEtherAddr* n
    sceNetGetRandom u32* out uint32_t* out
    sceNetIoctl OrbisNetId s, u64 cmd, void* data int s, uint64_t cmd, void* data
    sceNetUsleep s32 microseconds int microseconds

    All four agree; the differences are typedef spelling (u32/u64/s32 -> the fixed-width names, OrbisNetId -> int), which is the right way to port them.

  • No duplicates: none of the 19 names exists in the module on main.

  • The TechnicalDebt.md bullet listing the declarations is present, which is what makes throwing stubs acceptable here rather than silent ones.

The bar, and what I can and cannot supply for it. A declaration batch lands when it names the title that imports those functions. I can check one title against a full import registry — PPSA26344 (Ghost of Yotei) — and it imports none of these (0 of the 683 imports I can resolve; 19 of its 702 stayed unresolved, so I am not claiming "none" absolutely). That is a negative, not a substitute for your positive: naming the title that needs these is the part that decides whether this merges.

What I could not verify: that a title calls any of them (an import is not a call), and no runtime beyond the module build.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5471893187 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2266#pullrequestreview-5471893187). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-09T15:10:52Z. **Review:** COMMENTED --- Verified on Linux. - base `d70b8998` (upstream/main) + head `c94515c1`. - **Artifact control** on the built module: `unpatched/libSceNet.prx` carries **19 of the 19** declared functions with this PR, and **0** of them without it (`main`'s module). Pre-existing neighbours (`sceNetInit_nid_postfix`, `sceNetBind_nid_postfix`) are present in both arms, so nothing was displaced. - **Citations checked against the source, not taken on trust.** Four spot-checked against `shadPS4/src/core/libraries/net/net.h` (fetched, 12,697 bytes): | | shadPS4 | this PR | |---|---|---| | `sceNetEtherStrton` | `const char* str, OrbisNetEtherAddr* n` | `const char* str, NetEtherAddr* n` | | `sceNetGetRandom` | `u32* out` | `uint32_t* out` | | `sceNetIoctl` | `OrbisNetId s, u64 cmd, void* data` | `int s, uint64_t cmd, void* data` | | `sceNetUsleep` | `s32 microseconds` | `int microseconds` | All four agree; the differences are typedef spelling (`u32`/`u64`/`s32` -> the fixed-width names, `OrbisNetId` -> `int`), which is the right way to port them. - No duplicates: none of the 19 names exists in the module on `main`. - The `TechnicalDebt.md` bullet listing the declarations is present, which is what makes throwing stubs acceptable here rather than silent ones. **The bar, and what I can and cannot supply for it.** A declaration batch lands when it names the title that imports those functions. I can check one title against a full import registry — PPSA26344 (Ghost of Yotei) — and it **imports none of these** (0 of the 683 imports I can resolve; 19 of its 702 stayed unresolved, so I am not claiming "none" absolutely). That is a negative, not a substitute for your positive: naming the title that needs these is the part that decides whether this merges. What I could not verify: that a title **calls** any of them (an import is not a call), and no runtime beyond the module build. Written with AI assistance.
popcoder565 commented 2026-10-09 15:47:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T15:47:31Z.


Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head c94515c1, merged onto main d70b8998 in one build with 38 other PRs that had no Windows run.

  • This PR has no test of its own. It builds, and the full suite passes.
  • Full ctest in that build: 519 of 519. That needed local fixes to three other PRs in the batch that don't build or pass on Windows: #1611, #1796 and #1824 (reported there).

No title was run.

🤖 Addressed by Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6084289059 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2266#issuecomment-6084289059). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-09T15:47:31Z. --- Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head `c94515c1`, merged onto `main` d70b8998 in one build with 38 other PRs that had no Windows run. - This PR has no test of its own. It builds, and the full suite passes. - Full ctest in that build: 519 of 519. That needed local fixes to three other PRs in the batch that don't build or pass on Windows: #1611, #1796 and #1824 (reported there). No title was run. _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
github-actions[bot] commented 2026-10-09 16:31:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T16:31:25Z.


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.

Pull request Conflicting files (lines on main) Same exports Same new files
#2334 docs/dev/TechnicalDebt.md L199
#2343 docs/dev/TechnicalDebt.md L199
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6085016887 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2266#issuecomment-6085016887). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-09T16:31:25Z. --- <!-- pr-overlap --> 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**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #2334 | `docs/dev/TechnicalDebt.md` [L199](https://github.com/boykopovar/AnyPS5/blob/8b393b6e9a8ade9188d4f74a0293e0efd9828597/docs/dev/TechnicalDebt.md#L199) | | | | #2343 | `docs/dev/TechnicalDebt.md` [L199](https://github.com/boykopovar/AnyPS5/blob/8b393b6e9a8ade9188d4f74a0293e0efd9828597/docs/dev/TechnicalDebt.md#L199) | | |
oneandonlydean commented 2026-10-09 20:10:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T20:10:54Z.


Same as #2265.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6088455747 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2266#issuecomment-6088455747). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T20:10:54Z. --- Same as #2265.

Pull request closed

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!2266
No description provided.