feat(libSceNet): accept sceNetClearDnsCache with no library DNS cache to drop #8013

Merged
MarrasFederico merged 1 commit from upstream-pr/8013 into main 2026-10-20 04:46:57 +00:00
MarrasFederico commented 2026-10-19 17:42:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarrasFederico on 2026-10-19T17:42:25Z.


What

sceNetClearDnsCache threw not implemented, and its debt entry listed the signature as unknown. SharpProspero Socket.cs documents it as int sceNetClearDnsCache(int flags), which drops the resolver's DNS cache.

Every sceNetResolverStart* lookup in AnyPS5 goes to the host resolver, so the library keeps no cache of its own, and a later lookup already sees what the host resolver returns. sceNetClearDnsCache(0) therefore returns 0 without doing anything, and leaves the host's own cache alone. Nonzero flags throw, as in sceNetResolverStartNtoa6, because their meaning is unknown. The debt entry now records this.

Tested

Ubuntu 26.04.1, kernel 7.0.0-38, GCC 15.2.0, Release, full build with BUILD_TESTING=ON. Windows was not compiled. No title was run.

  • guest_sce_net, run in a network namespace with IPv6 on lo (unshare -rn), because on this host IPv6 is disabled on lo and the test aborts before its resolver checks (#7987):
    • sceNetClearDnsCache(0) returns 0.
    • A lookup of localhost on the same resolver still returns 127.0.0.1, and sceNetResolverGetError reports 0.
    • Flags 1 and -1 throw.
  • The test fails on main, where the call throws.
  • This branch merges cleanly with #7991, which changes nearby lines of the same test and debt file.
  • tools/check_conventions.py --base origin/main passes. tools/pr_overlap.py finds no conflicting lines. It could not compare #5836, #6044, #7201 and #7332, which conflict with main; none of them changes sceNetClearDnsCache.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4924974533 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8013). Originally posted by [MarrasFederico](https://github.com/MarrasFederico) on 2026-10-19T17:42:25Z. --- ### What `sceNetClearDnsCache` threw `not implemented`, and its debt entry listed the signature as unknown. [SharpProspero `Socket.cs`](https://github.com/SvenGDK/SharpProspero/blob/5dfdb4b0b166e83dc9ae275001afb695f12c7174/src/SharpProspero/Interop/Net/Socket.cs#L928-L930) documents it as `int sceNetClearDnsCache(int flags)`, which drops the resolver's DNS cache. Every `sceNetResolverStart*` lookup in AnyPS5 goes to the host resolver, so the library keeps no cache of its own, and a later lookup already sees what the host resolver returns. `sceNetClearDnsCache(0)` therefore returns 0 without doing anything, and leaves the host's own cache alone. Nonzero flags throw, as in `sceNetResolverStartNtoa6`, because their meaning is unknown. The debt entry now records this. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Ubuntu 26.04.1, kernel 7.0.0-38, GCC 15.2.0, Release, full build with `BUILD_TESTING=ON`. Windows was not compiled. No title was run. - `guest_sce_net`, run in a network namespace with IPv6 on `lo` (`unshare -rn`), because on this host IPv6 is disabled on `lo` and the test aborts before its resolver checks (#7987): - `sceNetClearDnsCache(0)` returns 0. - A lookup of `localhost` on the same resolver still returns 127.0.0.1, and `sceNetResolverGetError` reports 0. - Flags 1 and -1 throw. - The test fails on `main`, where the call throws. - This branch merges cleanly with #7991, which changes nearby lines of the same test and debt file. - `tools/check_conventions.py --base origin/main` passes. `tools/pr_overlap.py` finds no conflicting lines. It could not compare #5836, #6044, #7201 and #7332, which conflict with `main`; none of them changes `sceNetClearDnsCache`. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
github-actions[bot] commented 2026-10-19 17:43:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T17:43:08Z.


Progress report (e90a1d1 → 1537dff)

📈 System libraries: 79.9% (+0.02%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceNet sceNetClearDnsCache
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6273462508 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8013#issuecomment-6273462508). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T17:43:08Z. --- <!-- progress-report --> ### Progress report (e90a1d1 → 1537dff) 📈 **System libraries**: 79.9% (+0.02%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceNet | `sceNetClearDnsCache` | </details>
github-actions[bot] commented 2026-10-19 17:57:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T17:57:10Z.


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 6044 core/libs/tests/GuestSceNet.cpp
PR 7201 core/libs/prx/libSceNet/Export.cpp
PR 7332 core/libs/prx/libSceNet/Export.cpp
core/libs/tests/GuestSceNet.cpp
PR 7959 core/libs/prx/libSceNet/Export.cpp
core/libs/tests/GuestSceNet.cpp
docs/dev/debt/libSceNet.md
PR 8106 core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6273722568 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8013#issuecomment-6273722568). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T17:57:10Z. --- <!-- pr-overlap --> 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](https://www.github.com/boykopovar/AnyPS5/pull/5836) | `core/libs/prx/libSceNet/Export.cpp`<br>`core/libs/tests/GuestSceNet.cpp`<br>`docs/dev/debt/libSceNet.md` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/GuestSceNet.cpp` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceNet/Export.cpp` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/libs/prx/libSceNet/Export.cpp`<br>`core/libs/tests/GuestSceNet.cpp` | | [PR 7959](https://www.github.com/boykopovar/AnyPS5/pull/7959) | `core/libs/prx/libSceNet/Export.cpp`<br>`core/libs/tests/GuestSceNet.cpp`<br>`docs/dev/debt/libSceNet.md` | | [PR 8106](https://www.github.com/boykopovar/AnyPS5/pull/8106) | `core/libs/prx/libSceNet/Export.cpp`<br>`docs/dev/debt/libSceNet.md` |
wachi35676 commented 2026-10-19 22:30:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by wachi35676 on 2026-10-19T22:30:14Z.


Windows run (the description says Windows was not compiled): Windows 11 Home 26300, Ryzen 5 9600X, WinLibs GCC 15.2.0, Release, BUILD_TESTING=ON. This PR merged onto main 9127ea36d.

  • It builds.
  • guest_sce_net passes 18/20 over two batches. The two failures are the load flake this test also shows on main; plain main passed 6/6 in the same session.
  • Negative control (libSceNet/Export.cpp from main, new test kept): 0/18 pass.
  • The (int flags) signature matches SharpProspero Socket.cs L928-L930.
  • It merges cleanly with #8056, which edits the same test and debt file.

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

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6278794314 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8013#issuecomment-6278794314). Originally posted by [wachi35676](https://github.com/wachi35676) on 2026-10-19T22:30:14Z. --- Windows run (the description says Windows was not compiled): Windows 11 Home 26300, Ryzen 5 9600X, WinLibs GCC 15.2.0, Release, BUILD_TESTING=ON. This PR merged onto `main` 9127ea36d. - It builds. - `guest_sce_net` passes 18/20 over two batches. The two failures are the load flake this test also shows on `main`; plain `main` passed 6/6 in the same session. - Negative control (`libSceNet/Export.cpp` from `main`, new test kept): 0/18 pass. - The `(int flags)` signature matches SharpProspero [Socket.cs L928-L930](https://github.com/SvenGDK/SharpProspero/blob/5dfdb4b0b166e83dc9ae275001afb695f12c7174/src/SharpProspero/Interop/Net/Socket.cs#L928-L930). - It merges cleanly with #8056, which edits the same test and debt file. AI-assisted: yes (Claude Code); results above were run on this machine.
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!8013
No description provided.