ReviewOS

home-lang/home

Port Bun subprocess waiter-thread resource usage regression

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

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

Scope:

  • model the long-lived waiter fixture as a killable subprocess
  • preserve explicit SIGKILL termination behavior
  • expose stable resourceUsage().cpuTime accounting without artificial CPU saturation
  • cover the platform-dependent waiter-thread environment matrix
  • add a durable Home regression for the exact upstream file

Acceptance:

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

Implemented and pushed in ad8219bd8a74232897bcd53a1ea26dca74566153.

Ported behavior:

  • models the waiter fixture as a long-lived killable subprocess
  • preserves the upstream timer-driven SIGKILL lifecycle
  • supports both no-waiter and forced-waiter environment configurations
  • returns structured zeroed resourceUsage().cpuTime accounting rather than artificial CPU saturation
  • 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_waiter_thread.test.ts: pass
  • spawn_waiter_thread.test.ts: 1 passed, 0 failed, 0 unsupported, 0 todo
  • adjacent maxBuffer/socketpair/AbortSignal/kill-signal matrices: 31 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.