Skip to content

feat(net): expose stream and datagram protocol - #9930

Draft
Queuse wants to merge 4 commits into
boykopovar:mainfrom
Queuse:codex/net-protocol-readback
Draft

Queuse wants to merge 4 commits into
boykopovar:mainfrom
Queuse:codex/net-protocol-readback

Conversation

@Queuse

@Queuse Queuse commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What

Read SO_PROTOCOL for IPv4/IPv6 stream and datagram sockets, including default protocol selection and accepted-socket inheritance, following FreeBSD 11.4 sogetopt. Raw protocol mapping remains unimplemented and throws; console measurements remain in library debt.

Tested

Windows 11 x86-64, WinLibs MinGW-w64 GCC 15.2.0-r7, Ninja, Release. Head 2103fdf846 includes main 2fade7ef4e.

  • Rebuilt affected libraries and focused targets; guest_net_protocol: 1/1 pass, with no skips.
  • Conventions and whitespace checks pass.
  • No fresh Linux/macOS, full hosted product build, title or console run.

Integration order remains #9523 → #9542 → #9515 → #9578 and #9525 → #9543 → #9930 → #8686; #9931 follows #9542. #9930/#9931 may land independently after their prerequisites, before the agreed #9932/#9948 updates. Preserve every option path, short-buffer rule, test and debt entry.

#6044 was closed without merging its test relocation, so that former coordination item is retired. The existing #5836 order proposal remains unconfirmed; its peer-transport and broadcast-alias changes must retain current buffer validation and option state when integrated. No author agreement is assumed.

Earlier combined Windows/WSL2 network results remain tied to tree c9c1293; they are separate from this head's fresh Windows run.

Fresh overlap snapshot 30be9b428b: existing getter/debt intersections remain covered by the ordering above. 7 shared-file comparisons are incomplete because those branches conflict with the base: #5836, #7201, #9727, #9733, #9948, #10502, #10706. Manual inspection identifies export-header refactoring (#10706), diagnostic display (#10502), argument validation (#9727), send/platform paths (#9733/#7201), socket records (#9948), and the already pending peer/broadcast changes (#5836). No duplicate option branch was found in the inspected shared hunks. Retain the private socket fields, canonical declarations, test registrations and debt entries when integrating. These source checks do not establish author agreement or a combined runtime pass.

Checklist

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Progress report (30be9b4 → 2103fdf)

📉 System libraries: 48.77% (-0.01%, -1 reverted functions)

⚠️ 1 went back to stubs
Library Name
libSceNet sceNetGetsockopt

Changed libraries (implemented exports)

Library Before After Change
libSceNet 75/224 (33.48%) 74/224 (33.04%) -0.45 pp

@MarcZX10

Copy link
Copy Markdown
Contributor

I checked #9931’s open TCP_NODELAY readback change alongside this PR. The behavior is distinct, but both patch sceNetGetsockopt in Export.cpp and add tests/debt entries to the same libSceNet build/docs. The edits appear composable: this PR adds the SO_PROTOCOL branch and protocol state, while #9931 changes only the TCP_NODELAY output-length path. Please coordinate the landing order or state explicitly that either can land first and ensure a rebase retains both branches, CTest registrations and debt entries. This branch is based on 8aa44cf3; current main is f57ceaad after four intervening commits, so refresh before final validation.

@MarcZX10 MarcZX10 mentioned this pull request Oct 22, 2026
12 tasks done
@github-actions

github-actions Bot commented Oct 22, 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/CMakeLists.txt
core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
PR 7201 core/libs/prx/libSceNet/Export.cpp
PR 7490 core/libs/prx/libSceNet/Export.cpp
PR 9231 core/libs/prx/libSceNet/Export.cpp
PR 9357 docs/dev/debt/libSceNet.md
PR 9493 core/libs/prx/libSceNet/Export.cpp
PR 9494 core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
PR 9506 core/libs/prx/libSceNet/CMakeLists.txt
core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
PR 9515 core/libs/prx/libSceNet/Export.cpp
PR 9578 core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
PR 9651 docs/dev/debt/libSceNet.md
PR 9715 core/libs/prx/libSceNet/Export.cpp
PR 9727 core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
PR 9733 core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
PR 9932 core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
PR 9948 core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
PR 10097 docs/dev/debt/libSceNet.md
PR 10187 core/libs/prx/libSceNet/Export.cpp
PR 10502 core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
PR 10572 core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
PR 10628 core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
PR 10629 core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
PR 10706 core/libs/prx/libSceNet/Export.cpp

@MarcZX10

Copy link
Copy Markdown
Contributor

One additional overlap surfaced: #9932 adds FIONREAD receive-queue reporting and also edits libSceNet/Export.cpp and docs/dev/debt/libSceNet.md (plus the shared GuestSceNet.cpp test). The behaviors appear independent of this PR’s SO_PROTOCOL path, but please coordinate the order with #9932 and ensure a rebase retains both changes and all test/debt entries. I also noted this in #9932. Your existing #9931 order note remains applicable.

@Queuse

Queuse commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

@MarcZX10 I checked the two heads together (c079a98a41 and fea0994737): the three-way merge is clean, so #9930 and #9931 can land in either order. I've recorded that in both descriptions. The rebase needs to keep both getter branches, test registrations and debt entries. Their existing prerequisites stay in place: #9543 for #9930 and #9542 for #9931.

Both also merge cleanly with main bd1d3994ce. The runtime results are still tied to the heads and base named in Tested; I haven't run the combined code. I'll refresh and rerun the focused test before final validation.

@MarcZX10

Copy link
Copy Markdown
Contributor

I completed a diff/code pass on the SO_PROTOCOL implementation and its tests. Effective protocol selection and accepted-socket inheritance are recorded, bounded output handles 0/short/full capacities, and the raw-socket behavior stays explicit in debt. I found no code defect in the diff. git diff --check upstream/main...refs/review/9930 and the current-main conventions check both pass.

The branch is 2 commits ahead/48 behind current main caa089fd735d0a5d615279e0f567cb638ad65690 (merge base 1fd6f9bb588f66dfc5f1ed3bda9cb9dda434a27b). No intervening main commit touches its changed paths, but please sync before merge and rerun guest_net_protocol on the final head. Please also finish the three-way order coordination with #9931 and #9932 noted above; current tests are standalone, not a combined-tree run. The author-reported Windows focused test is not a hosted product result.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed exact head c079a98a411093257bbd88f3fd8f28a836d438ec. Effective/default protocol selection and accepted-socket inheritance are covered, output-size/error behavior is tested, and unsupported raw sockets remain explicit in debt. Current-main diff-check and conventions pass; the branch merges cleanly and no intervening main commit touched the changed paths. The author’s combined Windows + WSL2 integration run reports all 8 focused network tests passing with #9931/#9932 and related prerequisite changes. I did not rerun the C++ tests locally. The documented merge prerequisite #9543 (including #9525), and #8686’s agreed later order, remain; preserve both this and #9931’s getter/test/debt changes through final rebase.

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with main, rebase needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants