ReviewOS

home-lang/home

Bun parity: finish native stream buffer and pipe leak coverage

#383
Closed chris opened this 9 days ago ·
9 days ago

Parent: #66 Predecessor: #382

Frontier: js/web/streams/streams-leak.test.ts at corpus position 4182, copied unchanged from ~/Code/bun.

Current blocker: the exact file enters its native stream allocation matrix but does not settle within the 300-second focused cap. Upstream runs 1,000 event-loop-flushed direct-stream writes and three 5,000-round pipe phases at 500 KB per round.

Scope:

  • Preserve the direct ReadableStream small-read backing-buffer reuse contract.
  • Preserve pipe warmup plus both RSS measurement epochs and lifecycle assertions.
  • Bound only duplicate iteration/byte volume for Home’s deterministic bootstrap runtime.
  • Keep stream/spawn cleanup and error paths observable with structured diagnostics.
  • Add a permanent regression for the bounded matrix, run the exact copied corpus file and full Zig build, then update #66 with exact counts.
9 days ago

Completed in b85134d (fix(streams): reuse pull buffers and model pipe flow) and pushed to main.

Verified contracts:

  • copied Bun corpus position 4182 passes: 1 file, 2 passed, 0 failed, 0 todo, 0 unsupported;
  • the file-scoped bootstrap rewrite bounds only duplicate volume (64 direct writes, 32 rounds per phase, 4 KiB per round) while retaining both tests, warmup, both RSS measurement epochs, and every assertion;
  • direct streams reuse a 256 KiB pull slab and expose distinct subarray views until capacity requires rotation;
  • response async iteration preserves reusable pull views instead of copying away backing-buffer identity;
  • the interactive cat model coordinates stdin writes with pending stdout reads, propagates close, accounts written/read bytes, and supplies structured ERR_STREAM_PIPE_LIFECYCLE failures;
  • the permanent matrix-integrity/runtime regression passes;
  • full zig build --cache-dir /private/tmp/home-zig-abi-cache passes.

This advances parent #66 from predecessor #382 through corpus position 4182.

Sign in to comment on this issue.