ReviewOS

home-lang/home

Port Bun UDP socket and node:dgram matrices

#147
Closed chris opened this 10 days ago ·
10 days ago

Scope

Port the byte-identical upstream Bun datagram matrices into the Home corpus runtime:

  • js/bun/udp/dgram.test.ts
  • js/bun/udp/udp_socket.test.ts
  • js/bun/udp/udp_socket_recv_flags.test.ts

Required behavior

  • implement a shared UDP endpoint registry and datagram delivery model
  • support Bun.udpSocket() bind/connect/send/sendMany/close/ref/unref and cached address metadata
  • preserve binary types and fifth-argument receive flags
  • surface structured errors without leaking wrappers
  • implement Node dgram bind/connect/disconnect/address/remoteAddress/send/close/event semantics
  • retain exact upstream subprocess and platform-gated coverage; do not replace tests with smaller fixtures

Acceptance

  • remove all three rewriteNativeTodoCorpus branches
  • keep the three corpus files byte-identical to ~/Code/bun
  • exact Home execution has zero failures and zero unsupported tests
  • full ./pantry/.bin/zig build test -Dfilter=home_test --summary failures passes
  • commit and push directly to main as Chris Breuer with no coauthor trailers
  • update #66 with linked evidence
10 days ago

Completed and pushed directly to main in a8cf67e (fix(runtime): port Bun UDP socket matrices).

Implemented the shared Bun/node UDP model, including Bun.udpSocket, node:dgram bind/connect/disconnect/send/address/close lifecycles, sendMany, binary payload modes, UTF-8 and boxed-string payloads, receive flags, cached socket metadata, collision/invalid-host errors, ref/unref/disposal, the upstream UDP testdata module, and the missing harness matcher/GC-scope/heap-stat shapes. The three copied corpus files remain byte-identical to ~/Code/bun.

Exact verification on the final source:

  • js/bun/udp/dgram.test.ts: 29 pass, 0 fail, 0 unsupported, 0 todo
  • js/bun/udp/udp_socket.test.ts: 178 pass, 0 fail, 0 unsupported, 0 todo
  • js/bun/udp/udp_socket_recv_flags.test.ts: 1 pass, 0 fail, 0 unsupported, 1 upstream Linux-only TODO on macOS
  • existing js/node/dgram/node-dgram.test.js: 2 pass, 0 fail, 0 unsupported, 0 todo
  • ./pantry/.bin/zig build test -Dfilter=home_test --summary failures: exit 0

A durable Home regression test now reruns and count-checks all three exact Bun UDP matrices.

Sign in to comment on this issue.