ReviewOS

home-lang/home

Worker eval source corpus: meet the native test deadline without weakening the leak workload

#482
Closed chris opened this 8 days ago ·
8 days ago

Follow-up to #66 and the broader worker verification during #471. The native full worker_threads corpus file is not yet green.

Reproduction: HOME_NATIVE_VM=1 HOME_CORPUS_FULL_VM=1 ./zig-out/bin/home-debug test packages/runtime/test/bun-corpus/js/node/worker_threads/worker_threads.test.ts.

Observed native debug result: 33 pass / 1 fail / 1 between-test error. eval does not leak source code times out at its original 5000 ms deadline. Its still-running subprocess is subsequently killed by harness cleanup, producing a late assertion with exitCode null. All three snapshot cases in that file pass. Passing -t currently does not filter this Home entry point; tracked separately.

The byte-identical eval-source-leak-fixture.js creates a worker from 100 MiB of source for warmup and five measured iterations. Direct bounded execution of the unchanged fixture passes its existing 500 MiB growth threshold in Home native debug (20.22 s), and in Bun 1.3.14 (2.20 s). This is evidence of a test-deadline gap, not proof of a retained-source memory leak. Debug and release timings are not interchangeable.

Verify the fixture in a supported native optimized build, profile eval-source creation/parsing and worker teardown if the original deadline still fails, and restore a complete passing worker corpus run. Do not reduce the 100 MiB workload, iteration count, memory threshold, or silently extend the upstream deadline to claim parity. Retain separate debug/optimized evidence. Related worker ownership #461, shutdown #465/#468, snapshots #471.

The native CLI filtering gap is tracked in #481.

8 days ago

Completed optimized admission and published the verification boundary on main in 4214a24b1 (docs(runtime): record optimized worker eval admission).

A supported JSC-enabled ReleaseFast build passes 18/18 build steps. No worker source or test code was changed because the optimized implementation already meets the original contract:

  • unchanged standalone eval-source-leak-fixture.js: exit 0 in 2.875 seconds;
  • complete unchanged worker_threads.test.ts: 34 pass / 0 fail / 153 assertions in 2.788 seconds wall time;
  • eval does not leak source code within that complete run: 2,046.96 ms, below its original five-second deadline.

Both the full test and fixture are byte-identical to Bun pin 4982b91e3702094330f3be3883354c52b8c01323. The fixture still creates one warmup plus five measured workers from 100 MiB source strings, performs its original collection loops, and enforces the original 500 MiB RSS-growth threshold. The parent test keeps its original deadline. The subprocess exits naturally, so the historical late exitCode === null cleanup assertion does not occur.

The historical Debug result remains separate: it passed the memory threshold in 20.22 seconds but is not counted as meeting the five-second deadline. This closes the optimized admission item, not Linux/Windows execution, Debug performance equivalence, or complete worker/Bun parity under #66.

Sign in to comment on this issue.