ReviewOS

home-lang/home

Port Bun stdin pipe fd and FileSink ownership matrix

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

Port the exact upstream test/js/bun/spawn/spawn-stdin-pipe-fd-leak.test.ts corpus into Home without whole-file TODO rewriting.

Scope:

  • close untouched stdin pipe ownership when the child exits
  • retain a usable proc.stdin FileSink getter after exit
  • balance FileSink wrapper ownership when stdin is accessed
  • preserve the explicit upstream Zig/Rust divergence TODO
  • add a durable Home regression for the exact upstream file

Acceptance on macOS:

  • corpus remains byte-identical to ~/Code/bun
  • 2 active tests pass, 0 fail, 0 unsupported
  • 1 explicit upstream divergence TODO remains
  • adjacent pipe lifecycle matrices remain green
  • full home_test gate passes
10 days ago

Implemented and pushed in 7d322d4dd4329fe48681e537f053d34efac671f6.

Ported behavior:

  • removes Home whole-file TODO rewriting so the exact upstream ownership assertions execute
  • verifies untouched stdin: "pipe" descriptors close at child exit without requiring GC
  • verifies proc.stdin remains a usable FileSink when first accessed after child exit
  • locks in the shared stdin sink and reference-balanced fileSinkInternals.liveCount() behavior with a durable regression
  • preserves the explicit upstream Zig/Rust divergence TODO unchanged

Verification:

  • exact upstream byte comparison against ~/Code/bun/test/js/bun/spawn/spawn-stdin-pipe-fd-leak.test.ts: pass
  • active tests: 2 passed, 0 failed, 0 unsupported
  • explicit upstream divergence: 1 todo
  • adjacent unread-stdout GC regression: 1 passed, 0 failed, 0 unsupported, 0 todo
  • ./pantry/.bin/zig build test -Dfilter=home_test --summary failures: exit 0

Sign in to comment on this issue.