Repository navigation
fix(js): allow timer waits without Bun FFI - #1996
Conversation
|
Thanks, the fix looks right. All gates pass merged onto main a346ded (repo 54/54, test 1803/1803, perf 124/124, ping 81/81, safe 0 false rejects), and the test passes under bun and node. comp.ts lands at exactly 66,000 / 66k. One gap in the test: Could you wait out the late sleep before restoring? Within.main(): (Alternatively, enable "Allow edits by maintainers" and we'll push it.) |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A generated program containing
IO.sleep(1)fails under Node withCannot find module bun:ffi: the scheduler loads libc even when it is only waiting for a timer. UseAtomics.waitfor waits with no file descriptors; socket waits continue to useselect, and runnable work keeps its nonblocking poll. This also enables timer-backed channel deadlines andIO.withinunder Node.The regression makes the FFI table inaccessible and checks forked sleep ordering and
IO.withinraces. Nearby runtime comments are shortened to stay within the existing compiler token cap.Validation:
sleep_timer,sleep_order,within,within_busy, andchan_trypass under Bun and Node.spawn_sleep,select_eintr,tcp_try,udp_try,tcp_backlog_timer, andudp_backlog_timerpass under Bun.chan_try_wake_timersproduces its expected deliberate deadlock and exit code 1 with both the old and new wait implementations. Mini-cluster and macOS gates were not run.