ReviewOS

home-lang/home

VM parity: default optional code-generation flags and preserve getter errors

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

Tracked from #66 and #885.

The unchanged upstream test-vm-codegen.js fails in native Home because a partial contextCodeGeneration object becomes { strings: false, wasm: undefined }, and the native parser rejects the undefined property instead of applying the enabled default. The same mismatch affects explicit undefined flags in createContext and Script.runInNewContext.

A Node v26.10.0 comparison also found a getter-order difference: Node reads both strings and wasm before validating their values. When strings returns an invalid value and the wasm getter throws, Home currently raises the strings type error before reading wasm.

Acceptance:

  • Apply the enabled default for absent or undefined strings/wasm flags across all three VM entry points.
  • Preserve false flags and reject other invalid types.
  • Preserve both getter order and exception identity.
  • Pass the unchanged upstream code-generation test and related module/options tests with complete native corpus reports.

Completed in implementation 1abfe1aee, integrated with current main in f08bd50d7, and published with 568 verified evidence artifacts in ec4c45382. Both source checkpoints passed the 56-step native build, all 24 unchanged selected original files, and five focused commands. The native exception exits were also corrected to return an engaged optional error result, preserving throwing getter identity without allocating a realm with a pending exception. The final corpus has 14 passing test cases and 19 passing process checks, with no failed files, skips, TODOs, filtering or retries. Node/Home memory/options tests and Home context-collection and inspector-console tests passed. Pickier and the whitespace check passed. The baseline failure and failed first focused attempt remain included. Baseline executable SHA-256: 226aeb563f7a01309cdedc836e04bd23d31cbc0714025e3bdb5380d13b23cf14, source checkpoint de6aea2393c626d9edeea9784d9c302f542741b7, upstream pin 4982b91e3702094330f3be3883354c52b8c01323.

8 days ago

Completed and validated on merged main f08bd50d7; published as ec4c45382. The 24 unchanged pinned Bun files and all five focused commands pass. Evidence and retained failure history. This completes the option-default/getter-exception scope; #66 and #885 retain their broader acceptance work.

Sign in to comment on this issue.