# WasmCert-Rocq

> A model of WebAssembly 2.0 (plus tail calls and subtyping) in Rocq, with a type soundness proof and a verified interpreter that is extracted to OCaml and run on the official tests.

- Kind: formal semantics
- Models: WebAssembly (WebAssembly 2.0, plus tail calls and subtyping)
- Fragment: Wasm 2.0 typing, execution and module instantiation, plus tail calls and the subtyping rules of the function-references and GC proposals. Integer and float operations come from CompCert's integer and float libraries (built on Flocq). SIMD instructions are opaque: their execution calls the official reference interpreter. The binary parser is unverified (experimental). Wasm 3.0 GC structs and arrays, exceptions, multiple memories and 64-bit memories are not listed as covered.
- Written in: Rocq
- Available in: Rocq
- Stage: 1 (Validated)
- Licence: open-source, MIT (files in src/Parray are LGPL-2.1-or-later)
- Validation: The extracted interpreter (WasmRef-Coq) is proved sound with respect to the Rocq semantics. It runs the official conformance test suite (a WasmCert copy of it, included as a submodule) in CI, and the README says it is expected to pass all core tests. Tail calls are not tested this way.
- Latest release: v2.2.1 (2026-10-12) https://github.com/WasmCert/WasmCert-Coq/releases/tag/v2.2.1

## Stage

**Stage 1: Validated.**

| Stage | Criterion | Met | Evidence / note |
|---|---|---|---|
| 0 | Machine-checked or machine-readable definition | yes | [evidence](https://github.com/WasmCert/WasmCert-Coq) |
| 0 | Fragment and version are stated | yes | [evidence](https://github.com/WasmCert/WasmCert-Coq/blob/master/README.md) The README states Wasm 2.0 plus subtyping and tail calls, and how SIMD is handled. |
| 1 | Can be executed or tested | yes | [evidence](https://github.com/WasmCert/WasmCert-Coq/blob/master/README.md) An interpreter extracted to OCaml runs .wasm and .wat files. |
| 1 | Published results against conformance tests or real implementations | yes | [evidence](https://github.com/WasmCert/WasmCert-Coq/blob/master/README.md) The conformance suite runs in CI (make run_wast). No published pass counts were found; the README says all core tests are expected to pass. |
| 2 | Adopted by the language or ISA owner, or covers the full current version and tracks new ones | no | [evidence](https://webassembly.org/news/2025-09-17-wasm-3.0/) Adopted by the owner: no; full coverage: no; tracks new versions: no. Not adopted by the WebAssembly Community Group. Covers Wasm 2.0 plus some later features. The current version, Wasm 3.0 (September 2025), adds GC, exceptions, multiple memories and 64-bit memories, which are not covered. No stated schedule for following new Wasm versions was found. |

Missing for Stage 2: Adopted by the language or ISA owner, or covers the full current version and tracks new ones.

## WebAssembly-specific features

| Feature | Coverage |
|---|---|
| Structured control flow | Supported — Includes tail calls. ([source](https://github.com/WasmCert/WasmCert-Coq/blob/master/README.md)) |
| Linear memory | Supported — Wasm 2.0 memory instructions, including bulk memory. ([source](https://github.com/WasmCert/WasmCert-Coq/blob/master/README.md)) |
| Tables and indirect calls | Supported ([source](https://github.com/WasmCert/WasmCert-Coq/blob/master/README.md)) |
| SIMD | Partial — SIMD instructions are parsed as opaque opcodes and executed by calling the reference implementation. Their meaning is not defined in Rocq. ([source](https://github.com/WasmCert/WasmCert-Coq/blob/master/README.md)) |
| GC and reference types | Partial — Wasm 2.0 reference types plus the subtyping rules from the function-references and GC proposals. GC structs and arrays are not covered. ([source](https://github.com/WasmCert/WasmCert-Coq/blob/master/README.md)) |

## Sources
- [WasmCert-Coq repository and README](https://github.com/WasmCert/WasmCert-Coq)
- [License (MIT with LGPL parts)](https://github.com/WasmCert/WasmCert-Coq/blob/master/LICENSE.txt)
- [Release 2.2.1 notes](https://github.com/WasmCert/WasmCert-Coq/releases/tag/v2.2.1)
- [Watt et al., Two Mechanisations of WebAssembly 1.0 (FM 2021), author copy](https://www.cl.cam.ac.uk/~jp622/two_wasm.pdf)
- [Iris-Wasm program logic branch](https://github.com/WasmCert/WasmCert-Coq/tree/iris-wasm-opam)

---
Last checked 2026-11-26. Data: [JSON](/semantics/wasmcert-rocq.json) · Page: [HTML](/semantics/wasmcert-rocq/) · Methodology v0.1: [/methodology/](/methodology/) · Corrections: [/contribute/](/contribute/)
