You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--backend host on the CLI/wasmtime harness tests/parity/ used can never
diverge from --backend embedded: hasHostImport() is gated on
builtin.target.cpu.arch == .wasm32 and root.is_embedded_engine, true only
for the engine embedding targets, never the CLI. The CLI also never
registers native_host_call_fn, so nativeCallRaw always returns
.unsupported and every native call falls back to embedded regardless of
the flag. The check was verifying embedded output equals embedded
output; expanding its corpus as #205 originally asked would have reported
false backend-divergence coverage rather than real signal.
Removed: tests/parity/, test_runner.zig's runParity, the build.zig parity
step, the redundant parity-test CI job, and stale references in
CONTRIBUTING.md/Makefile/dev-docs. test remains the one real correctness
gate. The actual gap this leaves — no test registers a genuine alternate
implementation of the 8 CAP_* host-override capabilities and diffs it
against embedded — is written up in dev-docs/roadmap.md for future work.
Copy file name to clipboardExpand all lines: dev-docs/roadmap.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,19 @@ This becomes more relevant once the module system is used heavily. At that point
24
24
25
25
---
26
26
27
-
## 3. Exit Criteria
27
+
## 3. Host-backend override parity has no real test coverage
28
+
29
+
**Status:** gap identified 2026-07-21, not scheduled.
30
+
31
+
The VM's `native_backend` policy (`--backend embedded`/`--backend host`) lets a host override built-in natives (`std.core.len`/`append`/`bytelen`, `std.conv.*`, `std.io.println` — the 8 `CAP_*` capabilities in `src/runtime/host_abi.zig`) with its own implementation, dispatched through `gengo_native_call`. No test ever registers a *real* alternate implementation and diffs its output against the embedded one.
32
+
33
+
`tests/parity/` (removed, see #205) ran the plain CLI/WASM binary under `wasmtime run` with `--backend host` — but `hasHostImport()` is gated on `builtin.target.cpu.arch == .wasm32 and root.is_embedded_engine`, true only for the `gengo-engine.wasm`/`libgengo-engine.so` embedding targets, never for the CLI. The CLI never registers `native_host_call_fn` either, so `nativeCallRaw` always returns `.unsupported` and every call falls back to the embedded path — `--backend host` on the CLI is architecturally a no-op, for any input, always. `engine_runner.zig`'s existing host-module tests only check that calling an *unregistered* host function produces the correct error; they don't register real implementations of the 8 override capabilities either.
34
+
35
+
Real coverage would need a native (or WASM component-model) test harness that registers a genuine `native_host_call_fn` implementing those 8 capabilities, runs scripts with `--backend host` against it, and diffs the result against both golden output and the embedded-backend result. That's new test infrastructure, not a corpus expansion.
36
+
37
+
---
38
+
39
+
## 4. Exit Criteria
28
40
29
41
1. All core capabilities are `done` and covered by conformance cases.
0 commit comments