Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
fc6b2b9
proofs: expose native EVMYulLean transition target
claude Apr 22, 2026
cdadf59
docs: clarify verity helper calls
claude Apr 22, 2026
1640081
proofs: track native transition blockers
claude Apr 22, 2026
ebbd280
proofs: harden native runtime smoke coverage
claude Apr 22, 2026
747ba1b
proofs: document native env defaults
claude Apr 22, 2026
3ecef1d
proofs: pin native dispatch selector cases
claude Apr 22, 2026
d163384
proofs: pin native dispatch case bodies
claude Apr 22, 2026
0be3e6c
proofs: pin native calldata bridge bytes
claude Apr 22, 2026
14040ca
proofs: pin native dispatcher selector expression
claude Apr 22, 2026
4d91760
docs: clarify native dispatcher execution blocker
claude Apr 22, 2026
0b516fc
proofs: pin native error rollback projection
claude Apr 22, 2026
4d28241
proofs: require native observable slots
claude Apr 22, 2026
e059708
proofs: pin native observable sload
claude Apr 22, 2026
8a5a25d
proofs: cover native IR entrypoint
claude Apr 22, 2026
01fad08
proofs: cover native log projection arities
claude Apr 22, 2026
3a9451c
proofs: cover native transient storage
claude Apr 22, 2026
ef27bda
proofs: cover native stop halt projection
claude Apr 22, 2026
b0d0a87
proofs: cover native value result projection
claude Apr 22, 2026
17c20a2
proofs: cover native return halt projection
claude Apr 22, 2026
616e39d
proofs: pin native halt builtin lowering
claude Apr 22, 2026
93f1b09
proofs: cover native ok storage projection
claude Apr 22, 2026
6e4bb81
proofs: pin native final mapping projection
claude Apr 22, 2026
6846a98
proofs: pin native helper call partition
claude Apr 22, 2026
d846ae2
proofs: pin native initial state bridge
claude Apr 22, 2026
8949e7b
proofs: pin native nested helper rejection
claude Apr 22, 2026
8b431c8
proofs: pin native hard error rollback
claude Apr 22, 2026
14103b9
proofs: pin native return dispatch lowering
claude Apr 22, 2026
4d5013f
proofs: pin native explicit storage slots
claude Apr 22, 2026
41ad1ff
proofs: pin native revert rollback
claude Apr 22, 2026
38cc57b
proofs: pin native IR slot forwarding
claude Apr 22, 2026
c6cf8f0
proofs: pin native transaction environment
claude Apr 22, 2026
3a36713
proofs: name native bridge invariants
claude Apr 22, 2026
0633d53
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
1b303a7
proofs: name native projection outcomes
claude Apr 22, 2026
ed9ce9f
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
a91031c
proofs: name native initial state invariants
claude Apr 22, 2026
f00b839
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
01738dd
proofs: name native storage seeding invariant
claude Apr 22, 2026
4569161
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
ebae796
proofs: name native execution pipeline invariant
claude Apr 22, 2026
8d70342
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
ac1e113
proofs: name native IR execution pipeline invariant
claude Apr 22, 2026
8b5128e
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
3247230
proofs: name native account installation invariant
claude Apr 22, 2026
527fd06
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
d36804d
proofs: name native environment defaults invariant
claude Apr 22, 2026
4d44138
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
661f8e7
proofs: name native calldata size invariant
claude Apr 22, 2026
7e34efb
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
f779f37
proofs: name native halt projection invariants
claude Apr 22, 2026
ae5bb73
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
116f924
proofs: name native event projection invariants
claude Apr 22, 2026
79677ed
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
6b268a7
proofs: name omitted native storage invariant
claude Apr 22, 2026
f5d763e
proofs: name native finalMappings invariant
claude Apr 22, 2026
120e053
proofs: name native final storage invariants
claude Apr 22, 2026
b5e39b9
proofs: name native result observable invariants
claude Apr 22, 2026
08601d4
proofs: name missing native account storage invariant
claude Apr 22, 2026
cba4038
proofs: name native missing slot result invariants
claude Apr 22, 2026
193e6d6
proofs: name native final mapping invariants
claude Apr 22, 2026
e76a912
proofs: name native non-word return fallback
claude Apr 22, 2026
7f41306
proofs: name native call lowering invariants
claude Apr 22, 2026
e132814
proofs: name native environment bridge fields
claude Apr 22, 2026
71fe730
scripts: recognize partial defs in proof length check
claude Apr 22, 2026
985d7d5
scripts: test partial defs terminate proof spans
claude Apr 22, 2026
f10f5fd
ci: include native harness in evmyullean probe
claude Apr 22, 2026
92092ed
proofs: compare native env smoke with oracle
claude Apr 22, 2026
cb41fda
ci: guard native transition doc status
claude Apr 22, 2026
2799bb3
ci: guard native observable slot caveat
claude Apr 22, 2026
373790b
ci: guard native observable slot api
claude Apr 22, 2026
20e7b90
contracts: close evmyullean transition blockers
claude Apr 22, 2026
f85598c
contracts: harden overload and env accessors
claude Apr 22, 2026
30d108d
contracts: add migration parity surfaces
claude Apr 22, 2026
e01b323
contracts: remove legacy internal call surface
claude Apr 22, 2026
ef46e5b
contracts: fix overload review regressions
claude Apr 22, 2026
647f2f3
contracts: memoize tuple array element index
claude Apr 22, 2026
a9ec28c
contracts: fail closed on ambiguous overload lookup
claude Apr 22, 2026
c06ab65
compiler: recurse trust surface through array element words
claude Apr 22, 2026
ea21ba6
compiler: reject internal external name collisions
claude Apr 22, 2026
909125f
proofs: cover native selector bytes and new source cases
claude Apr 22, 2026
0724aad
contracts: close tuple array element review gaps
claude Apr 22, 2026
04e2186
proofs: add native dispatch oracle
claude Apr 22, 2026
2094769
contracts: harden overload generated names
claude Apr 22, 2026
57ccf1f
proofs: cover memory return native oracle
claude Apr 22, 2026
aae4b46
compiler: document selector-keyed overload dispatch
claude Apr 22, 2026
1b32fd5
proofs: cover native calldata argument oracle
claude Apr 22, 2026
cd0ea42
evmyullean: lower native dispatch lazily
claude Apr 22, 2026
82b7a89
proofs: cover native mapping oracle shapes
claude Apr 22, 2026
d3305cb
evmyullean: scope lazy native dispatch
claude Apr 22, 2026
8ff72e6
proofs: cover native packed mapping oracle
claude Apr 22, 2026
a823227
evmyullean: thread native switch ids
claude Apr 22, 2026
2f1f16a
macro: accept qualified blobbasefee
claude Apr 22, 2026
dba993a
evmyullean: guard native switch fallthrough
claude Apr 22, 2026
bdaa1a9
ci: guard native theorem transition target
claude Apr 22, 2026
6ffd034
ci: pin unbridged native env boundary
claude Apr 22, 2026
d595759
evmyullean: remove dead native stmt wrapper
claude Apr 22, 2026
e484cb8
compilation: split array element helper gates
claude Apr 22, 2026
2e40dd4
macro: reject ABI-erased newtype overloads
claude Apr 22, 2026
f6d9c68
proofs: expose native runtime preservation seam
claude Apr 22, 2026
06eed0e
evmyullean: validate native environment reads
claude Apr 22, 2026
1155569
evmyullean: freshen native switch temps
claude Apr 22, 2026
f1b975a
evmyullean: reserve function switch temps
claude Apr 22, 2026
1b366a0
proofs: align native bridge observables
claude Apr 22, 2026
7d96db1
evmyullean: validate native env on selected path
claude Apr 22, 2026
b1a4551
compiler: restrict plain arrayElement to word arrays
claude Apr 22, 2026
f037645
compiler: share array element usage traversal
claude Apr 22, 2026
9511f9d
proofs: add native bridge intro theorem
claude Apr 22, 2026
f6cee4b
proofs: expose lowered native dispatcher bridge
claude Apr 23, 2026
96e5f23
compiler: preserve shadowed context accessors
claude Apr 23, 2026
2c5e3bc
compiler: include package roots for module imports
claude Apr 23, 2026
08db836
compiler: simplify array element usage detection
claude Apr 23, 2026
9b34373
tests: cover context accessor shadow smoke
claude Apr 23, 2026
ceb10ec
proofs: expose native runtime lowering equations
claude Apr 23, 2026
ac78d5a
evmyullean: normalize native dispatch selector
claude Apr 23, 2026
5e3e487
macro: track tuple array return temp
claude Apr 23, 2026
36a92a9
evmyullean: expose statement native lowering equations
claude Apr 23, 2026
fbf26e9
macro: resolve declared context-name shadows
claude Apr 23, 2026
febf07f
proofs: expose native dispatcher block bridge
claude Apr 23, 2026
edd96ef
proofs: target lowered dispatcher block
claude Apr 23, 2026
728b822
proofs: expose raw native dispatcher exec
claude Apr 23, 2026
80d6396
proofs: narrow native dispatcher agreement
claude Apr 23, 2026
98b8ed7
compiler: allow namespaced internal helper names
claude Apr 23, 2026
9c340b9
proofs: expose native selector evaluation
claude Apr 23, 2026
8cbd225
compiler: lower storage words in typed ir
claude Apr 23, 2026
33aa242
proofs: expose native selector recomposition
claude Apr 23, 2026
31d0c27
proofs: reduce native selector byte decoding
claude Apr 23, 2026
f101a02
semantics: execute setStorageWord in source model
claude Apr 23, 2026
e7ea5ea
proofs: reduce native selector read bridge
claude Apr 23, 2026
7ece6e6
proofs: prove native selector evaluation
claude Apr 23, 2026
f93cb23
runtime: mirror packed address word writes
claude Apr 23, 2026
b5f384e
proofs: expose native switch guard execution
claude Apr 23, 2026
0b853a8
semantics: mirror raw storage word writes
claude Apr 23, 2026
ade837d
compiler: scan nested array helper usage
claude Apr 23, 2026
f478d28
proofs: expose native switch selected case
claude Apr 23, 2026
6763a5b
compiler: scope duplicate signatures to dispatch
claude Apr 23, 2026
7ca5e75
proofs: skip matched native switch cases
claude Apr 23, 2026
d1562ac
runtime: ignore user functions in native builtin scan
claude Apr 23, 2026
97d7abe
compiler: clarify array element word offsets
claude Apr 23, 2026
e67f6b0
proofs: package marked native switch case
claude Apr 23, 2026
0d6e127
ci: register packed address macro smoke
claude Apr 23, 2026
12e4432
ci: sync evmyullean fork audit pin
claude Apr 23, 2026
fdba4d3
proofs: package native switch prefix
claude Apr 23, 2026
79024ee
compiler: wrap storage word slots
claude Apr 23, 2026
be21bb8
proofs: package native switch freshness
claude Apr 23, 2026
9580577
proofs: package native switch default guard
claude Apr 23, 2026
bc262bb
proofs: package native switch case miss
claude Apr 23, 2026
194ef58
proofs: generalize native switch guard fuel
claude Apr 23, 2026
6355ddc
proofs: prove native switch case chains
claude Apr 23, 2026
9856714
proofs: package native switch defaults
claude Apr 23, 2026
19edb78
macro: erase ADTs in ABI overload keys
claude Apr 23, 2026
07b3ac0
proofs: bridge native switch selector lookup
claude Apr 23, 2026
c61a0a8
checks: address native transition review findings
claude Apr 23, 2026
11b2cae
proofs: factor native switch body preservation
claude Apr 23, 2026
ef96d23
typed-ir: reject ambiguous signature lookup
claude Apr 23, 2026
e947d8b
proofs: compose native switch defaults
claude Apr 23, 2026
234807f
proofs: preserve native switch case lookup
claude Apr 23, 2026
a30d023
proofs: parameterize native switch prefix
claude Apr 23, 2026
0e8efb2
proofs: expose native switch block parts
claude Apr 23, 2026
4698356
proofs: bridge raw native switch blocks
claude Apr 23, 2026
f363b2b
proofs: trim native switch proof guard
claude Apr 23, 2026
b1e3aa0
native: reject unbridged header builtins
claude Apr 23, 2026
070a5f8
proofs: package native assignment preservation
claude Apr 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Compiler.Proofs.YulGeneration.Backends.EvmYulLeanAdapter
import Compiler.Proofs.YulGeneration.Backends.EvmYulLeanStateBridge
import Compiler.Proofs.YulGeneration.ReferenceOracle.Semantics
import Compiler.Codegen
import EvmYul.Yul.Interpreter

