feat(libSceNet): expose socket type and listen state #9525

Merged
Queuse merged 8 commits from upstream-pr/9525 into main 2026-10-26 11:01:28 +00:00
Queuse commented 2026-10-22 00:14:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Queuse on 2026-10-22T00:14:18Z.


What

Implement SO_TYPE and SO_ACCEPTCONN queries in sceNetGetsockopt using the guest socket type and listening state. Readback follows FreeBSD 11.4 sogetopt: listening returns bit 2, and short output buffers are truncated. Unverified console and pointer behavior remain in library debt.

Tested

Windows 11 x86-64, WinLibs MinGW-w64 GCC 15.2.0-r7, Ninja, Release. Head ea7109554c includes main b4d8e8bb3b.

  • Rebuilt affected libraries and focused targets; guest_net_socket_state, guest_net_protocol, guest_net_nodelay_readback and guest_net_buffer_validation: 4/4 pass, no skips.
  • Canonical public-declaration audit, conventions and whitespace checks pass.
  • The merge retains main's protocol getter, truncated TCP_NODELAY reads, test registrations and current debt entries. The shared integer-length guard remains after the short-output paths.
  • A source recheck and trial merge with consulted main 19fe176ddc are clean. Its later closed-stream polling, IPv6 text and unrelated libc/kernel changes are outside these option paths; the local runtime results above belong to the stated head/base.
  • No fresh Linux/macOS runtime, full hosted product build, title or console run.

Integration order remains #9523 → #9542 → #9515 → #9578 and #9525 → #9543. #9930 and #9931 are now merged, so their former prerequisites for #9932/#9948 are satisfied; #9948 still follows #9932. #6044 was closed without merging the test relocation. #10097 follows #9523 as its author confirmed. The #5836 peer/broadcast order remains a proposal. The #9525/#10949 intersection concerns CMake test registration, with no option-behavior dependency; the author of #10949 confirmed #9525-first and declared Depends on: #9525.

