ReviewOS

home-lang/home

Native Headers/Response corpus: preserve fixture root and startup environment

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

Published resolution

Published 649c3c48f to origin/main, authored and committed by Chris Breuer without coauthors.

  • All six original Headers/Response files now run natively through ordinary individual and combined Home commands: 170 passes / zero failures / zero TODOs / zero unsupported cases. Pinned Bun controls pass the same 170 tests with 750 assertions and the original Response inline snapshot.
  • Fixed the native corpus startup context and the additional absolute-path CLI root rewrite exposed by the first focused run. The real mirrored project root, startup internal-testing/GC defaults, explicit GC overrides and relative executable overrides are preserved. The source link points to Home's actual runtime source; fixture commands and snapshots are unchanged.
  • Final verification: 46/46 optimized build steps, 23/23 focused harness steps / 6/6 tests, independently verified metadata for all five named regressions plus the registration guard, and the isolated existing CLI path helper test. The earlier 4/5 matrix failure is retained as diagnosed evidence, not credited as a pass.
  • Adjacent ordinary Request, shell, WebKit, Node-script, bootstrap microtask and expected-failure routes pass. Existing shell/WebKit TODOs remain visible. Final corpus audit: 12,990 identical regular files, five identical symlinks, one historical expectations-file difference and zero missing paths.

#698 is complete. Full Bun parity and full aggregate execution remain incomplete under #66/#202; #694 remains open. Next is #699: native body/stream activation and removal of body-clone-specific substitutes. Its separate unchanged strict-native baselines are 9,467 passes / four upstream skips / zero failures per runtime.

Final binary SHA-256: f7e0abf6e3e75795c70f48221810814e986bcfa52c80cda7a6f614d82a29257f.

Implementation and verification details.


Parent: #66. Adapter retirement: #202. Follow-up to the native Request work in #697.

Activate unchanged Headers/Response corpus coverage through Home's production runtime, with the same fixture project root and startup environment as Bun's own harness. These six files still take the bootstrap corpus path:

File under js/web/fetchNative Home passing testsPinned Bun passing testsAssertions
headers.test.ts9494520
headers-case.test.ts339
headers.undici.test.ts5151166
fetch_headers.test.js6612
response.test.ts141441, one snapshot
response-cyclic-reference.test.ts222

This is 170 native passes per runtime, established across the files with the setup corrections below, not an ordinary-corpus or one-process aggregate pass. Baseline Home executable SHA-256: acc4837aed857184e7b3d1107e48126c1c0d819e8ae85ff2a61ddb6215ea567f. Bun source/build pin: 4982b91.

Two actual setup dependencies were exposed:

  1. Running the Response file from the outer Home checkout initially produces 13 passes / 1 snapshot failure in both binaries. The only diff is <cwd>/test/test/js/web/fetch/response.test.ts versus the original <cwd>/test/js/web/fetch/response.test.ts. Running the same unchanged file from the mirrored Bun project root packages/runtime/test passes all 14 in both binaries. Native corpus children currently inherit the outer cwd; supply the actual mirrored project root through process invocation instead of rewriting snapshots, paths in output, or assertions.
  2. The pinned release Bun initially cannot load bun:internal-for-testing for headers.test.ts (0 passes / 1 failure / 1 load error). --expose-internals did not fix this build. The actual startup gate in VirtualMachine requires both BUN_FEATURE_FLAG_INTERNAL_FOR_TESTING=1 and BUN_GARBAGE_COLLECTOR_LEVEL=0, which are already the values in upstream harness.bunEnv. Supplying them before VM creation passes all 94 tests. A preload alone is too late for this startup gate. Preserve the original GC mode; do not use forced GC changes to obtain passing resource tests.

Acceptance: native routing for the complete six-file matrix; explicit correct corpus child cwd/startup environment without affecting unrelated subprocess callers; all original tests and the cyclic-response 10,000-iteration workloads and heap thresholds intact; independent Home/Bun controls; no TODO/skip injection, fake APIs/counters, retry/warm-up, assertion or snapshot changes. Retain failure accounting and source-integrity checks. Review adjacent native routes affected by process-context changes. Full native source/build ownership and remaining adapters stay under the parent issues.

