You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tracking: Lean and Why3 (experimental) backends drop return control flow — early returns silently mis-emitted #624
The Lean and Why3 source-emitter backends (both experimental per docs/CAPABILITY-MATRIX.adoc) lower a return expression to just its operand:
lib/lean_codegen.ml:62 — | ExprReturn (Some e) -> gen_expr e
lib/why3_codegen.ml:68 — | ExprReturn (Some e) -> gen_expr e
This discards the non-local control transfer. For a tail-position return e in a pure expression target that is harmless, but for a statement-position / earlyreturn (e.g. a guard that returns before the rest of the block) the emitted Lean/Why3 keeps executing the remainder of the block — a silent wrong-output miscompile.
Class
A broader codegen-honesty gap than #555 (which fenced effect handlers). Flagged, not yet fenced. Low priority — these are experimental backends, not the reference WASM target — but it violates the project's "fail loud, never silent" rule.
Suggested fix
Mirror the #555 remedy: emit a loud UnsupportedFeature for early/statement-position return in these backends until real control flow is modelled (e.g. lower to an exception/option in Why3, or a do-block early-exit in Lean). Cheapest correct step is the loud fence.
Activity
fix(ci): re-anchor SOUNDNESS.adoc #555-stub/#560 row — clears soundne…
soundness gate hardening: content-binding + stamp + xfail pins; capab…
Harden the soundness-ledger gate: content-binding, stamp-enforcement,…
fix(#624): fence Lean/Why3 backends to fail loud on early `return`
fix(#624): fence Lean/Why3 on early `return`; finish the soundness-ga…
docs(interp): CESK port plan for #623 + formal: Rows.v record-row sca…
Un-break CI: restore the DOC-04 banner, re-arm the disarmed gates, re…