Meld fuses. Loom weaves. Synth transpiles. Kiln fires. Sigil seals.
Meld statically fuses multiple WebAssembly P2/P3 components into a single core module, eliminating the need for runtime linking. Import resolution, index-space merging, and canonical ABI adapter generation happen at build time. Every transformation carries mechanized proofs covering parsing, resolution, merging, and adapter correctness.
Unlike composition tools that produce linked-but-separate component graphs, Meld produces a single monolithic module suitable for whole-program optimization by Loom and native transpilation by Synth.
# From source (Cargo)
cargo install --path meld-cli
# From source (Bazel)
bazel build //meld-cli:meld
# Fuse two components
meld fuse component_a.wasm component_b.wasm -o fused.wasm# 1. Build components
cargo component build --release
# 2. Fuse into single module
meld fuse composed.wasm -o fused.wasm
# 3. Optimize with Loom
loom optimize fused.wasm -o optimized.wasm
# 4. Run
wasmtime run optimized.wasmload("@meld//rules:meld.bzl", "meld_fuse")
meld_fuse(
name = "my_app",
components = [
":component_a",
":component_b",
],
)- Parse — Extract core modules and type information from components
- Resolve — Build import/export graph, identify cross-component calls
- Merge — Combine function/memory/table/global index spaces
- Adapt — Generate Canonical ABI trampolines for cross-component calls
- Encode — Output single core WebAssembly module
Cross-component calls may require adapters that handle string transcoding (UTF-8, UTF-16, Latin-1), memory copying between component memories, list/array serialization, and resource handle transfer. Meld generates these adapters using techniques inspired by Wasmtime's FACT (Fused Adapter Compiler of Trampolines).
Each component retains its own linear memory. Cross-component calls use adapters that allocate in the callee's memory via cabi_realloc and copy data with memory.copy. Requires multi-memory support (WebAssembly Core Spec 3.0).
meld fuse a.wasm b.wasm -o fused.wasmAll components share a single linear memory. Simpler but one component's memory.grow corrupts every other component's address space.
meld fuse --memory shared a.wasm b.wasm -o fused.wasmMeld integrates with Sigil for supply chain attestation. Each fusion operation records input component hashes, tool version and configuration, and transformation metadata. The attestation is embedded in the output module's custom section.
Meld's core transformations are formally verified using Rocq 9.0 (formerly Coq). The proofs establish that fusion preserves program semantics — the fused module behaves identically to the original composed components.
Key verified properties:
- Merge correctness — Index remapping preserves function/memory/table references
- Resolve correctness — Topological sort produces valid instantiation order; cycle detection terminates
- Adapter correctness — Generated trampolines preserve call semantics
- Forward simulation — Fused module simulates the original component graph step-by-step
Proofs are built via Bazel using rules_rocq_rust:
bazel build //proofs/transformations/merge:merge_spec
bazel build //proofs/spec:fusion_specSee proofs/ for the full proof tree and PROOF_GUIDE.md for an introduction.
Note
Cross-cutting verification — Rocq mechanized proofs, Kani bounded model checking, Z3 SMT verification, and Verus Rust verification are used across the PulseEngine toolchain. Sigil attestation chains bind it all together.
- Resources — Resource handle transfer across components is limited
- Async — Async component functions not yet supported
- String transcoding — UTF-8/UTF-16 and Latin-1/UTF-8 are implemented; UTF-8/Latin-1 is not yet supported
cargo build # Build
cargo test # Test
bazel build //... # Bazel build
RUST_LOG=debug cargo run -- fuse a.wasm b.wasm -o out.wasmApache-2.0
Part of PulseEngine — formally verified WebAssembly toolchain for safety-critical systems