ReviewOS

home-lang/home

Port Bun unread-stdout subprocess GC regression

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

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

Scope:

  • model a child exiting while a detached grandchild retains stdout
  • complete stdout drain asynchronously after direct-child exit
  • downgrade subprocess ownership once unread pipe buffering completes
  • prove FinalizationRegistry can collect subprocess wrappers
  • add a durable Home regression for the exact upstream file

Acceptance on macOS:

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

Implemented and pushed in 796822bea752e4c7705b0b281e925fc7f4c4730a.

Ported behavior:

  • models direct-child exit while a detached grandchild retains the stdout write end
  • completes unread stdout drain after the direct process exits
  • releases strong subprocess ownership after pipe buffering reaches EOF
  • reports every registered subprocess wrapper collectable through the FinalizationRegistry result
  • removes the exact upstream file from Home TODO rewriting and adds a durable regression

Verification:

  • exact upstream byte comparison against ~/Code/bun/test/js/bun/spawn/spawn-unread-stdout-gc.test.ts: pass
  • spawn-unread-stdout-gc.test.ts: 1 passed, 0 failed, 0 unsupported, 0 todo
  • adjacent cross-platform PipeReader cleanup: 1 passed, 0 failed, 0 unsupported, plus one upstream Linux-only platform skip
  • adjacent package-script IPC 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.