Skip to content

feat(libSceNet): implement sceNetShowIfconfig and sceNetShowNetstat as silent stubs - #5004

Closed
YousefMohsen0 wants to merge 6 commits into
boykopovar:mainfrom
YousefMohsen0:feat/libsceNet-silent-stubs
Closed

YousefMohsen0 wants to merge 6 commits into
boykopovar:mainfrom
YousefMohsen0:feat/libsceNet-silent-stubs

Conversation

@YousefMohsen0

Copy link
Copy Markdown

What

Implement sceNetShowIfconfig and sceNetShowNetstat as silent stubs in libSceNet. These functions are imported by titles PPSA01530, PPSA13356, and PPSA11386 but have unknown signatures. They now return 0 instead of throwing NotImplemented_nid_no_patch, allowing the titles to load without crashing.

Tested

  • Linux: libSceNet builds successfully
  • All network-related tests pass: guest_sce_net_tests, guest_ppsa01530_exports_tests, guest_datagram_receive_tests
  • Convention checks 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 documented (functions return 0 with local variable pattern)
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (N/A)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA01530, PPSA13356, PPSA11386 (titles that import these functions)
  • AI-assisted: yes

Copilot AI balanced review requested due to automatic review settings October 13, 2026 07:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the prx label Oct 13, 2026

@adriadam10 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. A few things to address before this can merge:

  • core/libs/prx/libSceNet/Export.cpp:474,1412: these now return 0 silently with unknown signatures. Silent no-ops are only accepted for UI/debug-output behaviour; if that's the argument (these print interface/socket state), say so in the PR and cite a source (KytyPS5/shadPS4/FreeBSD) for the return value. Drop the pointless const int result and just return 0;.
  • No TechnicalDebt.md line was added for either stub (silent stubs section, away from the end of the section).
  • core/libs/tests/GuestPPSA01530Exports.cpp: the test only checks sceNetShowIfconfig() == 0 and sceNetShowNetstat has no test at all. Please test both, and keep the table-driven structure for the remaining exports instead of rewriting it; also keep the trailing newline at EOF.
  • The checklist says unimplemented paths throw and silent stubs are documented; neither is true for this diff. "Unblocks PPSA01530..." needs evidence (a log showing these imports are what stops the title).

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Progress report (5f426f9 → aab7050)

📈 System libraries: 88.36% (+0.06%, +2 implemented functions)

✅ 2 implemented
Library Name
libSceNet sceNetShowIfconfig
libSceNet sceNetShowNetstat
⚪ 2 behaviourally empty (constant return or throw)
Library Name
libSceNet sceNetShowIfconfig
libSceNet sceNetShowNetstat

@adriadam10 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. Remaining points:

  • Conventions is red: docs/dev/debt/libSceNet.md now carries the sce::Json::Value::setNullAccessCallBack and scePadUnknown_n3kSX62fgNo entries. Debt goes in the file named after the first core/ path it links, so those belong in docs/dev/debt/libSceJson2.md and docs/dev/debt/libScePad.md. Leave the libSceNet file with only the Net entries, and keep the trailing newline at EOF (the last line lost it).
  • The 0 return is still unsourced. shadPS4's sceNetShowIfconfig/sceNetShowNetstat are (STUBBED) return ORBIS_OK with no parameters or body, so they give neither a signature nor behaviour. FreeBSD ifconfig/netstat are userland programs, not a libc call, so they don't say what the PS5 export returns. If the argument is "debug output only, so a silent no-op is fine", state that in the PR and in the debt line, and cite what shows they only print.
  • The PR body/checklist still says unimplemented paths throw and that these stubs are "documented with a local variable pattern" (not what the diff does), and "Unblocks PPSA01530/PPSA13356/PPSA11386" has no evidence. Please attach a log showing these imports are what stops the title, or drop the claim.

Checked: build and ctest are green here and guest_ppsa01530_exports fails without the change, so the test is real.

@adriadam10 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked on this head merged onto main: build and the scoped ctest (29 tests, including guest_ppsa01530_exports) are green, Conventions passes. Still open from the previous review:

  • core/libs/prx/libSceNet/Export.cpp:474,1411: the 0 return is still unsourced. shadPS4's versions are (STUBBED) return ORBIS_OK with no parameters or body, and FreeBSD ifconfig/netstat are userland programs, not a libc call. If the argument is "they only print debug output, so a silent no-op is acceptable", say so in the PR and in the debt line, and cite what shows they only print. Otherwise they keep throwing.
  • docs/dev/debt/libSceNet.md:10: the sce::Json::Value::setNullAccessCallBack and scePadUnknown_n3kSX62fgNo entries are still in the libSceNet file; they belong in libSceJson2.md and libScePad.md. Keep only the Net entries here.
  • PR body: "unimplemented paths throw" and "documented with a local variable pattern" do not describe this diff, and "Unblocks PPSA01530/PPSA13356/PPSA11386" has no evidence. Attach a log showing these imports are what stops the title, or drop the claim.

Welcome to push again with these addressed.

@adriadam10 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for moving the debt entries; Conventions passes now. Still open from the previous review (no change to these in this head):

  • core/libs/prx/libSceNet/Export.cpp:474,1411: the 0 return is still unsourced. shadPS4's versions are (STUBBED) return ORBIS_OK with no parameters or body, and FreeBSD ifconfig/netstat are userland programs, not a libc call. The debt lines in docs/dev/debt/libSceNet.md:5-6 now say they "print to stdout on FreeBSD", which is not a source for the PS5 export either. If the argument is "debug output only, so a silent no-op is acceptable", cite what shows these exports only print (a disassembly, SDK docs, another emulator with a body); otherwise they keep throwing.
  • PR body: "Unimplemented paths throw" and "functions return 0 with local variable pattern" do not describe this diff (there is no local variable), and "Unblocks PPSA01530/PPSA13356/PPSA11386" has no evidence. Attach a log showing these imports are what stops the title, or drop the claim.

Welcome to push again with these addressed.

@adriadam10 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. Remaining points:

  • docs/dev/debt/libSceNet.md: this head deletes the existing Unknown function info entry for _sceUltWaitingQueueResourcePoolCreate, _sceUltSemaphoreCreate, _sceUltMutexOptParamInitialize, _sceUltMutexCreate, _sceUltQueueDataResourcePoolCreate and _sceUltQueueCreate (libSceUlt), which is on main. Please restore it, and remove only the sceNetShowIfconfig/sceNetShowNetstat mentions. Keep the other lines you touched (sceNetResolverAbort...) unchanged and with the trailing newline at EOF.
  • core/libs/prx/libSceNet/Export.cpp:474,1411: the 0 return is still unsourced. The shadPS4 link only shows (STUBBED) return ORBIS_OK with no parameters or body, so it does not show that these exports only print debug output. Cite what does (a disassembly, SDK docs, another emulator with a body), or they keep throwing.
  • PR body: "Unimplemented paths throw" and "functions return 0 with local variable pattern" do not describe this diff, and "Unblocks PPSA01530/PPSA13356/PPSA11386" has no evidence. Attach a log showing these imports are what stops the title, or drop the claim.

Welcome to push again with these addressed.

@github-actions github-actions Bot added the docs label Oct 13, 2026
@xXPBSXx

xXPBSXx commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Windows test of this PR.

Environment: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, BUILD_TESTING=ON, -j2, libusb-cmake from a local checkout. Built from main ad653c9bc with this PR and #5009 merged together; the merge had no conflict.

Result: guest_ppsa01530_exports (1 of 1) passes.

Not checked: whether the test fails without the change in the library code; the PR was not tested alone, only in the combined merge; no title run; Linux not tested.

AI-assisted (Claude Code).

…s silent stubs

These functions are imported by PPSA01530, PPSA13356, and PPSA11386 but have unknown
signatures. They now return 0 instead of throwing NotImplemented_nid_no_patch.
Updated test expectations accordingly.
…s silent stubs

These functions are imported by PPSA01530, PPSA13356, and PPSA11386 but have unknown
signatures. They now return 0 instead of throwing NotImplemented_nid_no_patch.

- sceNetShowIfconfig: returns 0; on FreeBSD ifconfig prints interface configuration
  to stdout and returns 0 on success. Imported by PPSA01530 and PPSA13356.
- sceNetShowNetstat: returns 0; on FreeBSD netstat prints network statistics
  to stdout and returns 0 on success. Imported by PPSA11386.

Added TechnicalDebt.md entries in the Silent stubs section citing FreeBSD behavior.
Updated test to check both functions return 0 and keep table-driven structure for
remaining NotImplemented exports.
…n function info

This avoids a false positive in the convention checker which expects the first
link in a debt file entry to point to the library the debt file is for.
- Move sce::Json::Value::setNullAccessCallBack entry to libSceJson2.md
- Move scePadUnknown_n3kSX62fgNo entry to libScePad.md
- Update libSceNet.md Silent stubs to clarify these are debug-output functions
  where silent no-op is acceptable (prints to stdout on FreeBSD)
- Remove non-Net entries from libSceNet.md Unknown function info section
Per reviewer request, cite shadPS4's STUBBED implementations that return ORBIS_OK
for these debug-output functions, rather than FreeBSD userland programs.
…config and sceNetShowNetstat

Per reviewer feedback, no source shows these are debug-output only functions.
Removed Silent stubs section from debt file and restored libSceUlt entries.
Updated test to expect NotImplemented_nid_no_patch for both functions.
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs needs rebase Conflicts with main, rebase needed prx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants