-
Notifications
You must be signed in to change notification settings - Fork 4
proofs: expose native EVMYulLean transition target #1743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Th0rgal
wants to merge
162
commits into
main
Choose a base branch
from
codex/native-evmyullean-transition
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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 cdadf59
docs: clarify verity helper calls
claude 1640081
proofs: track native transition blockers
claude ebbd280
proofs: harden native runtime smoke coverage
claude 747ba1b
proofs: document native env defaults
claude 3ecef1d
proofs: pin native dispatch selector cases
claude d163384
proofs: pin native dispatch case bodies
claude 0be3e6c
proofs: pin native calldata bridge bytes
claude 14040ca
proofs: pin native dispatcher selector expression
claude 4d91760
docs: clarify native dispatcher execution blocker
claude 0b516fc
proofs: pin native error rollback projection
claude 4d28241
proofs: require native observable slots
claude e059708
proofs: pin native observable sload
claude 8a5a25d
proofs: cover native IR entrypoint
claude 01fad08
proofs: cover native log projection arities
claude 3a9451c
proofs: cover native transient storage
claude ef27bda
proofs: cover native stop halt projection
claude b0d0a87
proofs: cover native value result projection
claude 17c20a2
proofs: cover native return halt projection
claude 616e39d
proofs: pin native halt builtin lowering
claude 93f1b09
proofs: cover native ok storage projection
claude 6e4bb81
proofs: pin native final mapping projection
claude 6846a98
proofs: pin native helper call partition
claude d846ae2
proofs: pin native initial state bridge
claude 8949e7b
proofs: pin native nested helper rejection
claude 8b431c8
proofs: pin native hard error rollback
claude 14103b9
proofs: pin native return dispatch lowering
claude 4d5013f
proofs: pin native explicit storage slots
claude 41ad1ff
proofs: pin native revert rollback
claude 38cc57b
proofs: pin native IR slot forwarding
claude c6cf8f0
proofs: pin native transaction environment
claude 3a36713
proofs: name native bridge invariants
claude 0633d53
chore: auto-refresh derived artifacts
github-actions[bot] 1b303a7
proofs: name native projection outcomes
claude ed9ce9f
chore: auto-refresh derived artifacts
github-actions[bot] a91031c
proofs: name native initial state invariants
claude f00b839
chore: auto-refresh derived artifacts
github-actions[bot] 01738dd
proofs: name native storage seeding invariant
claude 4569161
chore: auto-refresh derived artifacts
github-actions[bot] ebae796
proofs: name native execution pipeline invariant
claude 8d70342
chore: auto-refresh derived artifacts
github-actions[bot] ac1e113
proofs: name native IR execution pipeline invariant
claude 8b5128e
chore: auto-refresh derived artifacts
github-actions[bot] 3247230
proofs: name native account installation invariant
claude 527fd06
chore: auto-refresh derived artifacts
github-actions[bot] d36804d
proofs: name native environment defaults invariant
claude 4d44138
chore: auto-refresh derived artifacts
github-actions[bot] 661f8e7
proofs: name native calldata size invariant
claude 7e34efb
chore: auto-refresh derived artifacts
github-actions[bot] f779f37
proofs: name native halt projection invariants
claude ae5bb73
chore: auto-refresh derived artifacts
github-actions[bot] 116f924
proofs: name native event projection invariants
claude 79677ed
chore: auto-refresh derived artifacts
github-actions[bot] 6b268a7
proofs: name omitted native storage invariant
claude f5d763e
proofs: name native finalMappings invariant
claude 120e053
proofs: name native final storage invariants
claude b5e39b9
proofs: name native result observable invariants
claude 08601d4
proofs: name missing native account storage invariant
claude cba4038
proofs: name native missing slot result invariants
claude 193e6d6
proofs: name native final mapping invariants
claude e76a912
proofs: name native non-word return fallback
claude 7f41306
proofs: name native call lowering invariants
claude e132814
proofs: name native environment bridge fields
claude 71fe730
scripts: recognize partial defs in proof length check
claude 985d7d5
scripts: test partial defs terminate proof spans
claude f10f5fd
ci: include native harness in evmyullean probe
claude 92092ed
proofs: compare native env smoke with oracle
claude cb41fda
ci: guard native transition doc status
claude 2799bb3
ci: guard native observable slot caveat
claude 373790b
ci: guard native observable slot api
claude 20e7b90
contracts: close evmyullean transition blockers
claude f85598c
contracts: harden overload and env accessors
claude 30d108d
contracts: add migration parity surfaces
claude e01b323
contracts: remove legacy internal call surface
claude ef46e5b
contracts: fix overload review regressions
claude 647f2f3
contracts: memoize tuple array element index
claude a9ec28c
contracts: fail closed on ambiguous overload lookup
claude c06ab65
compiler: recurse trust surface through array element words
claude ea21ba6
compiler: reject internal external name collisions
claude 909125f
proofs: cover native selector bytes and new source cases
claude 0724aad
contracts: close tuple array element review gaps
claude 04e2186
proofs: add native dispatch oracle
claude 2094769
contracts: harden overload generated names
claude 57ccf1f
proofs: cover memory return native oracle
claude aae4b46
compiler: document selector-keyed overload dispatch
claude 1b32fd5
proofs: cover native calldata argument oracle
claude cd0ea42
evmyullean: lower native dispatch lazily
claude 82b7a89
proofs: cover native mapping oracle shapes
claude d3305cb
evmyullean: scope lazy native dispatch
claude 8ff72e6
proofs: cover native packed mapping oracle
claude a823227
evmyullean: thread native switch ids
claude 2f1f16a
macro: accept qualified blobbasefee
claude dba993a
evmyullean: guard native switch fallthrough
claude bdaa1a9
ci: guard native theorem transition target
claude 6ffd034
ci: pin unbridged native env boundary
claude d595759
evmyullean: remove dead native stmt wrapper
claude e484cb8
compilation: split array element helper gates
claude 2e40dd4
macro: reject ABI-erased newtype overloads
claude f6d9c68
proofs: expose native runtime preservation seam
claude 06eed0e
evmyullean: validate native environment reads
claude 1155569
evmyullean: freshen native switch temps
claude f1b975a
evmyullean: reserve function switch temps
claude 1b366a0
proofs: align native bridge observables
claude 7d96db1
evmyullean: validate native env on selected path
claude b1a4551
compiler: restrict plain arrayElement to word arrays
claude f037645
compiler: share array element usage traversal
claude 9511f9d
proofs: add native bridge intro theorem
claude f6cee4b
proofs: expose lowered native dispatcher bridge
claude 96e5f23
compiler: preserve shadowed context accessors
claude 2c5e3bc
compiler: include package roots for module imports
claude 08db836
compiler: simplify array element usage detection
claude 9b34373
tests: cover context accessor shadow smoke
claude ceb10ec
proofs: expose native runtime lowering equations
claude ac78d5a
evmyullean: normalize native dispatch selector
claude 5e3e487
macro: track tuple array return temp
claude 36a92a9
evmyullean: expose statement native lowering equations
claude fbf26e9
macro: resolve declared context-name shadows
claude febf07f
proofs: expose native dispatcher block bridge
claude edd96ef
proofs: target lowered dispatcher block
claude 728b822
proofs: expose raw native dispatcher exec
claude 80d6396
proofs: narrow native dispatcher agreement
claude 98b8ed7
compiler: allow namespaced internal helper names
claude 9c340b9
proofs: expose native selector evaluation
claude 8cbd225
compiler: lower storage words in typed ir
claude 33aa242
proofs: expose native selector recomposition
claude 31d0c27
proofs: reduce native selector byte decoding
claude f101a02
semantics: execute setStorageWord in source model
claude e7ea5ea
proofs: reduce native selector read bridge
claude 7ece6e6
proofs: prove native selector evaluation
claude f93cb23
runtime: mirror packed address word writes
claude b5f384e
proofs: expose native switch guard execution
claude 0b853a8
semantics: mirror raw storage word writes
claude ade837d
compiler: scan nested array helper usage
claude f478d28
proofs: expose native switch selected case
claude 6763a5b
compiler: scope duplicate signatures to dispatch
claude 7ca5e75
proofs: skip matched native switch cases
claude d1562ac
runtime: ignore user functions in native builtin scan
claude 97d7abe
compiler: clarify array element word offsets
claude e67f6b0
proofs: package marked native switch case
claude 0d6e127
ci: register packed address macro smoke
claude 12e4432
ci: sync evmyullean fork audit pin
claude fdba4d3
proofs: package native switch prefix
claude 79024ee
compiler: wrap storage word slots
claude be21bb8
proofs: package native switch freshness
claude 9580577
proofs: package native switch default guard
claude bc262bb
proofs: package native switch case miss
claude 194ef58
proofs: generalize native switch guard fuel
claude 6355ddc
proofs: prove native switch case chains
claude 9856714
proofs: package native switch defaults
claude 19edb78
macro: erase ADTs in ABI overload keys
claude 07b3ac0
proofs: bridge native switch selector lookup
claude c61a0a8
checks: address native transition review findings
claude 11b2cae
proofs: factor native switch body preservation
claude ef96d23
typed-ir: reject ambiguous signature lookup
claude e947d8b
proofs: compose native switch defaults
claude 234807f
proofs: preserve native switch case lookup
claude a30d023
proofs: parameterize native switch prefix
claude 0e8efb2
proofs: expose native switch block parts
claude 4698356
proofs: bridge raw native switch blocks
claude f363b2b
proofs: trim native switch proof guard
claude b1e3aa0
native: reject unbridged header builtins
claude 070a5f8
proofs: package native assignment preservation
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.