ReviewOS

home-lang/home

Port Bun subprocess maxBuffer and timeout matrix

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

Port the exact upstream test/js/bun/spawn/spawn-maxbuf.test.ts corpus into Home without TODO rewriting.

Scope:

  • add spawn-pipe pipeTo() interoperability required by TextDecoderStream
  • terminate async and sync subprocesses at finite maxBuffer with the requested signal
  • expose exitedDueToMaxBuffer for sync results
  • enforce finite async and sync timeouts with exitedDueToTimeout for sync results
  • preserve unlimited output and runtime behavior for Infinity
  • add a durable Home regression for the exact upstream file

Acceptance:

  • exact corpus remains byte-identical to ~/Code/bun
  • 8 passed, 0 failed, 0 unsupported, 0 todo
  • adjacent spawn matrices remain green
  • full home_test gate passes
10 days ago

Implemented and pushed in d720e3fc5eca6d2d6e65b4a7d461ba28ddb4f39e.

Ported behavior:

  • adds spawn-pipe pipeTo() interoperability and async iteration for transform readable streams
  • terminates async and sync subprocesses at finite maxBuffer with the requested signal
  • exposes exitedDueToMaxBuffer and exitedDueToTimeout on sync results
  • models finite timeout timing and preserves unlimited output/runtime behavior for Infinity
  • corrects shared sync timeout validation so Bun-compatible Infinity is accepted while invalid finite values remain rejected
  • removes the exact upstream corpus file from the TODO rewrite and adds a durable Home regression

Verification:

  • exact upstream byte comparison against ~/Code/bun/test/js/bun/spawn/spawn-maxbuf.test.ts: pass
  • spawn-maxbuf.test.ts: 8 passed, 0 failed, 0 unsupported, 0 todo
  • adjacent socketpair/AbortSignal/kill-signal matrices: 23 passed, 0 failed, 0 unsupported, 0 todo
  • existing spawnSync.test.ts: 5 passed, 0 failed, 0 unsupported, 1 pre-existing todo
  • ./pantry/.bin/zig build test -Dfilter=home_test --summary failures: exit 0

Sign in to comment on this issue.