ReviewOS

home-lang/home

Complete bidirectional IPC socket and datagram handle transfer

#860
Open chris opened this 8 days ago ·
8 days ago

Native descriptor adoption-state checkpoint (2026-10-09): source and verified evidence are on origin/main. UDP descriptors preserve their existing kernel peer through Bun and node:dgram adoption; disconnect/close invalidate cached endpoints and port values. TCP consumes its already validated descriptor rather than rereading a getter; descriptor zero remains supported. Failed UDP poll registration removes partial registrations before freeing poll data while leaving the caller's fd open. All 13 native controls pass, including connected UDP via inherited fd, dgram fd and IPC, reconnect/close-cache transitions and changing fd getters, alongside prior transfer/ownership controls. Both 11-suite original runs validate 316 passes, zero failures and four original skips; all 36 pinned test/fixture files match. Final 31/31 Debug; 45 ABI tests / 767 assertions; 5,656 MB supervised tree footprint under 8,192 MB. All 207 committed compressed artifacts verify and all 11 final reports restore/validate. Existing dgram Pickier diagnostics remain four errors and one warning before/after this change; they are not passing lint. #860 remains open for asynchronous receive-adoption failure ownership, malformed/closed descriptors, cluster tracking, Windows and stress/platform coverage. Full native/registry, whole-suite and Release/ASAN parity remain unfinished.

Basic POSIX IPC handle transfer is implemented on origin/main in 31f4be120, under #66.

  • Serialize real net.Server/net.Socket/dgram.Socket handles instead of dropping them; duplicate send descriptors and retain ownership through ACK, NACK retransmission and failure cleanup.
  • Receive TCP sockets through native fd attachment and UDP sockets through the native poll lifecycle, alongside listener receipt.
  • Attach SCM_RIGHTS only to the first positive write; reset the entire envelope when retransmitting; honor TCP keepOpen after ACK.
  • Verify Node/Home and Home/Home TCP/UDP exchanges, 2 MiB envelopes, both TCP ownership modes, source UDP closure, NACK exhaustion, queued callbacks and disconnect cleanup. Invalid ordinary-file descriptors remain owned by the caller.

Both original 11-suite runs pass 316 registered cases, zero failures and four original skips. All 36 audited test/fixture files match the pinned Bun source. Final Debug build: 31/31 steps, 5,658 MB peak tree footprint under 8,192 MB. ABI/generator checks: 45 tests and 767 assertions. The final executable repeats all eight native protocol controls successfully. All 369 committed compressed artifacts verify and all 11 final corpus reports restore and validate.

Retained source, captures and case-level evidence. Final executable SHA256: 12fd48982928efc674b29f6f1ebd756fe8f6e78be62dd6024b04d70e33e2cc2c. The repository-wide Pickier scan stops at its 165,616-file safety limit; targeted source checks pass.

Remaining work:

  • Windows handle transport and platform-specific descriptor types.
  • Cluster connection-key tracking, active connection counts and HTTP/parser resource lifetime when detaching transferred sockets.
  • Malformed/non-socket/closed handles, asynchronous adoption failure cleanup, remaining descriptor/adoption variants.
  • Repeated transfer/disconnect and GC/stress ownership coverage, Release/ASAN and other-platform verification.

Original skips receive no passing credit. This issue remains open; the current controls do not establish complete IPC or whole-suite parity.

8 days ago

Native transport error checkpoint is on origin/main. IPC distinguishes real fatal write errno from uSockets zero/backpressure results and retains that error for queued callbacks. The unchanged concurrent cluster disconnect case now passes, alongside all 13 existing TCP/UDP/ACK/NACK/adoption controls. The complete 499-entry filesystem/process/cluster selection validates zero failures; skips/TODOs remain excluded. Retained failures, debugger controls, final captures and verified archives. Windows handle transport, remaining cluster/ownership stress and the other unverified boundaries in this issue remain open; this checkpoint does not establish full IPC parity. The separate host ABI gate failure is tracked in #865.

Sign in to comment on this issue.