|
| 1 | +# VeIR Felt Drop-In Roadmap Role |
| 2 | + |
| 3 | +Last reviewed: 2026-06-11 |
| 4 | + |
| 5 | +This repo is the implementation side of the Felt drop-in replacement effort. |
| 6 | +The project-wide roadmap lives in the companion repository at |
| 7 | +`../llzk-lean/docs/drop-in-roadmap.md` in the shared workspace. |
| 8 | + |
| 9 | +## Current Role |
| 10 | + |
| 11 | +VEIR currently provides: |
| 12 | + |
| 13 | +- LLZK Felt IR representation, parser/printer support, verifier shape checks, |
| 14 | + and the `felt-combine` pass. |
| 15 | +- Fifteen Felt rewrite patterns over `const`, `add`, `sub`, `mul`, and `neg`. |
| 16 | +- Lean arithmetic proofs and sorry-free structural rewrite precondition proofs |
| 17 | + for those 15 patterns. |
| 18 | +- A standalone value-level Felt interpreter proof-of-concept in |
| 19 | + `Veir/Passes/Felt/InterpModel.lean`. |
| 20 | +- The differential driver `scripts/llzk-diff.sh`, consumed by llzk-lean's |
| 21 | + clean-pin harness. |
| 22 | + |
| 23 | +VEIR does not yet provide a complete drop-in Felt replacement: |
| 24 | + |
| 25 | +- 13 accepted LLZK Felt operations still lack semantic models and interpreter |
| 26 | + cases in VEIR. |
| 27 | +- The current `felt-combine` pass includes verified algebraic rewrites that the |
| 28 | + C++ LLZK canonicalizer does not perform. Those are useful verified |
| 29 | + optimizations, but they must be separated from the C++-parity adoption |
| 30 | + profile. |
| 31 | +- There is no whole-program rewrite semantic theorem. |
| 32 | +- There is no direct `llzk-opt` replacement integration point. |
| 33 | + |
| 34 | +## Replacement Profiles |
| 35 | + |
| 36 | +VEIR should expose two Felt profiles for the drop-in work: |
| 37 | + |
| 38 | +- **C++-parity profile.** Adoption and regression baseline. This profile should |
| 39 | + match the accepted LLZK C++ folder/canonicalization behavior as closely as |
| 40 | + possible so users can opt in, compare, and fall back cleanly. |
| 41 | +- **Enhanced VEIR profile.** Improvement path. This profile may run additional |
| 42 | + verified rewrites from `felt-combine`, but every intentional divergence from |
| 43 | + C++ LLZK must have differential evidence, executable side conditions, |
| 44 | + semantic justification, and downstream compatibility review. |
| 45 | + |
| 46 | +The current nonconstant algebraic divergences are not automatically defects. |
| 47 | +They are blockers only for the parity profile. They become compelling |
| 48 | +enhanced-profile features only after their runtime semantics and replacement |
| 49 | +toolchain behavior are tied down. |
| 50 | + |
| 51 | +## VeIR Work Required For Drop-In |
| 52 | + |
| 53 | +1. **Add profile separation.** Keep `felt-combine` as the stronger verified |
| 54 | + optimization pass, but add or configure a C++-parity profile that matches |
| 55 | + the C++ Felt folder behavior first. |
| 56 | +2. **Port the missing folder semantics.** Implement the C++ fold behavior for |
| 57 | + `pow`, `div`, `uintdiv`, `sintdiv`, `umod`, `smod`, `inv`, `bit_and`, |
| 58 | + `bit_or`, `bit_xor`, `bit_not`, `shl`, and `shr`, including no-fold side |
| 59 | + conditions. |
| 60 | +3. **Model runtime side conditions.** Field registry lookup, registered-field |
| 61 | + preconditions, signed representative conversion, bitwidth, division by zero, |
| 62 | + and `NotFieldNative` scope must be executable conditions, not prose. |
| 63 | +4. **Attach auditable rewrite metadata.** If Strategy E continues, certificate |
| 64 | + shapes and side conditions should be derived from or colocated with the |
| 65 | + executable patterns so llzk-lean does not hand-maintain a parallel catalog. |
| 66 | +5. **Strengthen semantic statements.** Arithmetic identities in |
| 67 | + `Veir/Passes/Felt/Proofs.lean` are supporting lemmas. Drop-in claims need |
| 68 | + value-level runtime lemmas tied to the operations, matchers, result |
| 69 | + constructors, and side conditions that actually run. |
| 70 | + |
| 71 | +## Non-Claims |
| 72 | + |
| 73 | +The current VeIR fork does not claim: |
| 74 | + |
| 75 | +- full LLZK Felt semantic parity; |
| 76 | +- complete coverage of all C++ Felt folders; |
| 77 | +- runtime LLZK rewrite verification; |
| 78 | +- replacement of all of `llzk-opt`; |
| 79 | +- whole-program semantic preservation for `felt-combine`. |
| 80 | + |
| 81 | +Those claims become available only through the roadmap gates in the companion |
| 82 | +`llzk-lean` document. |
0 commit comments