Skip to content

feat(libSceNet): implement Show*WithMemory diagnostics and sceNetGetStatisticsInfo - #12288

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
MarcZX10:feat/libscenet-pending-exports
Oct 28, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
MarcZX10:feat/libscenet-pending-exports

Conversation

@MarcZX10

Copy link
Copy Markdown
Contributor

What

Implements four libSceNet exports that threw NotImplemented_nid_no_patch:

  • sceNetShowIfconfigWithMemory, sceNetShowPolicyWithMemory, sceNetShowRoute6WithMemory: validate the memory pool id (NET_EBADF with errno for an unknown or destroyed pool) and return success without printing, exactly as the existing sceNetShowRouteWithMemory does. Reference for the behaviour: shadPS4 src/core/libraries/net/net.cpp.
  • sceNetGetStatisticsInfo: the 24-byte statistics block (NetStatisticsInfo, six int32) is filled with "plenty free, nothing queued"; a null pointer fails with NET_EFAULT and errno. Layout and values follow shadPS4 net.cpp / net_types.h; not measured on a console.

Everything else in the library that still throws was left untouched on purpose. I could not find a credible public source for its prototype and behaviour (shadPS4 only has LOG_ERROR(STUBBED) bodies with no signatures for the Sync, Dump, EventCallback, Dhcp, Wlan, route/ARP/interface-table and sceNetCtl*IpcInt groups), and sceNetGetsockoptEx, sceNetSetsockoptEx, sceNetSocketInternal, sceNetSysctl, sceNetInetNtopWithScopeId, sceNetInetPtonWithScopeId and sceNetConfigGetDefaultRoute are already implemented by open PR #9578. The new silent stubs are listed in docs/dev/debt/libSceNet.md.

Tested

  • guest_sce_net (ctest) passes with the new cases in core/libs/tests/GuestSceNet.cpp (invalid pool, live pool, destroyed pool for the three diagnostics; null pointer, field invariants and ignored flags for the statistics call).
  • python3 tools/check_conventions.py --base upstream/main, test_public_headers.py --audit-only and git diff --check pass.

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

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Progress report (750cf6c → c1e321f)

📈 System libraries: 46.68% (+0.03%, +4 implemented functions)

✅ 4 implemented
Library Name
libSceNet sceNetGetStatisticsInfo
libSceNet sceNetShowIfconfigWithMemory
libSceNet sceNetShowPolicyWithMemory
libSceNet sceNetShowRoute6WithMemory

Changed libraries (implemented exports)

Library Before After Change
libSceNet 79/224 (35.27%) 83/224 (37.05%) +1.79 pp

@github-actions

github-actions Bot commented Oct 28, 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 5836 core/libs/prx/libSceNet/Export.cpp
core/libs/tests/GuestSceNet.cpp
docs/dev/debt/libSceNet.md
PR 9932 core/libs/prx/libSceNet/Export.cpp
core/libs/tests/GuestSceNet.cpp
docs/dev/debt/libSceNet.md
PR 11134 core/libs/prx/libSceNet/Export.cpp
PR 11872 core/libs/prx/libSceNet/Export.cpp
PR 11969 core/libs/prx/libSceNet/Export.cpp

@maskym

maskym commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Windows result for head a30f43f9da, merged into main 87b810a1db (the PR's Tested section names no Windows run).

Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, BUILD_TESTING=ON, Ninja. Build clean.

The tree also carried the open PRs #12290, #12285, #12269, #12265, #12232, #12206, #12201, #12199, #12197, #12165, #12146, all merged cleanly, so the run is a joint one; the tests of this PR are guest_sce_net (1.68 s), guest_sce_net_keepalive (0.04 s), all passed (every test registered from the tree's changed test files: 38/38). Not run on a PS5.

AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 28, 2026
@B-Howell

Copy link
Copy Markdown
Contributor

Windows and Linux results with controls (the description names no platform).

Head a30f43f9da94c844cb74a49b1fdba091467e10d9 (129 behind main) merged onto main 5b8ba7b9291bd4a01e012684ef602809e2ed15ba (clean) on both hosts, alone in the tree.

Windows: Windows 11 Pro 26300, AMD Ryzen 7 7800X3D, WinLibs GCC 15.2.0 r7, Ninja Release, BUILD_TESTING=ON, libs rebuilt.

  • ctest -R '^guest_sce_net$' --repeat until-fail:10: passes all 10 runs (17.8 s total).
  • Control: libSceNet/Export.cpp restored from main, test kept: aborts with an unhandled std::runtime_error (0xc0000409).

Linux: Ubuntu 22.04 under WSL2, GCC 11.4.0, Ninja Release.

  • The same command passes all 10 runs (15.2 s total).
  • The same control aborts with what(): sceNetGetStatisticsInfo not implemented.

tools/check_test_registration.py: no executables built and not run, none new, on either host.

Not tested: the diagnostics' printed output against a console, macOS, any title.

AI-assisted (Claude Code).

@oneandonlydean oneandonlydean self-assigned this Oct 28, 2026
@Queuse Queuse mentioned this pull request Oct 28, 2026
12 tasks done
sceNetShowIfconfigWithMemory, sceNetShowPolicyWithMemory and
sceNetShowRoute6WithMemory threw NotImplemented_nid_no_patch. They now
behave like the existing sceNetShowRouteWithMemory: an unknown memory
pool id fails with NET_EBADF (errno set), a live pool returns success
without printing. The behaviour follows shadPS4's net.cpp, which does
the same for these three. The new silent stubs are listed in the
libSceNet technical debt file, and the tests cover the invalid id, live
pool and destroyed pool cases.
sceNetGetStatisticsInfo threw NotImplemented_nid_no_patch. It now fills
the six 32-bit fields of the statistics block (kernel memory free and
minimum free, packet count, QoS packet count, library memory free and
minimum free) and fails with NET_EFAULT, setting errno, for a null
pointer. The layout and the "plenty free, nothing queued" answer follow
shadPS4's net.cpp and net_types.h; the host has no counter for the
console's network memory, so the values are not measured. The debt file
records this, and the test checks the null pointer, the field
invariants and that the flags argument is ignored.
@MarcZX10
MarcZX10 force-pushed the feat/libscenet-pending-exports branch from a30f43f to c1e321f Compare October 28, 2026 13:08
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 28, 2026
@oneandonlydean
oneandonlydean merged commit 5c8c1b0 into boykopovar:main Oct 28, 2026
10 checks passed
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