Skip to content

[WIP] progress on rewrite lifting#866

Draft
math-fehr wants to merge 9 commits into
mainfrom
math-fehr/wip-lifting-list
Draft

[WIP] progress on rewrite lifting#866
math-fehr wants to merge 9 commits into
mainfrom
math-fehr/wip-lifting-list

Conversation

@math-fehr

Copy link
Copy Markdown
Collaborator

This is the current status of proving the lifting between the soundness of local rewrites to module refinements

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VeIR Benchmarks

Details
Benchmark suite Current: 4e366e3 Previous: 0a419ad Ratio
add-fold-worklist/create 2216000 ns (± 78411) 1861000 ns (± 20477) 1.19
add-fold-worklist/rewrite 4007000 ns (± 140371) 3548000 ns (± 63797) 1.13
add-fold-worklist-local/create 2230000 ns (± 80769) 1843000 ns (± 89949) 1.21
add-fold-worklist-local/rewrite 3368000 ns (± 70351) 2961000 ns (± 45175) 1.14
add-zero-worklist/create 2184000 ns (± 58024) 1841000 ns (± 89735) 1.19
add-zero-worklist/rewrite 2509000 ns (± 81199) 2267000 ns (± 54123) 1.11
add-zero-reuse-worklist/create 1908000 ns (± 19892) 1541000 ns (± 54738) 1.24
add-zero-reuse-worklist/rewrite 2059000 ns (± 69723) 1837000 ns (± 21984) 1.12
mul-two-worklist/create 2201000 ns (± 54710) 1855500 ns (± 94365) 1.19
mul-two-worklist/rewrite 5505000 ns (± 132935) 4959500 ns (± 109268) 1.11
add-fold-forwards/create 2159000 ns (± 87332) 1835000 ns (± 16802) 1.18
add-fold-forwards/rewrite 2977000 ns (± 26599) 2689000 ns (± 45409) 1.11
add-zero-forwards/create 2208000 ns (± 98075) 1838000 ns (± 37930) 1.20
add-zero-forwards/rewrite 1982000 ns (± 51696) 1754000 ns (± 29132) 1.13
add-zero-reuse-forwards/create 1885000 ns (± 53021) 1516000 ns (± 62208) 1.24
add-zero-reuse-forwards/rewrite 1546000 ns (± 60748) 1385000 ns (± 51251) 1.12
mul-two-forwards/create 2114000 ns (± 77899) 1837000 ns (± 92575) 1.15
mul-two-forwards/rewrite 3635000 ns (± 65846) 3218000 ns (± 80363) 1.13
add-zero-reuse-first/create 1831500 ns (± 70179) 1508500 ns (± 50912) 1.21
add-zero-reuse-first/rewrite 8000 ns (± 1647) 9000 ns (± 1907) 0.89
add-zero-lots-of-reuse-first/create 1759000 ns (± 41554) 1506000 ns (± 20603) 1.17
add-zero-lots-of-reuse-first/rewrite 763000 ns (± 17254) 746000 ns (± 13957) 1.02

This comment was automatically generated by workflow using github-action-benchmark.

@math-fehr math-fehr force-pushed the math-fehr/wip-lifting-list branch 27 times, most recently from 4f268f3 to cfce77f Compare June 19, 2026 02:28
These lemmas are similar to the ones about `setResultValues` in that they show preservation of `EquationLemmaAt` and `DefinesDominating`.

These required additional simple lemmas, and additional axioms about dominance.
@math-fehr math-fehr force-pushed the math-fehr/wip-lifting-list branch from cfce77f to 4b27368 Compare June 20, 2026 01:11
@math-fehr math-fehr force-pushed the math-fehr/wip-lifting-list branch from 4b27368 to 3bdb34f Compare June 21, 2026 15:05
math-fehr and others added 5 commits June 21, 2026 17:41
…lockIn')

Add RewrittenAt.of_fromLocalRewrite connecting the concrete LocalRewritePattern
driver to the abstract RewrittenAt relation. Proves the keystone reduction
(driver's worklist-threaded forIn loops reduce to a pure WfRewriter foldlM),
the operationList split helper, a generic foldlM invariant-transport lemma, the
insertOp/replaceValue/eraseOp ctx bridges, and the blockIn'/srcList/newValuesSize/
opNotFunction fields. Remaining RewrittenAt fields are scoped sorries.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ds fields

Add WithCreatedOps + eraseOp survival helpers (hSurviveOp/Block/Region) and use
them to discharge the bounds-preservation fields of RewrittenAt.of_fromLocalRewrite.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add hOpBnd (bidirectional non-op bounds across the rewrite) to transport ReturnOps
freshness; mappingFixesNonResults is the else-branch of rewriteMapping.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add hSurviveVal (value survival across folds + eraseOp when the value's owner is
not op) and discharge mapNonResultsInBounds via getResults! membership.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mark which fields need an extra pattern hypothesis (newValuesInBounds,
mapResultsInBounds, newValuesAreResults, newCtxDom, newCtxVerif) vs deep
operationList/GetSet plumbing through the foldlM (tgtList, otherBlocks, frame,
parentOps, blockArgsPreserved, opRegionsPreserved, regionFirstBlockPreserved).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant