Repository navigation
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.