ReviewOS

home-lang/home

Preserve Bun test/ checkout topology for byte-identical corpus fixtures

#646
Closed chris opened this 9 days ago ·
9 days ago

Problem

Home keeps the pinned Bun test/ tree byte-identical under packages/runtime/test/bun-corpus, but two current js/node tests intentionally address Bun's checkout-level test/ topology:

  • js/node/fs/fs.test.ts computes join(import.meta.dir, "../../../../test") and asserts that lstat/stat see the real Bun test/ directory. In Home this resolves to the nonexistent packages/runtime/test/test, producing 260 pass / 7 upstream skips / 2 fail; pinned Bun has 262 runnable passes / 7 skips.
  • js/node/readline/pause_stdin_should_exit.test.ts spawns test/js/node/readline/pause_stdin_should_exit.js. Home currently runs corpus tests with the physical corpus directory as cwd, so the child path is absent and stdout closes empty. Pinned Bun run from its checkout root passes 1/1; running pinned Bun from ~/Code/bun/test reproduces Home's empty-output failure.

The files are SHA-256-identical to ~/Code/bun/test. This is not an fs/readline/subprocess implementation failure; it is a mirror-root topology mismatch.

Required fix

Preserve the upstream checkout-root/test-root relationship for strict native corpus execution without modifying copied Bun tests, weakening assertions, creating per-test fake files/directories, or redirecting execution to an installed Bun. The solution should generalize to future upstream tests that address test/..., keep corpus bunfig/preload behavior, and work with explicit files and directories.

Acceptance

  • unchanged js/node/fs/fs.test.ts: 262 runnable pass / 7 upstream platform skips / 0 fail
  • unchanged js/node/readline/pause_stdin_should_exit.test.ts: 1 pass / 0 fail / 2 assertions
  • pinned-control outcomes documented from ~/Code/bun
  • no corpus edits, skips, timeout/workload changes, synthetic result adapters, or external runtime delegation

Parent trackers: #66, #621.

9 days ago

Completed in 65f3065 and pushed to main.

The Home mirror now preserves the Bun checkout topology instead of compensating for a differently named corpus directory:

  • moved packages/runtime/test/bun-corpus to packages/runtime/test/test as 13,002 content-identical renames
  • added the checkout-root packages/runtime/test/bunfig.toml with root = "test" and the matching preload/install configuration
  • made the VM dispatcher chdir to packages/runtime/test and pass explicit ./test/... paths
  • updated the sync/provision/scanner scripts, docs, source-path normalization, and native regression fixtures to the real topology
  • retained explicit file-path semantics for nested companion imports; no fixture aliases, corpus edits, skips, weakened assertions, or timing changes

Verification:

  • Debug and ReleaseFast builds: 21/21 steps passed
  • fs.test.ts: 262 pass, 7 upstream platform skips, 0 fail, 5,405 assertions in both Debug and ReleaseFast
  • pause_stdin_should_exit.test.ts: 1 pass, 0 fail, 2 assertions in both configurations
  • CONNECT, proxy URL, and stream focused suites all pass with only their existing upstream TODOs
  • bundler-core-itbundled: 318 pass, 16 upstream TODO, 0 fail
  • all 10 path-dependent native regression suites pass
  • full js/node scan: 263 pass, 3 fail, 0 crash, 0 hang, 0 dependency failures, 1 scanner OOM classification

The three failure rows reproduce on the pinned Bun binary (double-connect, readline.node, and node-tls-connect). The OOM row is the unchanged 4 GiB scanner classification for HTTP backpressure; that test passes when run exactly on its own. Therefore there are zero Home-specific failures, crashes, or hangs in this scan.

This resolves the topology-specific work tracked here. Whole-suite parity remains tracked in #66.

Sign in to comment on this issue.