Skip to content

feat(libSceNet): implement interface names, random values and net memory - #8054

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
HQasper:feat/net-interface-names
Oct 20, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
HQasper:feat/net-interface-names

Conversation

@HQasper

@HQasper HQasper commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What

Implements sceNetGetIfName, sceNetGetRandom, sceNetMemoryAllocate and sceNetMemoryFree, which were throwing stubs; the behaviour and its sources are recorded in docs/dev/debt/libSceNet.md.

Tested

Linux (gcc, Release): guest_sce_net runs the new checks (interface names, random values, net memory) and every check before its IPv6 section; the container has no IPv6 loopback, so the test then exits as skipped (77), as it does on unchanged main. No title was run.

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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

Implement sceNetGetIfName, sceNetGetRandom, sceNetMemoryAllocate and
sceNetMemoryFree with the signatures shadPS4 uses, and cover them in
guest_sce_net_tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Progress report (c0adf02 → b0a9676)

📈 System libraries: 79.91% (+0.08%, +4 implemented functions)

✅ 4 implemented
Library Name
libSceNet sceNetGetIfName
libSceNet sceNetGetRandom
libSceNet sceNetMemoryAllocate
libSceNet sceNetMemoryFree

@HQasper

HQasper commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Manual check of the files the overlap report could not compare. #5836 and #7332 change core/libs/prx/libSceNet/Export.cpp, but neither implements or changes sceNetGetIfName, sceNetGetRandom, sceNetMemoryAllocate or sceNetMemoryFree, and no other open pull request does (also checked by NID). #6044 moves GuestSceNet.cpp to core/libs/tests/networking/; a merge carries this change's test lines to the new path. Merged directly with this branch, each of the three conflicts only where it already conflicts with main, never in lines this change touches. Depends on: none.

@wachi35676

Copy link
Copy Markdown
Contributor

Windows 11, Ryzen 5 9600X, WinLibs GCC 15.2.0 (UCRT), Release, BUILD_TESTING=ON. Head b0a967684 merged onto main eb75006.

  • guest_sce_net passes on Windows (2.96 s), including the IPv6 section that the PR's Linux container skipped.
  • Negative control: with libSceNet/Export.cpp put back to main, the test aborts with sceNetGetIfName not implemented.
  • Checked against the shadPS4 source the debt cites, net.cpp at d5ba5fd06 (lines 1408, 1482, 1887 and 1896). The ten names, EINVAL with "" past the table, EINVAL for a null sceNetGetRandom output, flag 2 as zero fill, and null for size <= 0 all match.
    • Two differences, both deliberate and recorded in the debt: shadPS4 draws from mt19937 seeded once, where this PR calls random_device on every call; and shadPS4 accepts any other flag bit, where this PR throws.
  • Extra probe, calling the exports through SysV from a host program:
    • sceNetMemoryAllocate(1<<40, 0), (1<<62, 0) and (INT64_MAX, 0) each return null without throwing.
    • sceNetMemoryFree on a pointer that is not from the guest heap throws guest allocation is not registered. That is reasonable, but it is not in the debt line, which mentions only null.

AI-assisted: yes (Claude Code); results above were run on this machine.

@oneandonlydean oneandonlydean self-assigned this Oct 20, 2026
@oneandonlydean
oneandonlydean merged commit df56570 into boykopovar:main Oct 20, 2026
12 of 13 checks passed
HQasper pushed a commit to HQasper/AnyPS5 that referenced this pull request Oct 20, 2026
The only conflict was the sceKernelAddReadEvent entry in
docs/dev/debt/libkernel.md; it takes the v0.1.3 text, which already holds
the pipe read event and libSceNet work merged upstream as boykopovar#8057 and boykopovar#8054.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

4 participants