namespace Compiler.Proofs.YulGeneration.Backends.Native
Expand Down Expand Up @@ -97,6 +98,7 @@ def projectHaltReturn (state : EvmYul.Yul.State) (haltValue : EvmYul.Yul.Ast.Lit
def projectResult
(tx : YulTransaction)
(initialStorage : Nat → Nat)
(initialEvents : List (List Nat))
(result :
Except EvmYul.Yul.Exception
(EvmYul.Yul.State × List EvmYul.Yul.Ast.Literal)) :
Expand All @@ -108,20 +110,20 @@ def projectResult
returnValue := values.head?.map uint256ToNat
finalStorage := finalStorage
finalMappings := Compiler.Proofs.storageAsMappings finalStorage
events := projectLogsFromState state }
events := initialEvents ++ projectLogsFromState state }
| .error (.YulHalt state value) =>
let finalStorage := projectStorageFromState tx state
{ success := true
returnValue := projectHaltReturn state value
finalStorage := finalStorage
finalMappings := Compiler.Proofs.storageAsMappings finalStorage
events := projectLogsFromState state }
events := initialEvents ++ projectLogsFromState state }
| .error _ =>
{ success := false
returnValue := none
finalStorage := initialStorage
finalMappings := Compiler.Proofs.storageAsMappings initialStorage
events := [] }
events := initialEvents }