Canonical overlap snapshot 7e4f6e0440: confirmed intersections with #9543, #10949. 7 comparisons remain incomplete because those branches conflict with the base: #5836, #7201, #9727, #9733, #9932, #9948, #10502. Manual inspection covers peer/broadcast transport mapping, macOS paths, argument validation, socket records and diagnostic output. Preserve every option path, field, canonical declaration, fixture and debt entry during integration; these checks do not establish a combined runtime pass with the conflicting branches.

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:4960095894 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9525). Originally posted by [Queuse](https://github.com/Queuse) on 2026-10-22T00:14:18Z. --- ### What Implement `SO_TYPE` and `SO_ACCEPTCONN` queries in `sceNetGetsockopt` using the guest socket type and listening state. Readback follows FreeBSD 11.4 [sogetopt](https://github.com/freebsd/freebsd-src/blob/releng/11.4/sys/kern/uipc_socket.c#L2667-L2693): listening returns bit `2`, and short output buffers are truncated. Unverified console and pointer behavior remain in library debt. ### Tested Windows 11 x86-64, WinLibs MinGW-w64 GCC 15.2.0-r7, Ninja, Release. Head `ea7109554c` includes main `b4d8e8bb3b`. - Rebuilt affected libraries and focused targets; `guest_net_socket_state`, `guest_net_protocol`, `guest_net_nodelay_readback` and `guest_net_buffer_validation`: 4/4 pass, no skips. - Canonical public-declaration audit, conventions and whitespace checks pass. - The merge retains main's protocol getter, truncated TCP_NODELAY reads, test registrations and current debt entries. The shared integer-length guard remains after the short-output paths. - A source recheck and trial merge with consulted main `19fe176ddc` are clean. Its later closed-stream polling, IPv6 text and unrelated libc/kernel changes are outside these option paths; the local runtime results above belong to the stated head/base. - No fresh Linux/macOS runtime, full hosted product build, title or console run. Integration order remains #9523 → #9542 → #9515 → #9578 and #9525 → #9543. #9930 and #9931 are now merged, so their former prerequisites for #9932/#9948 are satisfied; #9948 still follows #9932. #6044 was closed without merging the test relocation. #10097 follows #9523 as its author confirmed. The #5836 peer/broadcast order remains a proposal. The #9525/#10949 intersection concerns CMake test registration, with no option-behavior dependency; the author of #10949 confirmed #9525-first and declared `Depends on: #9525`. Canonical overlap snapshot `7e4f6e0440`: confirmed intersections with #9543, #10949. 7 comparisons remain incomplete because those branches conflict with the base: #5836, #7201, #9727, #9733, #9932, #9948, #10502. Manual inspection covers peer/broadcast transport mapping, macOS paths, argument validation, socket records and diagnostic output. Preserve every option path, field, canonical declaration, fixture and debt entry during integration; these checks do not establish a combined runtime pass with the conflicting branches. <!-- 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. --> ### 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 -->
MarcZX10 commented 2026-10-22 00:28:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T00:28:12Z.

Review: APPROVED


The implementation matches the documented FreeBSD 11.4 behavior for SO_TYPE and SO_ACCEPTCONN: it reads the tracked guest socket type/listen state, returns the flag bit, and truncates to the caller's output length. The author-reported Windows test covers IPv4/IPv6, UDP/TCP, listener/accepted state, short buffers and invalid descriptors. Current eligibility, conventions, intake, labels, and report checks pass; hosted product/relinker jobs are skipped. I did not run a local test. I also checked that this PR and #9523 merge together cleanly.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5607854506 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9525#pullrequestreview-5607854506). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T00:28:12Z. **Review:** APPROVED --- The implementation matches the documented FreeBSD 11.4 behavior for `SO_TYPE` and `SO_ACCEPTCONN`: it reads the tracked guest socket type/listen state, returns the flag bit, and truncates to the caller's output length. The author-reported Windows test covers IPv4/IPv6, UDP/TCP, listener/accepted state, short buffers and invalid descriptors. Current eligibility, conventions, intake, labels, and report checks pass; hosted product/relinker jobs are skipped. I did not run a local test. I also checked that this PR and #9523 merge together cleanly.
MarcZX10 commented 2026-10-22 04:18:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T04:18:33Z.

Review: CHANGES_REQUESTED


The implementation review and author-reported Windows test remain as noted in my earlier review, but the current overlap report changes the merge-readiness assessment. It now lists shared , , and debt-file comparisons with #9523, #9542, #9543 and #9544, and shared paths with #9506; older conflicted-base comparisons remain unresolved as well. My earlier clean merge check with #9523 is not enough to clear the refreshed report. Please compare the exact hunks, coordinate landing order with affected authors where the rule applies, record any prerequisites in , and update the overlap report after resolving/rebasing. I’m requesting changes for the repository’s overlap/coordination requirement; I found no new behavior defect in this diff. Current policy checks pass; product jobs are skipped, and I did not rerun local tests.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5609205782 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9525#pullrequestreview-5609205782). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T04:18:33Z. **Review:** CHANGES_REQUESTED --- The implementation review and author-reported Windows test remain as noted in my earlier review, but the current overlap report changes the merge-readiness assessment. It now lists shared , , and debt-file comparisons with #9523, #9542, #9543 and #9544, and shared paths with #9506; older conflicted-base comparisons remain unresolved as well. My earlier clean merge check with #9523 is not enough to clear the refreshed report. Please compare the exact hunks, coordinate landing order with affected authors where the rule applies, record any prerequisites in , and update the overlap report after resolving/rebasing. I’m requesting changes for the repository’s overlap/coordination requirement; I found no new behavior defect in this diff. Current policy checks pass; product jobs are skipped, and I did not rerun local tests.
MarcZX10 commented 2026-10-22 04:18:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T04:18:41Z.

Review: DISMISSED


The implementation review and author-reported Windows test remain as noted in my earlier review, but the current overlap report changes the merge-readiness assessment. It now lists shared CMakeLists.txt, Export.cpp, and debt-file comparisons with #9523, #9542, #9543 and #9544, and shared paths with #9506; older conflicted-base comparisons remain unresolved as well. My earlier clean merge check with #9523 is not enough to clear the refreshed report. Please compare the exact hunks, coordinate landing order with affected authors where the rule applies, record any prerequisites in the Depends on checklist, and update the overlap report after resolving/rebasing. I’m requesting changes for the repository’s overlap/coordination requirement; I found no new behavior defect in this diff. Current policy checks pass; product jobs are skipped, and I did not rerun local tests.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5609206506 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9525#pullrequestreview-5609206506). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T04:18:41Z. **Review:** DISMISSED --- The implementation review and author-reported Windows test remain as noted in my earlier review, but the current overlap report changes the merge-readiness assessment. It now lists shared CMakeLists.txt, Export.cpp, and debt-file comparisons with #9523, #9542, #9543 and #9544, and shared paths with #9506; older conflicted-base comparisons remain unresolved as well. My earlier clean merge check with #9523 is not enough to clear the refreshed report. Please compare the exact hunks, coordinate landing order with affected authors where the rule applies, record any prerequisites in the Depends on checklist, and update the overlap report after resolving/rebasing. I’m requesting changes for the repository’s overlap/coordination requirement; I found no new behavior defect in this diff. Current policy checks pass; product jobs are skipped, and I did not rerun local tests.
MarcZX10 commented 2026-10-22 11:40:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T11:40:12Z.


Current-head recheck: sync is 1 ahead / 119 behind today’s main (base a6dcea927); individual merge, diff-check and conventions pass. Pairwise merges are clean with #9523, #9542, #9544 and #9506, and conflict in Export.cpp with #9543. #9543 already says it follows #9525, so that direction is appropriate; please retain the #9525 → #9543 order while reconciling the other live overlap notes and refresh this branch to current main. The Windows focused test remains author-reported; I did not rerun a local network build.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6339842547 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9525#issuecomment-6339842547). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T11:40:12Z. --- Current-head recheck: sync is 1 ahead / 119 behind today’s `main` (base `a6dcea927`); individual merge, diff-check and conventions pass. Pairwise merges are clean with #9523, #9542, #9544 and #9506, and conflict in `Export.cpp` with #9543. #9543 already says it follows #9525, so that direction is appropriate; please retain the `#9525 → #9543` order while reconciling the other live overlap notes and refresh this branch to current `main`. The Windows focused test remains author-reported; I did not rerun a local network build.
Queuse commented 2026-10-22 15:37:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Queuse on 2026-10-22T15:37:33Z.


@MarcZX10 refreshed this branch onto main b7d1d47a5 (head b957cf8b41). Conventions and whitespace checks pass, and the description separates earlier runtime results from the refreshed revision. The #9525 before #9543 order remains. I followed up with the authors of #6044 and #5836 and marked their ordering pending; I will not treat either proposal as agreed before they reply.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6344746269 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9525#issuecomment-6344746269). Originally posted by [Queuse](https://github.com/Queuse) on 2026-10-22T15:37:33Z. --- @MarcZX10 refreshed this branch onto main `b7d1d47a5` (head `b957cf8b41`). Conventions and whitespace checks pass, and the description separates earlier runtime results from the refreshed revision. The #9525 before #9543 order remains. I followed up with the authors of #6044 and #5836 and marked their ordering pending; I will not treat either proposal as agreed before they reply.
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!9525
No description provided.