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
⚠️ This issue is LLM-generated based on a downstream user's notes — please flag if anything is misframed.
Summary
Are there concrete plans to bring opencompl/lean-mlir's typed-SSA layer
(the Com / Expr / Ctxt / HVector / TyDenote / DialectSignature
framework from LeanMLIR/Framework/Basic.lean) into Veir itself, so
downstream projects don't have to depend on both packages separately?
If yes, what's the expected timeline + design?
If a community PR adding this layer would be welcome, we'd be happy to
draft one — we've been maintaining a stripped-down fork of the typed-SSA
layer at downstream and the design has stabilised under real use.
lean-mlir's current lean-toolchain is on nightly-2025-12-01,
which conflicts with downstream's Lean 4.29.1 stable pin.
A typed-SSA layer inside Veir would let downstream projects depend
on one upstream (Veir) for both their typed front-end and their
imperative IR back-end, with a Com → IRContext lowering bridging
them.
Concrete proposal
If a community PR is welcome, a minimum-viable contribution looks like:
New module: Veir/TypedSSA/Basic.lean mirroring lean-mlir's LeanMLIR/Framework/Basic.lean:
New lowering: Veir/TypedSSA/Lowering.lean providing lowerCom : Com d Γ ts → IRContext O and the typeclasses
(ToVeirOp, ToVeirTy) needed to bridge a typed dialect to
Veir's op-code enum. CatCrypt has a working version at VIR/ComToVeir.lean ready to upstream.
Optional: an MLIR-text emitter for typed Coms using Veir's
existing Printer.printModule. CatCrypt has the shim at VIR/VeirPrinterShim.lean.
The typed-SSA module would be additive — no impact on Veir's existing IRContext-based API. Downstream users who want only the imperative
graph continue to use what's there today; users wanting typed-SSA
import the new module.
Questions
Plans: do you already have this on the roadmap? If so, what's
the planned design and timeline?
Welcome a community PR?: would you accept a contribution along
the lines above, or do you prefer to do this in-house?
Design preferences: if a PR would be welcome:
Verbatim port of lean-mlir's typed-SSA, or a leaner version
tailored for Veir's use cases?
Module path — Veir/TypedSSA/* or somewhere else?
Naming conventions — keep Com/Expr/Ctxt or rename?
Effect annotations (EffectKind from lean-mlir) — include or
omit?
Summary
Are there concrete plans to bring
opencompl/lean-mlir's typed-SSA layer(the
Com/Expr/Ctxt/HVector/TyDenote/DialectSignatureframework from
LeanMLIR/Framework/Basic.lean) into Veir itself, sodownstream projects don't have to depend on both packages separately?
If yes, what's the expected timeline + design?
If a community PR adding this layer would be welcome, we'd be happy to
draft one — we've been maintaining a stripped-down fork of the typed-SSA
layer at downstream and the design has stabilised under real use.
Why I'm asking
CatCrypt — a verified
cryptographic compiler project — currently maintains an in-tree copy of
the typed-SSA framework
(
CatCrypt/Crypto/SecureCompilation/VIR/Core.lean)because:
IRContext/OperationPtr/Blockmodel is untyped at the value level.opencompl/lean-mliras a separate dependency alongside Veirpulls in
Veir.ForLean's polyfills that collide with Mathlib (seethe now-merged-or-pending PR Rename
List.getElem?_idxOf→List.getElem_idxOf(resolves name collision with Mathlib) #626 for one specific collision).lean-mlir's currentlean-toolchainis onnightly-2025-12-01,which conflicts with downstream's Lean 4.29.1 stable pin.
A typed-SSA layer inside Veir would let downstream projects depend
on one upstream (Veir) for both their typed front-end and their
imperative IR back-end, with a
Com → IRContextlowering bridgingthem.
Concrete proposal
If a community PR is welcome, a minimum-viable contribution looks like:
Veir/TypedSSA/Basic.leanmirroringlean-mlir'sLeanMLIR/Framework/Basic.lean:Dialect,TyDenote,HVector,Ctxt,Ctxt.Var,Ctxt.Valuation,DialectSignature,DialectDenoteExpr d Γ ts,Com d Γ ts,Expr.denote,Com.denoteLawfulOpDenote,Lets, basic recursion utilitiesVeir/TypedSSA/Lowering.leanprovidinglowerCom : Com d Γ ts → IRContext Oand the typeclasses(
ToVeirOp,ToVeirTy) needed to bridge a typed dialect toVeir's op-code enum. CatCrypt has a working version at
VIR/ComToVeir.leanready to upstream.Coms using Veir'sexisting
Printer.printModule. CatCrypt has the shim atVIR/VeirPrinterShim.lean.The typed-SSA module would be additive — no impact on Veir's existing
IRContext-based API. Downstream users who want only the imperativegraph continue to use what's there today; users wanting typed-SSA
import the new module.
Questions
the planned design and timeline?
the lines above, or do you prefer to do this in-house?
lean-mlir's typed-SSA, or a leaner versiontailored for Veir's use cases?
Veir/TypedSSA/*or somewhere else?Com/Expr/Ctxtor rename?EffectKindfromlean-mlir) — include oromit?