/-- Lower and execute Verity runtime Yul through EVMYulLean's native
dispatcher. -/
Expand All @@ -130,11 +132,29 @@ def interpretRuntimeNative
(runtimeCode : List YulStmt)
(tx : YulTransaction)
(storage : Nat → Nat)
(observableSlots : List Nat := []) :
(observableSlots : List Nat := [])
(events : List (List Nat) := []) :
Except AdapterError YulResult := do
let contract ← lowerRuntimeContractNative runtimeCode
let initial := initialState contract tx storage observableSlots
let result := EvmYul.Yul.callDispatcher fuel (some contract) initial
pure (projectResult tx storage result)
pure (projectResult tx storage events result)

/-- Native EVMYulLean execution target for emitted IR-contract runtime Yul.

This is the executable target that #1737 will promote into the public theorem
path once the state/result bridge lemmas are proved. It intentionally returns
`Except AdapterError YulResult` today because native lowering can still fail
closed for duplicate helper definitions or unsupported runtime shapes.
-/
def interpretIRRuntimeNative
(fuel : Nat)
(contract : Compiler.IRContract)
(tx : Compiler.Proofs.IRGeneration.IRTransaction)
(state : Compiler.Proofs.IRGeneration.IRState)
(observableSlots : List Nat := []) :
Comment thread
Th0rgal marked this conversation as resolved.
Outdated
Except AdapterError YulResult :=
interpretRuntimeNative fuel (Compiler.emitYul contract).runtimeCode
(YulTransaction.ofIR tx) state.storage observableSlots state.events