9 days ago

The predecessor Request/lazy-engine-dispatch work is published in 5e45c58a3 on origin/main, and #697 is closed. #66 now lists this issue as the next concrete native activation batch. The baseline binary hash in this issue matches that published Request batch. The six-file native baseline is evidence for implementation; ordinary corpus routing and child cwd/startup-environment changes are still pending here.

9 days ago

Implementation is in progress as a paired Headers/Response batch. Native corpus capture now takes an explicit mirrored-project launch context, sets the two upstream internal-testing/GC startup prerequisites before VM initialization, preserves nonempty GC overrides, and resolves relative executable overrides before changing cwd. All six original files are selected for native execution; focused coverage includes the complete file matrix, original cyclic workloads, launch environment, real child cwd/internal bindings, and executable-path handling.

Fresh pinned Bun controls pass 170/170 / 750 assertions / one original inline snapshot. The tracked corpus audit remains 12,990 identical regular files, five identical symlinks, one historical expectations-file difference and zero missing paths. Optimized Home build and focused tests are still running; no final Home validation is claimed yet.

The next seven-file body activation/removal batch is now #699, with separate strict-native Home/Bun baselines of 9,467 passes, four upstream skips and zero failures per runtime. Body-clone-specific bootstrap fake subprocess output and stream substitutions are explicitly included for removal there.

9 days ago

The first focused harness run found an additional CLI defect: 4/5 tests passed, but the complete matrix failed the unchanged Response snapshot. The corpus child had the correct initial cwd; runTestsViaVM then recognized the absolute corpus argument and moved up to packages/runtime, rewriting it as ./test/test/.... Pinned Bun passes the exact absolute-path/preload invocation; Home passes its relative-path form but fails that absolute form. The initial failure remains recorded and is not credited as a passing run.

The implementation now fixes the VM launcher's root and argument rewriting as well. It runs from the mirrored project root and uses ./test/... arguments with ./bunfig.toml. A tracked relative packages/runtime/test/src -> ../src link exposes Home's real runtime source for repository-relative source-reading fixtures, preserving the shell grep ... src/js_parser/parser.zig input without changing its command or output. The optimized build and final harness/ordinary-route verification are in progress.

9 days ago

Published 649c3c48f to origin/main, authored and committed by Chris Breuer without coauthors.

  • All six original Headers/Response files now run natively through ordinary individual and combined Home commands: 170 passes / zero failures / zero TODOs / zero unsupported cases. Pinned Bun controls pass the same 170 tests with 750 assertions and the original Response inline snapshot.
  • Fixed the native corpus startup context and the additional absolute-path CLI root rewrite exposed by the first focused run. The real mirrored project root, startup internal-testing/GC defaults, explicit GC overrides and relative executable overrides are preserved. The source link points to Home's actual runtime source; fixture commands and snapshots are unchanged.
  • Final verification: 46/46 optimized build steps, 23/23 focused harness steps / 6/6 tests, independently verified metadata for all five named regressions plus the registration guard, and the isolated existing CLI path helper test. The earlier 4/5 matrix failure is retained as diagnosed evidence, not credited as a pass.
  • Adjacent ordinary Request, shell, WebKit, Node-script, bootstrap microtask and expected-failure routes pass. Existing shell/WebKit TODOs remain visible. Final corpus audit: 12,990 identical regular files, five identical symlinks, one historical expectations-file difference and zero missing paths.

#698 is complete. Full Bun parity and full aggregate execution remain incomplete under #66/#202; #694 remains open. Next is #699: native body/stream activation and removal of body-clone-specific substitutes. Its separate unchanged strict-native baselines are 9,467 passes / four upstream skips / zero failures per runtime.

Final binary SHA-256: f7e0abf6e3e75795c70f48221810814e986bcfa52c80cda7a6f614d82a29257f.

Implementation and verification details.

Sign in to comment on this issue.