Context
Follow-up to merged #1857 (which closed #1737 — the EVMYulLean transition itself). After #1857, the trust boundary is established and the native EvmYul.Yul.callDispatcher is the sole runtime authority for the supported fragment. The legacy reference-oracle stack is removed. Concrete deployed contracts (Storage.sol, SimpleStorage.sol, etc.) are verified unconditionally.
The work that remains is lifting a class of internal helper theorems from conditional to unconditional form. This does not change the trust boundary or the public surface — concrete contract correctness is already unconditional in #1857 — but it removes hypotheses from internal building blocks so that future user-body shapes drop out automatically without manual continuation provision.
Theorems that are currently conditional
In Compiler/Proofs/EndToEnd.lean:
NativeGeneratedSelectorHitSuccessBridge.of_leave_body (E2) — takes hCont : LeaveAwareCallDispatcherContinuation
NativeGeneratedSelectorHitSuccessBridge.of_block_leave (E4) — same
NativeGeneratedSelectorHitSuccessBridge.of_nativePreservableStraightStmts_leave (E6, degenerate) — same
NativeGeneratedSelectorHitSuccessBridge.of_bridgedStraightStmts_falling_through E7 — same
NativeGeneratedSelectorHitSuccessBridge.of_leave_body_with_label_prefix (F2)
NativeGeneratedSelectorHitSuccessBridge.of_block_leave_with_label_prefix (F4)
NativeGeneratedSelectorHitSuccessBridge.of_nativePreservableStraightStmts_leave_with_label_prefix (F6, degenerate)
- F7 (degenerate, delegates to F2)
- True S8:
compile_preserves_native_evmYulLean_of_compile_ok_supported_generated_callDispatcher still has hUserBodyHalt premise. The strengthened private _via_result variant already takes the unified Result bridge.
All of these compile and are correct under their hypotheses. They are not yet useful for new dispatcher-emitted body shapes without manual continuation provision.
Why it's blocked
The LeaveAwareCallDispatcherContinuation provider needs to discharge the _revived form of NativeBlockPreservesWord on the user-body, including Leave-ending bodies. The OLD-form NativeBlockPreservesWord provider in nativeGeneratedCallDispatcherResult_selector_hit_ok_matchesIR_forall_of_compile_ok_supported works for Ok-shaped finals but fails for Checkpoint-Leave finals (because final[name]! returns default for Checkpoint states — see memory yul-state-lookup-bracket-vs-lookup). The _revived form via final.reviveJump[name]! succeeds on Checkpoint Leave but proving it directly requires the per-BridgedStraightStmt IR↔native observation-equivalence framework which does not exist yet.
Scope estimate
- Framework: ~300–500 LoC, ~2–4 weeks.
- Parallel
_revived dispatcher continuation provider: ~700 LoC, ~3–7 days once framework lands (mirrors nativeGeneratedCallDispatcherResult_selector_hit_ok_matchesIR_forall_of_compile_ok_supported).
- Wiring E2-E7 + F2-F7 + true S8 to drop
LeaveAwareCallDispatcherContinuation / hUserBodyHalt: ~1–3 days.
Design path
See memory entry per-stmt-observation-framework-design.md (in .claude/projects/-workspaces-mission-de9e924b/memory/) and related design notes:
Phase 1: Define statesAligned : IRState → Yul.State → Prop and resultsAligned : IRExecResultWithInternals → Except Yul.Exception Yul.State → Prop. These currently do not exist as top-level abstractions — alignment is woven case-by-case through existing proofs.
Phase 2: Define NativeStraightStmtObserved (stmt : YulStmt) (codeOverride : Option YulContract) : Prop and prove for each of the ~20 constructors of NativePreservableStraightStmt (Compiler/Proofs/YulGeneration/Backends/EvmYulLeanNativeHarness.lean:18510):
- Easy (~30 LoC each, ~5 constructors):
comment, expr_stop, expr_return, expr_revert.
- Medium (~50 LoC each, ~10 constructors):
let_, assign, expr_sstore, expr_mstore, expr_tstore, expr_mstore8, expr_log0..log4.
- Hard (~80 LoC each, ~5 constructors):
letMany, expr_calldatacopy, expr_returndatacopy, generic expr_call.
Phase 3: Inductive step over NativePreservableStraightStmts.
Phase 4: Use the framework to discharge D1/D2/E6/E7 narrowing, then build the parallel _revived dispatcher continuation provider, then drop hCont / hUserBodyHalt from the affected theorems.
Success criteria
Related
Context
Follow-up to merged #1857 (which closed #1737 — the EVMYulLean transition itself). After #1857, the trust boundary is established and the native
EvmYul.Yul.callDispatcheris the sole runtime authority for the supported fragment. The legacy reference-oracle stack is removed. Concrete deployed contracts (Storage.sol, SimpleStorage.sol, etc.) are verified unconditionally.The work that remains is lifting a class of internal helper theorems from conditional to unconditional form. This does not change the trust boundary or the public surface — concrete contract correctness is already unconditional in #1857 — but it removes hypotheses from internal building blocks so that future user-body shapes drop out automatically without manual continuation provision.
Theorems that are currently conditional
In
Compiler/Proofs/EndToEnd.lean:NativeGeneratedSelectorHitSuccessBridge.of_leave_body(E2) — takeshCont : LeaveAwareCallDispatcherContinuationNativeGeneratedSelectorHitSuccessBridge.of_block_leave(E4) — sameNativeGeneratedSelectorHitSuccessBridge.of_nativePreservableStraightStmts_leave(E6, degenerate) — sameNativeGeneratedSelectorHitSuccessBridge.of_bridgedStraightStmts_falling_throughE7 — sameNativeGeneratedSelectorHitSuccessBridge.of_leave_body_with_label_prefix(F2)NativeGeneratedSelectorHitSuccessBridge.of_block_leave_with_label_prefix(F4)NativeGeneratedSelectorHitSuccessBridge.of_nativePreservableStraightStmts_leave_with_label_prefix(F6, degenerate)compile_preserves_native_evmYulLean_of_compile_ok_supported_generated_callDispatcherstill hashUserBodyHaltpremise. The strengthened private_via_resultvariant already takes the unified Result bridge.All of these compile and are correct under their hypotheses. They are not yet useful for new dispatcher-emitted body shapes without manual continuation provision.
Why it's blocked
The
LeaveAwareCallDispatcherContinuationprovider needs to discharge the_revivedform ofNativeBlockPreservesWordon the user-body, including Leave-ending bodies. The OLD-formNativeBlockPreservesWordprovider innativeGeneratedCallDispatcherResult_selector_hit_ok_matchesIR_forall_of_compile_ok_supportedworks for Ok-shaped finals but fails for Checkpoint-Leave finals (becausefinal[name]!returnsdefaultfor Checkpoint states — see memoryyul-state-lookup-bracket-vs-lookup). The_revivedform viafinal.reviveJump[name]!succeeds on Checkpoint Leave but proving it directly requires the per-BridgedStraightStmtIR↔native observation-equivalence framework which does not exist yet.Scope estimate
_reviveddispatcher continuation provider: ~700 LoC, ~3–7 days once framework lands (mirrorsnativeGeneratedCallDispatcherResult_selector_hit_ok_matchesIR_forall_of_compile_ok_supported).LeaveAwareCallDispatcherContinuation/hUserBodyHalt: ~1–3 days.Design path
See memory entry
per-stmt-observation-framework-design.md(in.claude/projects/-workspaces-mission-de9e924b/memory/) and related design notes:yul-state-lookup-bracket-vs-lookuprevived-chain-universal-discharge(closed in G1 S5-S8 stage 2: D1/D2 + E2-E7 success bridges + S8 dispatcher refactor #1857)leave-preservation-blockerper-stmt-observation-framework-design(open)Phase 1: Define
statesAligned : IRState → Yul.State → PropandresultsAligned : IRExecResultWithInternals → Except Yul.Exception Yul.State → Prop. These currently do not exist as top-level abstractions — alignment is woven case-by-case through existing proofs.Phase 2: Define
NativeStraightStmtObserved (stmt : YulStmt) (codeOverride : Option YulContract) : Propand prove for each of the ~20 constructors ofNativePreservableStraightStmt(Compiler/Proofs/YulGeneration/Backends/EvmYulLeanNativeHarness.lean:18510):comment,expr_stop,expr_return,expr_revert.let_,assign,expr_sstore,expr_mstore,expr_tstore,expr_mstore8,expr_log0..log4.letMany,expr_calldatacopy,expr_returndatacopy, genericexpr_call.Phase 3: Inductive step over
NativePreservableStraightStmts.Phase 4: Use the framework to discharge D1/D2/E6/E7 narrowing, then build the parallel
_reviveddispatcher continuation provider, then drophCont/hUserBodyHaltfrom the affected theorems.Success criteria
NativeGeneratedSelectorHitSuccessBridge.of_*constructor inEndToEnd.leanis unconditional (nohCont/hExecBridge/LeaveAwareCallDispatcherContinuationhypothesis).compile_preserves_native_evmYulLean_of_compile_ok_supported_generated_callDispatcher(true S8) lands withouthUserBodyHalt.git grep -n LeaveAwareCallDispatcherContinuationreturns only the definition + the framework's provider (no leftover hypothesis sites).lake clean && lake buildgreen;make checkgreen; full CI green.Related
native-evmyullean-g1-s5-s8-stage2).claude/projects/-workspaces-mission-de9e924b/memory/