end Compiler.Proofs.YulGeneration.Backends.Native
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,11 @@ example :
| .error _ => false) = true := by
native_decide

example :
(match Native.interpretRuntimeNative 128 []
sampleTx zeroStorage [] [[1, 2, 3]] with
| .ok result => result.success && result.events == [[1, 2, 3]]
| .error _ => false) = true := by
native_decide

end Compiler.Proofs.YulGeneration.Backends
135 changes: 135 additions & 0 deletions docs/NATIVE_EVMYULLEAN_TRANSITION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Native EVMYulLean Runtime Transition

This document tracks the remaining work for issue #1737: make native
EVMYulLean execution the public Layer 3 semantic target for Verity-generated
runtime Yul.

## Current State

The current public proof path still targets:

```lean
interpretYulRuntimeWithBackend .evmYulLean
```

That path executes Verity's custom fuel-based Yul statement interpreter and
routes bridged builtins through EVMYulLean-backed builtin evaluation. This is a
useful compatibility bridge, but it is not the final architecture requested by
#1722.

The native path now exists beside it:

```lean
Compiler.Proofs.YulGeneration.Backends.Native.interpretRuntimeNative
Compiler.Proofs.YulGeneration.Backends.Native.interpretIRRuntimeNative
```

Those entry points lower Verity runtime Yul into an EVMYulLean `YulContract`,
construct an EVMYulLean `SharedState .Yul`, run
`EvmYul.Yul.callDispatcher`, and project the observable result back to
Verity's `YulResult` shape.

## What This PR Establishes

- The native target has an IR-contract entry point:
`interpretIRRuntimeNative`.
- Native result projection preserves pre-existing event history and appends
native EVMYulLean logs, matching the observable shape expected by the current
proof-side `YulResult`.
- The native harness remains separate from the existing retargeting theorem, so
the proof tree does not claim a theorem that is not yet proved.

## Clean Target Architecture

The desired end state is:

```text
CompilationModel
-> IRContract
-> emitted runtime Yul
-> EVMYulLean YulContract
-> EvmYul.Yul.callDispatcher
-> projected observable result
```

The Verity custom Yul interpreter should then be used only as a regression
oracle, not as the semantic target in the public theorem stack.

## Remaining Work

1. Prove lowering invariants for the native contract shape.

Required facts:
- top-level `funcDef` nodes are partitioned into `YulContract.functions`,
- dispatcher code contains no function definitions,
- known runtime builtins lower to native `.inl` primops,
- user/helper calls remain `.inr` function calls,
- duplicate helper definitions fail closed.

2. Prove native state bridge lemmas.

Required fields:
- selector and calldata byte layout,
- caller/source and current address,
- callvalue,
- block timestamp, block number, chain id, and blob base fee,
- storage lookup and storage write projection,
- transient storage where generated Yul uses `tload`/`tstore`,
- memory and returndata for ABI return/revert/log paths.

3. Prove native result projection lemmas.

Required cases:
- normal expression values returned by `callDispatcher`,
- `stop`,
- 32-byte `return`,
- `revert` with rollback,
- log projection with topics followed by word-aligned data,
- hard native errors mapping to conservative failure.

4. Add wider executable coverage for the native path.

Current smoke coverage exercises primop lowering, helper function maps,
storage writes, callvalue, return projection, and log projection. Next
coverage should include:
- dispatcher selector selection from emitted runtime code,
- memory-heavy `return` and `revert`,
- `log0` through `log4`,
- returndata and external-call outcomes,
- static-call permission behavior,
- mapping helper lowering or replacement with native keccak/memory code.

5. Introduce the public native preservation theorem.

The successor theorem should target `interpretIRRuntimeNative`, or a
total wrapper around it once the remaining closed-failure cases are ruled
out by syntactic invariants.

