Status: implemented and verified on codex/runtime-port; keeping this issue open pending integration.
Native fake-clock checkpoint — d0ed7c906
Committed and pushed on codex/runtime-port as Chris Breuer, without coauthors; not yet merged to main. #490 now passes the unchanged core fake-timer file: 30 tests / 83 assertions, up from 16 pass / 14 fail. Installed Bun 1.3.14 passes the same 30 / 83 control. Mockable timer deadlines now share the fake clock, fractional advancement retains nanoseconds, real option/getter validation runs before clock mutation, and both reset paths release timer/AbortSignal references outside the heap lock.
Verification:
- Native build and cached rebuild: 17/17 steps.
- All 21 native regression files pass; the new fake-clock test also passes three consecutive repeats and fails against the cached pre-change Home binary. It checks actual Home execution, inherited/throwing getters, Date/performance agreement, fractional nested callbacks, retained cancelled handles, natural exit and bounded GC counts after allocating 3,072 timeout/interval wrappers plus 1,536 AbortSignal timeouts across resets.
- Entire unchanged fake-timer directory: 61 reported pass / 438 TODO / 0 fail / 115 assertions in Home and Bun. 14 reported passes are
it.failingcases, not implemented features; all 438 TODOs are excluded from logical completion. There are 47 ordinary passing tests, including the core 30. - Unchanged isolation: 19 tests / 67 assertions. Unchanged timers/promises: 4 / 7. Twenty-four selected corpus files match the pinned Bun checkout byte-for-byte. Focused Pickier, timer-file Zig formatting and whitespace checks pass.
The wider Node timer file still hangs after printing 19 passes on its final caught-immediate-exception fixture. This happens in the pre-change Home binary too. The standalone fixture times out in both Home binaries and exits successfully in Bun; the original-checkout Bun control passes the full 20 / 31. Tracked separately in #493; neither incomplete runs nor expected failures count as logical parity.
Deferred imports #491, parallel coordinator/IPC #485, the full worker deadline #482, remaining native ownership, other platforms and full-suite parity remain open. The full port and 100% logical Bun-suite compatibility are not complete. See docs/docs/NATIVE_RUNTIME_BINDINGS.md for the implementation and verification boundary.
Original failure report (historical)
Follow-up to #66, #481, and #484. Isolated-file cancellation must remain distinct from implementing fake clock semantics.
Native reproduction
HOME_NATIVE_VM=1 HOME_CORPUS_FULL_VM=1 ./zig-out/bin/home-debug test packages/runtime/test/bun-corpus/js/bun/test/fake-timers/fake-timers.test.tsThe unchanged upstream file reports 16 pass / 14 fail / 65 assertions. Failures include advancing timer callbacks, mocked Date.now(), and useFakeTimers({ now }). This same result was reproduced with the cached native binary from before the isolation work; it is not a newly introduced failure from cancelling isolated-file timers. Installed Bun 1.3.14 passes the same file with 30 pass / 83 assertions.
Required work
Connect fake-clock time, timer scheduling/advancement, Date overrides, and parsed now options through the real native implementation. Check cancellation and reset lifetimes as well as observed times. Preserve the upstream workload and assertions. A working isFakeTimers() or empty timer count is not proof that callbacks advance or clocks are overridden.
Source pin: 4982b91e3702094330f3be3883354c52b8c01323. Reproduction was made during the native isolation work on codex/runtime-port. #484 covers cancellation between isolated globals, not the full fake-timers suite.