|
| 1 | +# SPDX-License-Identifier: PMPL-1.0-or-later |
| 2 | +# typed-wasm Level Achievement Status |
| 3 | + |
| 4 | +## Versioning Scheme |
| 5 | + |
| 6 | +typed-wasm versions track the highest fully-achieved level tier: |
| 7 | + |
| 8 | +| Version | Levels | Meaning | |
| 9 | +|---------|--------|---------| |
| 10 | +| v1.0 | L1-10 | Proven erasable stack (proofs + runtime L1-6, compile-time L7-10) | |
| 11 | +| v1.1 | L11-12 | Tropical + epistemic (formalised → integrated into toolchain) | |
| 12 | +| v2.0 | L13+ | Future levels (probabilistic, differential privacy, etc.) | |
| 13 | + |
| 14 | +## Current: v1.0 (L1-10 complete, L11-12 formalised) |
| 15 | + |
| 16 | +| Level | Name | Idris2 Proof | Zig FFI | Tests | Status | |
| 17 | +|-------|------|-------------|---------|-------|--------| |
| 18 | +| 1 | Instruction validity | Region.idr | Parser | ECHIDNA 10^5 | **E2E complete** | |
| 19 | +| 2 | Region-binding | Region.idr + TypedAccess.idr | Schema lookup | ECHIDNA 10^5 | **E2E complete** | |
| 20 | +| 3 | Type-compatible access | TypedAccess.idr | Typed load/store | ECHIDNA 10^5 | **E2E complete** | |
| 21 | +| 4 | Null safety | Pointer.idr | Pointer kinds | ECHIDNA 10^5 | **E2E complete** | |
| 22 | +| 5 | Bounds-proof | TypedAccess.idr + Levels.idr | Bounds check | ECHIDNA 10^5 | **E2E complete** | |
| 23 | +| 6 | Result-type | TypedAccess.idr | Type flow | ECHIDNA 10^5 | **E2E complete** | |
| 24 | +| 7 | Aliasing safety | Pointer.idr (Unique) | Erased (QTT) | ECHIDNA 10^4 | **Proven [sfap], erased** | |
| 25 | +| 8 | Effect-tracking | Effects.idr | Erased (QTT) | ECHIDNA 10^4 | **Proven [sfap], erased** | |
| 26 | +| 9 | Lifetime safety | Lifetime.idr | Erased (QTT) | ECHIDNA 10^4 | **Proven [sfap], erased** | |
| 27 | +| 10 | Linearity | Linear.idr (QTT q=1) | Erased (QTT) | ECHIDNA 10^4 | **Proven [sfap], erased** | |
| 28 | +| 11 | Tropical cost-tracking | Tropical.idr (0 believe_me) | Not yet | None | **Formalised [sfap]** | |
| 29 | +| 12 | Epistemic safety | Epistemic.idr (0 believe_me) | Not yet | None | **Formalised [sfap]** | |
| 30 | + |
| 31 | +**[sfap]** = "so far as possible" — proofs are machine-checked in Idris2 with |
| 32 | +zero dangerous patterns. They are as complete as the Idris2 type checker can |
| 33 | +verify. Full mechanical verification against a formal Wasm operational |
| 34 | +semantics (e.g. WasmCert-Isabelle) remains future work. |
| 35 | + |
| 36 | +## What "proven, erased" means |
| 37 | + |
| 38 | +Levels 7-10 are verified by the Idris2 type checker at compile time, then |
| 39 | +erased before code generation via QTT (Quantitative Type Theory). The |
| 40 | +emitted Wasm is identical to hand-written code — zero runtime overhead. |
| 41 | +This is by design, not a gap. The proofs exist to catch bugs at compile |
| 42 | +time; they are not needed at runtime. |
| 43 | + |
| 44 | +## What "formalised" means |
| 45 | + |
| 46 | +Levels 11-12 have Idris2 type definitions and proof structures with zero |
| 47 | +believe_me, but no Zig FFI implementation and no integration tests. They |
| 48 | +are machine-checked mathematical definitions, not runnable code. Wiring |
| 49 | +them into the toolchain is the v1.1 milestone. |
| 50 | + |
| 51 | +## Proof inventory (0 believe_me across all files) |
| 52 | + |
| 53 | +| File | Lines | believe_me | postulate | assert_total | |
| 54 | +|------|-------|-----------|-----------|-------------| |
| 55 | +| Region.idr | - | 0 | 0 | 0 | |
| 56 | +| TypedAccess.idr | - | 0 | 0 | 0 | |
| 57 | +| Levels.idr | - | 0 | 0 | 0 | |
| 58 | +| Pointer.idr | - | 0 | 0 | 0 | |
| 59 | +| Effects.idr | - | 0 | 0 | 0 | |
| 60 | +| Lifetime.idr | - | 0 | 0 | 0 | |
| 61 | +| Linear.idr | - | 0 | 0 | 0 | |
| 62 | +| MultiModule.idr | - | 0 | 0 | 0 | |
| 63 | +| Proofs.idr | - | 0 | 0 | 0 | |
| 64 | +| Tropical.idr | - | 0 | 0 | 0 | |
| 65 | +| Epistemic.idr | - | 0 | 0 | 0 | |
0 commit comments