A clean intermediate theorem is:

```lean
interpretYulRuntimeWithBackend .evmYulLean emittedRuntime
=
interpretRuntimeNative fuel emittedRuntime ...
```

for the safe generated fragment. Once that bridge is proved, retarget the
Layer 3 and EndToEnd statements directly to the native execution target.

6. Flip the trust boundary only after the theorem target moves.

Documentation should say EVMYulLean is the authoritative semantic target
only after the public theorem no longer routes through
`execYulFuelWithBackend`. Until then, the accurate status is:
EVMYulLean-backed builtin bridge proven, native runtime harness executable,
native public theorem pending.

## Cleanup After the Flip

- Move `execYulFuel` and `execYulFuelWithBackend` to reference-oracle status.
- Remove bridge-only docs that describe the custom interpreter as the active
semantic target.
- Keep cross-check tests between the old oracle and native EVMYulLean for one
release cycle.
- Upstream any EVMYulLean fork changes needed for memory, returndata, logs, or
external-call semantics.
3 changes: 2 additions & 1 deletion docs/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Execution priorities:
| # | Component | Approach | Effort | Status |
|---|-----------|----------|--------|--------|
| 1 | ~~Function Selectors~~ | keccak256 axiom + CI | — | ✅ **DONE** (PR #43, #46) |
| 2 | Yul/EVM Semantics Bridge | EVMYulLean integration | 1-3m | 🟢 **PHASE 4 COMPLETE** |
| 2 | Yul/EVM Semantics Bridge | EVMYulLean integration | 1-3m | 🟡 **BRIDGE COMPLETE, NATIVE TARGET PENDING** |
| 3 | EVM Semantics | Strong testing + documented assumption | Ongoing | ⚪ TODO |

**Yul/EVM Semantics Bridge** (Issue [#1722](https://github.com/lfglabs-dev/verity/issues/1722)): EVMYulLean (NethermindEth) provides formally-defined Yul AST types and UInt256 operations. Current integration status:
Expand All @@ -191,6 +191,7 @@ Execution priorities:
- Unbridged: none; `mappingSlot` is bridged via the shared keccak-faithful `abstractMappingSlot` derivation
- Phase 2 state bridge scaffolding: type conversions, storage round-trip, env field bridges (0 sorry)
- **Phase 4 (safe-body EndToEnd retarget)**: `EvmYulLeanRetarget.lean` proves `backends_agree_on_bridged_builtins` and `evalYulExpr_evmYulLean_eq_on_bridged`, establishing that `.verity` and `.evmYulLean` agree for `BridgedExpr` expressions built from bridged builtin calls plus backend-independent `tload`/`mload`. It also defines `execYulFuelWithBackend`, proves `execYulFuelWithBackend_verity_eq`, proves straight-line/block/if/switch/for statement-fragment helpers, proves `execYulFuelWithBackend_eq_on_bridged_target` for recursive `BridgedTarget` values, proves `emitYul_runtimeCode_bridged`, proves `emitYul_runtimeCode_evmYulLean_eq_on_bridged_bodies`, and proves `yulCodegen_preserves_semantics_evmYulLean`: the existing Layer-3 IR→Yul preservation theorem retargeted to `interpretYulRuntimeWithBackend .evmYulLean` under bridged-body hypotheses. `EndToEnd.lean` now exposes `layers2_3_ir_matches_yul_evmYulLean` over that EVMYulLean-backed target without raw external function-body `BridgedStmts` hypotheses, deriving them from `SupportedSpec`, static-parameter witnesses, and `BridgedSafeStmts` source-body witnesses. `EvmYulLeanBodyClosure.lean` proves universal `compileStmtList_always_bridged` coverage for `BridgedSafeStmts`; the external-call family remains carved out behind explicit function-table simulation work. `EvmYulLeanSourceExprClosure.lean` proves scalar leaf closure (`compileExpr_bridgedSource_leaf`) and pure arithmetic/comparison/bit-operation expression closure (`compileExpr_bridgedSource`) for the `BridgedSourceExpr` fragment. Trust boundary shifts for bridged expressions, recursive bridged statement targets, Layer-3 contract executions, and the safe-body EndToEnd wrapper with fully proven builtin dependencies.
- **Native runtime follow-up (#1737)**: the public theorem target still routes through the backend-parameterized Verity Yul interpreter. `EvmYulLeanNativeHarness.lean` provides the executable native path through `EvmYul.Yul.callDispatcher`, and `docs/NATIVE_EVMYULLEAN_TRANSITION.md` tracks the remaining state/result bridge lemmas and theorem flip needed to remove the custom interpreter from the public semantic target.
- **Remaining to make retargeting whole-program**: extend `BridgedSafeStmts` or add a separate function-table simulation for the external-call family (`internalCall`, `internalCallAssign`, `externalCallBind`, and `ecm`)

**EVM Semantics**: Mitigated by differential testing against actual EVM execution (Foundry). Likely remains a documented fundamental assumption.
Expand Down
5 changes: 4 additions & 1 deletion docs/VERIFICATION_STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,13 @@ The retargeting module [`EvmYulLeanRetarget.lean`](../Compiler/Proofs/YulGenerat

The backend-parameterized executor now has a proved `.verity = .evmYulLean` theorem for recursive statement targets constrained by `BridgedTarget`, the generated runtime wrapper is proved to preserve that predicate and to execute equivalently under explicit body-closure hypotheses, Layer 3 now has a contract-level theorem whose Yul side is `interpretYulRuntimeWithBackend .evmYulLean`, and the public EndToEnd module exposes a safe-body wrapper over that target. Body closure now has a universal safe-body aggregation theorem for `BridgedSafeStmts`, and the public EndToEnd theorem uses that closure to discharge raw `BridgedStmts` body hypotheses for supported compiler-produced contracts while keeping the external-call/function-table family carved out where needed.

Trust boundary (safe-body EndToEnd target): `BridgedExpr` expressions, `BridgedStraightStmts` statement lists, recursively nested `BridgedTarget` executions, source statement lists admitted by `BridgedSafeStmts`, emitted runtime wrappers whose embedded bodies are bridged, and public EndToEnd wrappers deriving those body bridges from source-level safe-body/static-param witnesses now inherit EVMYulLean semantics with fully proven builtin bridge dependencies — "EVMYulLean's execution model matches the EVM" (backed by upstream Ethereum conformance tests) — rather than "Verity's custom builtin implementations are correct."
Native-runtime transition status: the current theorem target is still the backend-parameterized Verity statement interpreter. The executable native EVMYulLean path lives in [`EvmYulLeanNativeHarness.lean`](../Compiler/Proofs/YulGeneration/Backends/EvmYulLeanNativeHarness.lean), and the remaining theorem-transition plan is tracked in [`NATIVE_EVMYULLEAN_TRANSITION.md`](NATIVE_EVMYULLEAN_TRANSITION.md).

Trust boundary (safe-body EndToEnd target): `BridgedExpr` expressions, `BridgedStraightStmts` statement lists, recursively nested `BridgedTarget` executions, source statement lists admitted by `BridgedSafeStmts`, emitted runtime wrappers whose embedded bodies are bridged, and public EndToEnd wrappers deriving those body bridges from source-level safe-body/static-param witnesses now inherit EVMYulLean builtin semantics with fully proven bridge dependencies. The stronger claim that native `EvmYul.Yul.callDispatcher` is the public semantic target remains pending until the native theorem path replaces `execYulFuelWithBackend`.

Not yet proven in this module:
- external-call/function-table body closure beyond the current `BridgedSafeStmts` whitelist
- native `EvmYul.Yul.callDispatcher` preservation for emitted runtime Yul

Remaining gaps for whole-program retargeting:
- 0 sorry-backed core equivalences
Expand Down
Loading