Skip to content

Add CI; fix bench/ops.ts against the current mountApp signature - #19

Merged
lannbot merged 1 commit into
mainfrom
fix/bench-ops-mountapp
Sep 3, 2026
Merged

Add CI; fix bench/ops.ts against the current mountApp signature#19
lannbot merged 1 commit into
mainfrom
fix/bench-ops-mountapp

Conversation

@lannbot

@lannbot lannbot commented Sep 3, 2026

Copy link
Copy Markdown
Owner

bench/ops.ts was calling mountApp with the pre-source option shape:

mountApp({ componentBytes, translator, root, onError })   // stale
mountApp({ source: { componentBytes, translator }, root, onError })  // current

Every op failed all three attempts with Cannot use 'in' operator to search for 'plan' in undefined. Because bench_worker.ts deliberately converts a failed op into medianMs: null rather than aborting the run (one op failing shouldn't kill the whole table), complete breakage rendered as a table of N/A rather than as a crash.

The type checker already knew

deno check bench reports it outright:

TS2353: Object literal may only specify known properties,
        and 'componentBytes' does not exist in type 'MountOptions'.

Nothing was running it. deno.json's check task covered host/src host/tests and stopped there. Widened to include bench. The three translator: unknown parameters are now UntranslatedArtifacts["translator"], taken from the embedder's own type so the call site stays pinned to what mountApp accepts.

CI

The hole surviving is the more general problem: there was no CI at all, so every gate was "someone remembers to run it". This adds .github/workflows/ci.yml, which runs the existing just recipes unchanged — new gates belong in the justfile, not in the workflow.

Two things it deliberately does:

  • Builds the fixture and counter components. host/tests/counter_test.ts and host/tests/fullstack_test.ts throw when their .wasm is missing rather than skipping, so these steps are load-bearing: drop one and the suite goes red, not quietly green.
  • Runs both halves of the cross-language protocol gate. cargo test's golden_matches_committed pins the Rust encoder to vectors/; deno task test's decoder_test.ts pins the TypeScript decoder to the same committed files. Neither was running automatically before.

Toolchain versions (Rust, Deno, wasm-tools, just) are pinned, matching how the justfile pins POLYENGINE_REV and Cargo.toml pins dioxus/wit-bindgen. A floating toolchain can turn clippy -D warnings red on a new lint with no commit to blame.

Verified locally

Ran the workflow's exact sequence: just deps (17s from a clean checkout), just check, just fixtures, just example counter, just test — cargo 10 passed + golden_matches_committed ok, deno 87 passed including the 4 golden-vector tests. bench/bench_worker.ts remove-row stream now returns a real median instead of null.

Independent of the stream<u8> vs stream<operation> spike (#18), which stays as it is.

bench/ops.ts still called mountApp({ componentBytes, translator, root,
onError }) — the pre-`source` shape. Every op failed all three attempts
with "Cannot use 'in' operator to search for 'plan' in undefined", and
because bench_worker.ts deliberately turns a failed op into
medianMs: null rather than aborting the run, total breakage rendered as
a table of N/A rather than as a crash.

`deno check` catches it outright (TS2353). Nothing was running
`deno check` over bench/: deno.json's check task covered host/src and
host/tests only. Widened to include bench.

That the hole survived at all is the more general problem — the repo had
no CI, so every gate was "someone remembers to run it". Adds a workflow
running the existing just recipes unchanged, so a green check means what
`just check && just test` means locally. It builds the fixture and
counter components because the suites that load them throw rather than
skip when the .wasm is absent, and it runs both halves of the
cross-language protocol gate: golden_matches_committed pins the Rust
encoder to vectors/, and decoder_test.ts pins the TypeScript decoder to
the same files.

Toolchain versions are pinned, matching how the justfile pins
POLYENGINE_REV and Cargo.toml pins dioxus/wit-bindgen: a floating
toolchain can turn `clippy -D warnings` red with no commit to blame.
@lannbot
lannbot merged commit 4d751e0 into main Sep 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants