ReviewOS

home-lang/home

Fix native Bun.serve self-fetch trap and port SIMD baseline matrix

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

The current byte-identical js/bun/jsc-stress/fixtures/simd-baseline.test.ts passes its first 24 SIMD/runtime-dispatch tests in Home’s full native VM, then exits with SIGTRAP (133) in the HTTP parsing case. A minimal reproducer is enough: start Bun.serve({ port: 0, fetch() { return new Response("ok") } }), then fetch() that local URL. The listener starts and exposes a port, but the request traps before a response.

Track the underlying native Bun.serve/fetch failure, fix it at the server/request lifecycle layer, then enable the full byte-identical SIMD baseline corpus with no skips or emulation. Part of #66; discovered after #135.

10 days ago

Completed and pushed in ba300cdc2 (fix: align bun-usockets connect ABI).

Root cause: Home called the linked 10-argument us_socket_group_connect ABI with the obsolete 8-argument Zig declaration. local_host/local_port were omitted, shifting the trailing parameters; C then treated an arbitrary stack value as has_dns_resolved and trapped/null-wrote on connect. The call now supplies the unbound local-address pair, and a compile-time regression asserts all 10 parameters plus the nullable local-host and final output-pointer slots.

Verification:

  • direct 127.0.0.1 Bun.serve self-fetch: ok, exit 0
  • direct localhost Bun.serve self-fetch: ok, exit 0
  • byte-identical SIMD baseline normal command: 28 pass, 0 fail, including the 512-byte-header HTTP round trip
  • full home_test gate: pass

The SIMD file now automatically selects Home’s full native VM; no test skips or emulation were added.

Sign in to comment on this issue.