ReviewOS

home-lang/home

Bun parity: complete experimental stream/iter native integration

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

Tracks native integration for Bun experimental stream iterator parity from #66.

Completed locally:

  • Port node:stream/iter and node:zlib/iter plus all 12 internal iterator modules (8330bb6).
  • Add canonical and bare resolver aliases and enforce the write-once --experimental-stream-iter gate across alias resolution, direct fetch, builtin introspection, inline eval, implicit file run, and explicit home run (8330bb6).
  • Replace the always-false stream-iterator feature stub with the real atomic C ABI (8330bb6).
  • Port the Readable Stream.toAsyncStreamable bridge, C++ getter/header, Rust resolver/CLI/runtime mirrors, FileHandle pull/pullSync/writer/close/ref lifecycle, and synchronized 328-entry ErrorCode table (b2d27bc).
  • Remove harness-only stream/iter and zlib/iter modules and route exactly 45 fixtures through isolated native Home processes with real Flags ordering, inherited spawn environments, deterministic test IDs, and owned failure diagnostics (0b6cb6b).
  • Add a cross-platform emitted-path launcher plus bounded POSIX process-group and Windows child timeout cleanup (0b6cb6b).

Remaining acceptance work:

  • Rebuild when the shared volume has safe headroom and run all 45 unchanged upstream fixtures through the native route.
  • Fix any behavior exposed by that run; do not count a fixture green until it exits cleanly without bootstrap emulation.
  • Push the queued local commits once github.com DNS works from the git transport.

Current verification is format, AST, static exact-selection, shim-absence, tiny launcher semantic compile, and clean P0/P1 review. A full 45-fixture pass is intentionally not claimed yet. Keep open until the native run is 45 of 45 and the commits are published.

10 days ago

Completed the next integration tranche locally in b2d27bca3 (push attempted; availability depends on this host resolving github.com). This ports the Readable Stream.toAsyncStreamable bridge, C++ feature getter, full 328-entry synchronized ErrorCode table (OPERATION_FAILED=159, STREAM_ITER_MISSING_FLAG=233, final DIR_CONCURRENT_OPERATION=327), Rust source mirrors, and Bun-exact FileHandle pull, pullSync, writer, synchronous close, and deferred-fd-close behavior. Added a four-discriminant ABI regression test. Validation: exact Bun block/table comparisons, JS bundles, Rust parsing, Zig AST/diff checks, clean P0/P1 review, cold home_rt compilation, and a final integrated native debug build. All isolated outputs were deleted after use.

10 days ago

Native stream-iterator corpus routing landed locally in 0b6cb6b (test(runtime): run stream iterator corpus natively). This removes the harness-only stream/iter and zlib/iter shims and routes exactly 45 fixtures through the emitted Home executable: all 42 test-stream-iter fixtures plus the three FileHandle pull, pullSync, and writer fixtures. Real Flags directives are parsed in order and placed before the fixture path, child environments are inherited with deterministic test IDs, disabled parent fixtures can spawn real grandchildren, and file-level exit and timeout diagnostics are preserved. A cross-platform host launcher passes emitted artifact paths without hard-coded prefixes; POSIX timeout cleanup uses opt-in process groups with bounded TERM/KILL drains, while Windows follows a bounded direct-child termination path. Verification: zig fmt check, zig ast-check, git diff check, exact 45-fixture selection, shim-absence checks, tiny launcher semantic compile, and clean P0/P1 re-review. The full native 45-fixture run is not claimed yet: the shared volume is critically full, so I deliberately avoided another large cold Zig cache. Push is queued because this host currently cannot resolve github.com.

10 days ago

Final acceptance is complete on the published codex/runtime-port branch.

The implementation is the existing three-commit series:

  • 8330bb606e82087282e6184efcb4e6ab9e1a0dfe — port the experimental stream iterator modules and feature gate
  • b2d27bca3ee6a8b00110a51251b04fad7f11fab9 — complete the native Stream/FileHandle bridge and synchronized error ABI
  • 0b6cb6bee7a374fbf32f390c8618f7fc069d4576 — route the exact upstream matrix through emitted Home processes

All three commits are ancestors of remote codex/runtime-port at 26b5a8b9165d8c65488c512d90d6d8cd58de8872; each has Chris Breuer as sole author and committer.

I ran the exact selector against the current emitted native Home binary, preserving every fixture's original // Flags: ordering, inherited environment, deterministic test ID, and 120-second child deadline:

  • selected: 45
  • passed: 45/45
  • failed/timeouts: 0
  • upstream source integrity: 45/45 byte-identical to Bun pin 4982b91e3702094330f3be3883354c52b8c01323
  • skip markers: 0
  • emitted Home SHA-256: b95171afa3da4163a37ad69b313e264aa65ddd2a281edcac6f1d40d944f2b8b9

The run includes all 42 test-stream-iter-*.js fixtures plus FileHandle pull, pullSync, and writer. Disabled-feature fixtures spawned real Home children, and test-stream-iter-broadcast-from.js retained its original ten-second workload. No fixture, flag, test deadline, bootstrap emulation, or workload was changed.

This fulfills the remaining native integration gate. The overall #66 port remains incomplete.

Sign in to comment on this issue.