Formal semanticsmodels WebAssembly

Wasm SpecTec

Also known as SpecTec, WebAssembly SpecTec

The language in which the official WebAssembly specification has been written since 2025. From one source it generates the spec document and an interpreter that runs the official tests.

Stage 2 · Authoritative Written in SpecTec (a domain-specific language with an OCaml toolchain) Open source · Apache-2.0 wg-3.0 · 14 months ago

SpecTec is not tied to a proof assistant. Backends that generate Rocq, Isabelle and Lean 4 definitions exist only in development branches of the SpecTec repository and are not part of the official toolchain yet. The March 2025 announcement says the Rocq backend could already handle the soundness proof for the Wasm 1.0 subset, with the full language in progress.

What it covers

Models
WebAssembly, WebAssembly 1.0, 2.0 and 3.0 (released September 2025), plus the evolving "wasm-latest"
Fragment
The whole core specification: syntax, validation, execution, and the binary and text formats, for Wasm 1.0, 2.0 and 3.0. Not defined inside SpecTec: floating-point operations, bitwise integer operations (and, shifts, popcount and similar), conversions and byte encodings. These are declared as built-ins and specified in the prose and math of the document (floats by reference to IEEE 754). The JavaScript and Web embedding specs are separate documents not written in SpecTec.
Written in
SpecTec (a domain-specific language with an OCaml toolchain)
Usable in
—
Validation
SpecTec generates a "meta-interpreter" from the same source as the spec document. The PLDI 2024 paper reports that it passed 100% of the applicable official test suite for Wasm 2.0, and the March 2025 adoption post says all applicable tests pass. The interpreter calls the reference interpreter for decoding and validation, so the tests check execution only. The spec repository runs the interpreter on the Wasm 1.0, 2.0 and 3.0 test suites in CI.
Maintained by
WebAssembly Community Group (spec editors), SpecTec team (github.com/Wasm-DSL)

Stage

Computed from the evidence below; see the criteria. MechanizedMechanized. Written in a form a computer can check, rather than on paper. means a computer can check the definition.

Stage 0 Mechanized Met
  • Met: Machine-checked or machine-readable definition The spec is a machine-readable SpecTec source that the SpecTec front end type-checks. It is not stated in a proof assistant in the official toolchain. evidence
  • Met: Fragment and version are stated Separate source folders for Wasm 1.0, 2.0, 3.0 and wasm-latest. evidence
Stage 1 Validated Met
  • Met: Can be executed or tested SpecTec generates an interpreter from the specification. evidence
  • Met: Published results against conformance tests or real implementations 100% of the applicable official Wasm 2.0 tests pass (PLDI 2024). Decoding and validation come from the reference interpreter, so only execution is tested this way. evidence
Stage 2 Authoritative Met
  • Met: Adopted by the language or ISA owner, or covers the full current version and tracks new ones Adopted by the owner: yes; full coverage: yes; tracks new versions: yes. The WebAssembly Community Group voted in March 2025 to write future editions of the spec in SpecTec. Wasm 3.0 is the first version produced with it. Covers all of the Wasm 3.0 core spec. Exclusions: float, bitwise and conversion primitives are built-ins (a TODO in the source says to implement numerics internally); the JS and Web embedding specs are not in SpecTec. New editions of the standard are written in SpecTec, so the model and the standard change together. evidence

Coverage

Which parts of WebAssembly the model defines.

WebAssembly-specific features

WebAssembly-specific features
FeatureSupportNotes
Structured control flow Blocks, loops, branches and the operand stack. SupportedSupported.
Source
source
Linear memory Loads, stores and memory growth. SupportedSupported.Includes the Wasm 3.0 additions (multiple memories and 64-bit addresses).
Source
Includes the Wasm 3.0 additions (multiple memories and 64-bit addresses). source
Tables and indirect calls Function tables and call_indirect. SupportedSupported.
Source
source
SIMD 128-bit vector instructions. SupportedSupported.Vector and relaxed-SIMD instructions are specified. Like scalar code, they rely on the float and bitwise primitives that are left to built-ins.
Source
Vector and relaxed-SIMD instructions are specified. Like scalar code, they rely on the float and bitwise primitives that are left to built-ins. source
GC and reference types The garbage-collection and reference-types proposals. SupportedSupported.Reference types and the Wasm 3.0 garbage-collection types are specified.
Source
Reference types and the Wasm 3.0 garbage-collection types are specified. source

Used by

Toolchains in this index whose proofs are about this model.

No toolchain in the index refers to it yet.

Sources

esc