Skip to content

test: move slow emit-zig behavioral smoke out of default zig build test#77

Merged
jeffersonmourak merged 1 commit into
mainfrom
worktree-fluffy-kindling-wall
May 27, 2026
Merged

test: move slow emit-zig behavioral smoke out of default zig build test#77
jeffersonmourak merged 1 commit into
mainfrom
worktree-fluffy-kindling-wall

Conversation

@jeffersonmourak

Copy link
Copy Markdown
Owner

Summary

The dev-loop zig build test had grown to ~221 s (warm), and almost all of it was a single serial tail. Two emit-zig behavioral suites (tests/emit/behavior_test.zig, tests/emit/project_behavior_test.zig) each spawn a nested zig build wasm per fixture — ~33 cache-missing WebAssembly compiles per run, one of which alone accounted for ~180 s.

Those suites compile a circuit through the experimental --emit-zig backend (standalone Zig source → wasm) and assert its runtime behavior. But that same behavior, over the same 32-fixture corpus and the same expected vectors, is already validated far more cheaply by tests/e2e/serializer_fixtures_test.zig, which drives the production path: splice topology sections into the prebuilt embedded runtime and run via Node, with no per-fixture compile. The two emit suites were therefore ~100% redundant for behavioral coverage; their only unique value is smoke-testing the emit-zig backend itself.

Change

  • Trim the two emit-zig suites to a small backend smoke (2 fixtures each, covering the single-file and multi-file project emit paths).
  • Split the build into three steps:
    • zig build test — fast dev-loop suite (default); full circuit-behavior coverage retained via serializer_fixtures_test.
    • zig build test-emit — opt-in emit-zig backend smoke (the nested-build suites).
    • zig build test-alltest + test-emit; the full gate.
  • Point pr-tests.yml at test-all so emit-backend regressions still block merges (the job name is unchanged to preserve the required-check identity).
  • Add a build-once guard to tests/cli/integration_test.zig, which was invoking zig build circ-compile 16 times per run.

Result

before after
zig build test (dev loop) ~221 s ~31 s (7×)
zig build test-all (CI) ~27 s

Coverage was verified intact: deliberately breaking the AND-gate evaluator turns the fast test red via serializer_fixtures_test (plus the truth-table suites).

A prior round of test-speed work (96 s → 25 s, via a persistent wasm workspace) is recorded in DOCS/archive/plan-test-speed.md. A natural follow-up — grouping the ~57 per-module test binaries and reusing the installed CLI binary in the integration test instead of rebuilding it — would push the dev loop below ~31 s.

…est`

The dev-loop `zig build test` ran ~221s, dominated by two emit-zig
behavioral suites that spawn a nested `zig build wasm` per fixture
(~33 cache-missing wasm compiles). Their circuit-behavior coverage is
fully duplicated by the production-path serializer_fixtures_test
(prebuilt runtime + topology sections, no per-fixture compile).

Trim those suites to a small emit-backend smoke and split the build
into `test` (fast dev loop), `test-emit` (opt-in emit smoke), and
`test-all` (CI gate = both); point pr-tests.yml at `test-all`. Add a
build-once guard to the CLI integration test. Dev-loop `test` drops
from ~221s to ~31s with no loss of behavioral coverage.
@jeffersonmourak jeffersonmourak added the perf This contains performance work label May 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Engine bench: deltas vs main

(bench produced no JSON output; see workflow logs for the actual error.)

See the workflow run logs for the actual error.

@jeffersonmourak
jeffersonmourak merged commit 0e2fc28 into main May 27, 2026
4 of 5 checks passed
@jeffersonmourak
jeffersonmourak deleted the worktree-fluffy-kindling-wall branch May 27, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf This contains performance work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant