feat(net): implement memory-pool netstat diagnostic #4785

Merged
krishalivaibhav merged 1 commit from upstream-pr/4785 into main 2026-10-14 05:09:02 +00:00
krishalivaibhav commented 2026-10-12 21:49:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by krishalivaibhav on 2026-10-12T21:49:45Z.


What

Don't Starve Together (PPSA02070, 02.009.002) imports sceNetShowNetstatWithMemory (H5WHYRfDkR0), which is absent and prevents its relinked executable from loading. Add the export with a pool-ID argument: reject unknown pools with the existing bad-descriptor error, then print the registered pool size and a snapshot of guest socket IDs, families, types and nonblocking/bound/listening flags. Copy the snapshot under the existing network mutex and perform output after releasing it.

The socket registry has no pool association, so this is a global socket snapshot; it does not report per-pool usage, endpoints or console-exact formatting. The signature is inferred from the guest call site (one integer argument, ignored return), not verified against a console.

Tested

  • Apple Clang, x86_64 Release: the changed clean-main Net export and GuestSceNet.cpp objects compile. Full guest_sce_net_tests cannot build on this Mac because unchanged libc/General.cpp references Linux-only CLOCK_REALTIME_COARSE and stat.st_mtim; no unrelated portability changes are included.
  • The same new regression was inserted into the older, locally adapted macOS runtime fixture, and its complete guest_sce_net test exited 0. It checks diagnostic output for empty/live/closed sockets, a nonblocking bound listener, unchanged socket address after diagnostics, and invalid/destroyed pool errors. This is local functional evidence, not a passing clean-main suite.
  • Independent contributor xXPBSXx reported a Windows full Release build and passing guest_sce_net with exact PR head 565fafa85 merged onto main 0c3dc9ca2 (Windows 10, MinGW/WinLibs, Ninja). They did not run a no-fix negative control. This is a contributor test report, not formal approval or a result independently reproduced by this author.
  • python3 tools/check_conventions.py --base origin/main and git diff --check pass. Hosted full Linux/Windows jobs were skipped; they are not counted as passing. Clean Linux execution remains unverified.

A minimal local implementation on an older macOS runtime allowed the game's missing import to bind and boot proceed to a separate unsupported vertex-subgroup failure. Later combined local candidates reached a logo/audio; gameplay was not verified, and that progress is not attributed to this export alone. This is not validation of the complete clean-main runtime.

Checklist

  • Based on main at 584cc4c5716b02210ca031593d1a6b0b4ce049cb
  • One topic per PR
  • Generic behavior, not specific to one title
  • No investigation files, game assets or save data included
  • Depends on: none
  • AI-assisted: yes (Codex)

Open networking PRs touch the same export/test files but implement different functions: #4758, #4673, #4669, #4614, #4613, #4612, #4611 and #4610. This change does not build on them.

#5349 changes stream-listen auto-binding and overlaps the shared test file. It is a separate behavior, not a dependency; resolve any textual overlap when either merges.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4835393915 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4785). Originally posted by [krishalivaibhav](https://github.com/krishalivaibhav) on 2026-10-12T21:49:45Z. --- ### What Don't Starve Together (PPSA02070, 02.009.002) imports `sceNetShowNetstatWithMemory` (`H5WHYRfDkR0`), which is absent and prevents its relinked executable from loading. Add the export with a pool-ID argument: reject unknown pools with the existing bad-descriptor error, then print the registered pool size and a snapshot of guest socket IDs, families, types and nonblocking/bound/listening flags. Copy the snapshot under the existing network mutex and perform output after releasing it. The socket registry has no pool association, so this is a global socket snapshot; it does not report per-pool usage, endpoints or console-exact formatting. The signature is inferred from the guest call site (one integer argument, ignored return), not verified against a console. ### Tested - Apple Clang, x86_64 Release: the changed clean-main Net export and `GuestSceNet.cpp` objects compile. Full `guest_sce_net_tests` cannot build on this Mac because unchanged `libc/General.cpp` references Linux-only `CLOCK_REALTIME_COARSE` and `stat.st_mtim`; no unrelated portability changes are included. - The same new regression was inserted into the older, locally adapted macOS runtime fixture, and its complete `guest_sce_net` test exited 0. It checks diagnostic output for empty/live/closed sockets, a nonblocking bound listener, unchanged socket address after diagnostics, and invalid/destroyed pool errors. This is local functional evidence, not a passing clean-main suite. - Independent contributor [xXPBSXx reported a Windows full Release build and passing `guest_sce_net`](https://github.com/boykopovar/AnyPS5/pull/4785#issuecomment-6136838223) with exact PR head `565fafa85` merged onto main `0c3dc9ca2` (Windows 10, MinGW/WinLibs, Ninja). They did not run a no-fix negative control. This is a contributor test report, not formal approval or a result independently reproduced by this author. - `python3 tools/check_conventions.py --base origin/main` and `git diff --check` pass. Hosted full Linux/Windows jobs were skipped; they are not counted as passing. Clean Linux execution remains unverified. A minimal local implementation on an older macOS runtime allowed the game's missing import to bind and boot proceed to a separate unsupported vertex-subgroup failure. Later combined local candidates reached a logo/audio; gameplay was not verified, and that progress is not attributed to this export alone. This is not validation of the complete clean-main runtime. ### Checklist - [x] Based on `main` at `584cc4c5716b02210ca031593d1a6b0b4ce049cb` - [x] One topic per PR - [x] Generic behavior, not specific to one title - [x] No investigation files, game assets or save data included - [x] Depends on: none - [x] AI-assisted: yes (Codex) Open networking PRs touch the same export/test files but implement different functions: #4758, #4673, #4669, #4614, #4613, #4612, #4611 and #4610. This change does not build on them. #5349 changes stream-listen auto-binding and overlaps the shared test file. It is a separate behavior, not a dependency; resolve any textual overlap when either merges.
github-actions[bot] commented 2026-10-12 21:50:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T21:50:06Z.


Progress report (8a67eb2 → 565fafa)

📈 System libraries: 87.87% (+0.01%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceNet sceNetShowNetstatWithMemory
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6133253077 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4785#issuecomment-6133253077). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T21:50:06Z. --- <!-- progress-report --> ### Progress report (8a67eb2 → 565fafa) 📈 **System libraries**: 87.87% (+0.01%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceNet | `sceNetShowNetstatWithMemory` | </details>
xXPBSXx commented 2026-10-13 02:24:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T02:24:50Z.


Windows test: head 565fafa85 merged onto current main 0c3dc9ca2 (clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release, -j2: full build 0 errors; ctest with the filter guest_sce_net: guest_sce_net passed (1 test(s), 0 failed); python tools/check_conventions.py --base upstream/main passed. I did not run the new tests against main without the change.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6136838223 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4785#issuecomment-6136838223). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-13T02:24:50Z. --- Windows test: head `565fafa85` merged onto current `main` `0c3dc9ca2` (clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release, `-j2`: full build 0 errors; ctest with the filter `guest_sce_net`: guest_sce_net passed (1 test(s), 0 failed); `python tools/check_conventions.py --base upstream/main` passed. I did not run the new tests against `main` without the change. AI-assisted (Claude Code).
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!4785
No description provided.