Repository navigation
Releases
SVL v0.7.0 — D4 band-9 pair; re-scored 6.60/10, 4th of 9
What is in this release
The D4 band-9 pair is complete. §17.2 of SVL_FORMAL_RATING.md stated the band-9
requirement for D4: "proofs bound to the emitted code plus a whole-program specification."
Both halves now exist, with verified mechanisms.
(a) Compilation certificate — the artifact is provably the compilation
PCCWasmModule binds the artifact to its source through the compiler, with three
bindings:
| # | Binding | Catches |
|---|---|---|
| 1 | artifact_sha256 — the artifact's own canonical bytes (custom sections stripped) |
a modified artifact |
| 2 | emitted_sha256 — recompiling the source emits the recorded WAT hash |
a forged claim |
| 3 | the artifact's bytes ARE the recompilation's | a swapped body that passes both individual checks |
Plus compiler_version, which is recorded and checked. verify_pcc_wasm also re-derives
the gate and SMT verdict from the source.
Measured — the "before" is the point:
valid artifact -> PASS
swapped body, forged-but-consistent -> REFUSED (this PASSED before)
one flipped body byte -> REFUSED ("modified after certification")
forged emitted hash -> REFUSED
forged compiler version -> REFUSED
wrong source -> REFUSED
pre-certificate legacy artifact -> REFUSED ("no compilation certificate")
Without binding #3, an attacker re-signs the swapped body and both claims are
self-consistent. Rule: when a certificate has two halves, the check that ties them
together is the one that does the work.
(b) Whole-program specification — module-scoped clauses
module m
requires <expr>
ensures <expr>
{ func main() type int int { ... } }
Declares what the program guarantees, at module scope, over the entry point (the
function exported as <module>_main). The clauses merge with the entry point's own
(A && B) and are discharged by the same Z3 contract prover — a module spec is
proved, not tested. A module with a spec but no main is refused, because the spec
would describe nothing. The PCC artifact records a module-spec layer.
satisfied spec -> accepted
violated ensures -> REFUSED
unsatisfiable requires -> REFUSED
spec with no entry point -> REFUSED
no spec / function spec only -> unaffected
Re-score: 6.60 / 10, 4th of 9
SVL_FORMAL_RATING.md §19. D4 8 → 9; the rank moved past OCaml (6.50).
The residual gap — stated plainly, not buried
This is not a proof that the WASM is correct.
| What is proved | What is not |
|---|---|
| the source satisfies its whole-program specification (Z3-discharged) | that the emitted WASM refines the source |
| the artifact is the compilation of that source (translation validation) | that the compiler is correct in general — it is validated empirically, by 22/22 differential execution |
| every substituted artifact is detected | — |
A reviewer who requires the obligation itself to be discharged on the WASM would hold
D4 at 8. §19.3 makes the band judgement explicit: a machine-checked chain — source proof →
pinned compiler → artifact bytes, with every substitution detected and the compiler
differentially validated — meets the bar, and the remaining gap is a compiler-correctness
gap rather than an assurance gap.
Verification
| Gate | Result |
|---|---|
| pytest | 319 passed |
| spike suite | 41/43 (the 2 are the declared stubs H36/H37) |
| corpus | 25 compiled, 0 refused |
| probes | 30 PASS / 0 FAIL / 3 INFO |
| differential execution | 22/22 agree |
| verifier corpus | 0 disagreements |
| mutation checks | 6/6 · 2/2 · 3/3 · 4/4 · 4/4 · 5/5 · 6/6 · 3/3 · 4/4 reintroduced defects falsified their pinned test |
| clean-venv install | pip install . → svlc version 0.7.0, sieve runs correct |
Asset
svl-sieve-v0.7.0.wasm — the attested examples/sieve.svl build. Verify it:
python3 examples/attest.py --verify svl-sieve-v0.7.0.wasmNot claimed
- That the WASM is correct. The obligation is on the AST; the artifact binding is
translation validation; the compiler is validated empirically. - Printed-output specification. The module spec covers the entry point's result;
the program's output is not yet specified. - Semantic translation validation. The certificate binds bytes, not refinement.
SVL v0.6.0 — kind correctness + vec<T,n> bounds; score unchanged at 6.40
What is in this release
Two more D2 engines wired — both were accepted syntax that nothing checked.
1. Kind correctness for type constructors
type Box<a> = ... declares a constructor of kind * -> *, but Box<int, int> and a bare
Box compiled without complaint.
svl/kind_inference.py had a real KindInference and was permissive: _apply_kind_one
returns KindExpr.star() on a kind mismatch and unify_kinds "defaults to *". The engine
ran and said yes to everything. check_kind_correctness now adds the discipline:
Box<int> → accepted
Pair<int, int> → accepted
Box<int, int> → REFUSED: 'Box' takes 1 type argument(s) but was given 2
Box → REFUSED: 'Box' is a type constructor ... cannot be used as a type
Option<int> → silence (undeclared — not guessed at)
struct P{...} → unaffected
2. vec<T, n> dependent bounds
vec<int, 3> = [1,2] compiled and silently behaved as a 2-element array. The bound is now
checked against an array literal or zeros(k) initializer when both sides are literal,
and nested bounds recurse:
vec<int,3> = [1,2,3] / zeros(3) → accepted
vec<int,3> = [1,2] / zeros(2) → REFUSED
vec<int, n> (symbolic size) → silence
vec<vec<int,3>, 2> = [[1,2],[4,5,6]] → REFUSED (an element has 2 element(s))
Pitfalls worth knowing
- A permissive engine is not a checker. Read what a solver does on mismatch, not
just on success. This one defaulted to the top element on disagreement. - A bare type name parses as
TypeExpr.kind == 'struct', not'ident'— an incomplete
application shows up asstruct. - The
vecannotation must lower to the same shape an array literal synthesizes
(List<T>). ReturningType.array(T)producedKind mismatch: List<int> vs [int]and
rejected every well-formedvecbinding. - Registry honesty:
kind_star/kind_arrowstayed engine-only with notes —
constructor arity is checked, but*has no type-level meaning in SVL yet, so calling
them enforced would overclaim.
Re-score: 6.40 / 10, unchanged (5th of 9)
SVL_FORMAL_RATING.md §18. D2 stays at 8.
The number did not move, and §18.3 says why plainly. This pass closed two silent gaps
rather than adding band-9 capability. Band 9 is "best-in-class", and:
- 6 of 17 kinds remain unenforced —
kind_star/kind_arrow(engine-only: the engine
exists but*has no type-level meaning and there is no HKT syntax), and
dynamic/forall/intersection/union(parse-only, no engine). - There is no parametric polymorphism —
structhas no type parameters andList<T>is
a nominal handle, not a generic.
A sound, well-checked type system with 6 of 17 advertised kinds unenforced is not
best-in-class.
§18.5: no remaining move is cheap. The D2 engine work is exhausted — the next D2 step
needs new language syntax, not wiring. The two +0.20 items left (D1 GC+closures+generics,
D4 codegen-bound proofs) are both architecture-scale.
Verification
| Gate | Result |
|---|---|
| pytest | 287 passed |
| spike suite | 41/43 (the 2 are the declared stubs H36/H37) |
| corpus | 25 compiled, 0 refused |
| probes | 30 PASS / 0 FAIL / 3 INFO |
| differential execution | 22/22 agree |
| verifier corpus | 0 disagreements |
| feature registry | (True, [], []) — 11 enforced, 6 non-enforced |
| mutation checks | 6/6 · 2/2 · 3/3 · 4/4 · 4/4 · 5/5 · 6/6 reintroduced defects falsified their pinned test |
| clean-venv install | pip install . → svlc version 0.6.0, sieve runs correct |
Asset
svl-sieve-v0.6.0.wasm — the attested examples/sieve.svl build. Verify it:
python3 examples/attest.py --verify svl-sieve-v0.6.0.wasmNot claimed
- HKT support. Arity checking is not higher-kinded types.
*has no type-level meaning
in SVL; there is no parameterized type declaration and no HKT application syntax. - Symbolic
vecbounds. A non-literal size or an undeterminable initializer is silence,
not a checked bound. - Undeclared constructors.
Option<int>with no declaration is not checked, deliberately
— unknown-identifier policy is a separate question.
SVL v0.5.0 — linear/unique enforced; re-scored 6.40/10, 5th of 9
What is in this release
D2: linear/unique are now enforced on the compile path. They used to be engine-only
and refused by strict mode with unsupported type annotation kind.
SVL has value semantics — values are i32/f64 in WASM and there is no runtime ownership —
so the discipline is static, over variable usage, the same shape as Rust's move
checker:
| Term | Definition |
|---|---|
| move | a bare variable where ownership transfers — the whole RHS of a let/assignment, an argument, or a return value |
| use | a variable inside a larger expression (x + 1, f(x + 1)), which borrows it |
A moved value may not be used or moved again — a hard error. An unconsumed linear
is a warning, not an error (a false positive would reject a correct program). unique
is affine: at most one use, so an unconsumed one is not even a warning.
Measured
let x: linear int = 5; let y = x; return y -> accepted
let x: linear int = 5; let y = x; let z = x -> REFUSED (second move)
let x: linear int = 5; let y = x; let z = x + 1 -> REFUSED (use after move)
let x: linear int = 5; let y = x + 1; let z = x -> accepted (borrow then move)
return x / g(x) with a linear x -> accepted (move)
g(x) twice -> REFUSED
unique int, same rules -> enforced, affine
unannotated variables -> completely unaffected
Four engine defects, all in the file the registry named
- Unreachable duplicate code —
borrow_variablehad a second copy of the borrow block
afterreturn True, two branches of which appended to a non-existent key. - Computed-then-discarded —
_check_unused_linearworked out the answer, then
pass # Could warn here. - Region-vs-variable confusion — it tested
var.region.is_linear, true for every
variable in a function with one linear value, so unannotated locals were reported as
unconsumed. - Substring match —
is_linearwas'linear' in str(ann).lower().
Plus infer_regions_for_function declared parameters and never walked the body.
The corpus did its job
unsupported_linear / unsupported_unique were MUST-REFUSE labels; those programs are
well-formed now, so the corpus reported 2 disagreements. Replaced with violation cases plus
five must-pass uses. Spikes H3 and H15 also asserted "strict refuses".
Re-score: 6.40 / 10, 5th of 9
SVL_FORMAL_RATING.md §17. D2 7 → 8 (+0.15) — a second engine is enforced, 10 of 17
TypeExpr kinds. The rank moved past Dafny (6.30).
Still not enforced: kind_star/kind_arrow (engine-only — svl/kind_inference.py exists),
and vec/dynamic/forall/intersection/union (parse-only, no engine). §17.3 lists
what each would need.
Verification
| Gate | Result |
|---|---|
| pytest | 264 passed |
| spike suite | 41/43 (the 2 are the declared stubs H36/H37) |
| corpus | 25 compiled, 0 refused |
| probes | 30 PASS / 0 FAIL / 3 INFO |
| differential execution | 22/22 agree |
| verifier corpus | 0 disagreements |
| feature registry | (True, [], []) — 10 kinds enforced |
| mutation checks | 6/6 · 2/2 · 3/3 · 4/4 · 4/4 · 5/5 reintroduced defects falsified their pinned test |
| clean-venv install | pip install . → svlc version 0.5.0, sieve runs correct |
Asset
svl-sieve-v0.5.0.wasm — the attested examples/sieve.svl build. Verify it:
python3 examples/attest.py --verify svl-sieve-v0.5.0.wasmNot claimed
- Runtime ownership. The linear discipline is static: it constrains variable usage, not
heap ownership. Alinearvalue that is never consumed passes (warning only). - Full linear-type support. No borrow regions, no lifetime inference, no
Drop
discipline. The engine's region model is present but the enforced rules are the move rules
above.
SVL v0.4.0 — refinement types enforced; re-scored 6.25/10
What is in this release
D2: refinement types are now enforced, not refused. { v: T | P(v) } used to parse
and be refused by strict mode with unsupported type annotation kind; the feature registry
recorded it as engine-only with "no obligation is generated yet".
svl/refinement_types.py now discharges them through Z3 on the compile path.
Introduction (must prove) vs elimination (may assume)
| Direction | Where | Rule |
|---|---|---|
| Introduction | let x: {v: T | P} = e; a call to a refined parameter; return against a refined result |
prove P[value/v] |
| Elimination | inside a function, a refined parameter; after a proven let binding |
P may be assumed |
Only QF_LIA over int/bool is modelled. Anything the encoder declines — /, %,
calls, arrays, floats, structs — is silence, never a discharge and never a false
positive.
Measured
let x: {v: int | v > 0} = 5 -> accepted
let x: {v: int | v > 0} = -5 -> REFUSED ("no assignment satisfies it")
let x: {v: int | v > 0} = 2 - 3 -> REFUSED
g(0 - 1) where g(x: {v: int | v > 0}) -> REFUSED at the call site
g(7) -> accepted
type {v: int | v > 0} { return 0 - 3 } -> REFUSED
x: {v: int | v > 5} ==> {v: int | v > 3} -> accepted (elimination)
x: {v: int | v > 0} ==> {v: int | v > 3} -> REFUSED, x=1 (not provable)
x: int ==> {v: int | v > 0} -> REFUSED, x=0 (no assumption to lean on)
predicate with `/` or a call -> silence
x: int giving no assumption is the point of the feature, not a false positive: you
cannot produce a positive value from an arbitrary int.
Three stale assertions, all claiming the old contract
test_svl_strict_types.pylistedrefinementunderUNSUPPORTED.- Spike H11 asserted "strict refuses / lenient accepts". The honest contract
inverts when a feature becomes enforced. - Spike H14 asserted
FEATURES['refinement'].status != 'enforced'as a proxy for
"the type-family engine is not wired" — and broke the moment refinement became
enforced. It now asserts the actual thing: nofamilysyntax reaches the parser.
Re-score: 6.25 / 10 (6th of 9)
SVL_FORMAL_RATING.md §16. D2 6 → 7 (+0.15), everything else unchanged.
§16.3 states plainly that the D2 move is borderline. For 7: refinement types are the
most expressive item on the H2–H16 surface, now enforced and discharged; the core is
sound and every non-enforced kind is honestly refused by name. Against 7: 9 of 17
TypeExpr kinds remain unenforced (linear, unique, kind_star, kind_arrow,
vec, dynamic, forall, intersection, union). The judgement is that a sound core
plus a genuinely expressive enforced feature differs from a wide unchecked surface, and
SVL's remaining gaps are all loud. SVL is now 0.05 below Dafny (6.30).
Verification
| Gate | Result |
|---|---|
| pytest | 240 passed |
| spike suite | 41/43 (the 2 are the declared stubs H36/H37) |
| corpus | 25 compiled, 0 refused |
| probes | 30 PASS / 0 FAIL / 3 INFO |
| differential execution | 22/22 agree |
| verifier corpus | 0 disagreements |
| feature registry | (True, [], []) — 8 kinds enforced |
| mutation checks | 6/6 · 2/2 · 3/3 · 4/4 · 4/4 reintroduced defects falsified their pinned test |
| clean-venv install | pip install . → svlc version 0.4.0, sieve runs correct |
Asset
svl-sieve-v0.4.0.wasm — the attested examples/sieve.svl build. Verify it:
python3 examples/attest.py --verify svl-sieve-v0.4.0.wasmNot claimed
Full refinement support. Predicates over floats, arrays or structs, or using /,
% or calls, are declined rather than checked. The checker is QF_LIA over int/bool.
SVL v0.3.0 — D6 work: unforgeable attestation, foreign-module linking, packages
What is in this release
The D6 work: ecosystem and interoperability. Re-scored 6.10/10 (6th of 9) in
SVL_FORMAL_RATING.md §15. D6 is the only dimension that moved, 3 → 4 — and it moved
one step, not two: §13.3 tied D6 3 → 5 to "packages + a component runtime", and only
packages landed.
W1 — VERIFIED is no longer forgeable
PackageRegistry.add_verification compared the caller-supplied public_key bytes to the
registered key, then wrote status=VERIFIED without ever calling verify(). Anyone
who knew a registered public key could attest arbitrary content — and pin its hash as
verified_content_hash, the hash verify_package later compares real bytes against.
It now checks the signature over name:version:content_hash with the registered key.
The payload/padding construction is shared by the signer and both verifiers, so the signed
bytes cannot drift between paths.
W2 — extern "c" links a real compiled module
An extern "c" func import lowered to (import "env" ...) could previously only be
satisfied by a host Python callback — there was no way to hand a program a compiled C/Rust
module.
svlc run --link MODULE.wasm program.svl # repeatable
A missing export, a signature mismatch, or a non-WASM input is refused by name at link
time, before the program runs. Measured: an SVL program called a foreign add and got 42.
W3 — a package workflow that actually transfers bytes
svlc publish lib/mathx.svl --name mathlib --version 1.0.0 --registry DIR
svlc add mathlib@1.0.0 --into myproject --registry DIR
svlc run myproject/src/main.svl # imports "mathlib/1.0.0/source.svl"
publish verifies (syntax, types, theorem, determinism ×3), writes the package with its
.svli contract, copies it into the registry, rewrites index.json, and reads it back
and re-hashes. install checks the registry's recorded hashes before writing
anything, unpacks into svl_modules/<name>/<version>/, checks again after, and records
the dependency in svl.toml.
Four defects, all a success message with no work behind it:
| Defect | Effect |
|---|---|
publish printed Uploading… then Published successfully, returned True |
nothing was transferred |
install raised NotImplementedError |
installing from a registry was impossible |
create_package checked the side-table index, not the artifact |
a deleted package was unrecoverable |
the .svli recorded source_hash and never compared it |
a body-only change (a + b → a - b, same signature) compiled and ran — measured 38 instead of 42 |
Gate, measured
publish → add → run → 42; rebuild → byte-identical (52d2cdb3…); tamper the
installed source → refused, naming the artifact and both hashes.
Verification
| Gate | Result |
|---|---|
| pytest | 217 passed |
| spike suite | 41/43 (the 2 are the declared stubs H36/H37) |
| corpus | 25 compiled, 0 refused, 0 AI findings |
| probes | 30 PASS / 0 FAIL / 3 INFO |
| differential execution | 22/22 agree (return value + printed bytes) |
| verifier corpus | 0 disagreements |
| mutation checks | 6/6, 2/2, 3/3, 4/4 reintroduced defects falsified their pinned test |
| clean-venv install | pip install . → svlc version 0.3.0, sieve runs correct |
Asset
svl-sieve-v0.3.0.wasm — the attested examples/sieve.svl build. Verify it:
python3 examples/attest.py --verify svl-sieve-v0.3.0.wasmNot claimed
- Compiling C from source.
clang --target=wasm32is present butwasm-ldis not, so
the foreign module is supplied prebuilt. The linker is real; the C toolchain is not wired. - The WASM component model — no loading a C/Rust
.soand marshalling through WIT. - Community and adoption — three of D6's four components. A local-directory registry is
real and verifiable, but it is not an ecosystem.
SVL v0.2.0 — contract-prover soundness pass
What is in this release
The contract prover no longer proves false theorems. svl/contract_prover.py
lowers requires / ensures / loop-invariant to Z3 obligations and runs inside
verify_gate.verify_program. The first cut reported proven for programs whose
contracts were false. Six defects, each reproduced before the fix and each pinned
by a test that fails when the defect is reintroduced (6/6 mutations falsified):
| # | Defect | Effect |
|---|---|---|
| 1 | Driver breaked after the first function with a contract |
a broken ensures in function two was invisible |
| 2 | Post-state bindings asserted into the antecedent instead of substituted into the clause | x == 0 && x == 5 is unsat ⇒ every obligation discharged vacuously |
| 3 | Sequencing was a flat "last RHS wins" map of evaluated terms | x = x + 1 lost its dependency on the previous value |
| 4 | i += 1 on a name with no prior binding marked tainted |
loop invariants silently declined instead of checked |
| 5 | Invariant preservation guarded by !cond instead of cond |
sound invariants refuted at states the body never executes |
| 6 | Returns paired with the joined branch states | false counterexample on a correct program — the gate refused it at compile time |
Plus a latent crash the path pairing exposed: _model_block fed raw AST nodes to
z3 (Z3Exception: parser error).
The governing rule: substitute the body's state into the clause, never assert
it into the antecedent.
Verification
| Gate | Result |
|---|---|
| pytest | 176 passed (was 166; +10 soundness regression tests) |
| spike suite | 41/43 (the 2 are the self-declared stubs H36/H37) |
| golden references | 2/2 True |
| s17 wasm determinism | assembly ok, text deterministic |
| feature registry | (True, [], []) |
| corpus | 22 compiled, 0 refused, 0 AI findings |
| verifier suite | 0 disagreements |
| mutation check | 6/6 reintroduced defects falsified the pinned test |
Requires/ensures/invariant outside QF_LIA still report unverified, never proven;
the gate refuses only on a real counterexample.
Asset
svl-sieve-v0.2.0.wasm — the attested examples/sieve.svl build. Verify it:
python3 examples/attest.py --verify svl-sieve-v0.2.0.wasmFormal rating
Unchanged at 6.00/10 (6th of 9). The fixes make the existing D4 = 8 claim true
rather than adding a capability — before this pass, the prover's proven verdicts
were not trustworthy. See SVL_FORMAL_RATING.md §14.5.
SVL v0.1.0
SVL — Self-Verifying Language, first tagged release.
Deterministic WASM compilation with a three-layer verification gate. 13 defect-probe
failures closed, 20/20 improvement spikes validated, and a second pass closed the
remaining gaps (ROLLING checksum channel, free list, REPL state, honest iterator errors).
Gates at this tag: pytest 61/61 · probe suite 30 PASS / 0 FAIL / 3 INFO ·
corpus 28/23 · golden refs 2/2 · Hebrew alias 22/22 · determinism 1 hash ·
attestation VALID · spike runner 41/43 (two declared stubs).
New in this release: extern "c" func ... host imports (callable FFI),
compile_file_to_wasm(..., prove=True) Z3 assertion discharge, svlc CLI with
repl/lsp/check --json, and a free-list allocator with free(ptr).
Asset: svl-sieve-v0.1.0.wasm — sieve.svl compiled to WASM with an embedded
svl.attest section (verifiable with python3 examples/attest.py --verify).
Honestly not included: garbage collection, a wired component-model runtime, and
GitHub release automation beyond this note.