Skip to content

Keep tactic modules out of the executable's import closure - #45

Merged
chriseth merged 1 commit into
powdr-labs:mainfrom
chris-ai1:tactic-free-executable
Aug 5, 2026
Merged

Keep tactic modules out of the executable's import closure#45
chriseth merged 1 commit into
powdr-labs:mainfrom
chris-ai1:tactic-free-executable

Conversation

@chris-ai1

Copy link
Copy Markdown
Contributor

The exe was still 114M because two library modules imported tactic modules, and a module's initialize_* transitively references the initializers of everything it imports — so Std.Tactic.BVDecide (Basic.lean) and Batteries.Tactic.Lint (Dialect.lean) linked the entire elaborator (libLean, plus libStd/libLake) into every downstream binary, even though tactics only ever run at proof-checking time.

  • Basic.lean: drop import Std.Tactic.BVDecide and the one bv_decide sanity example that used it.
  • Dialect.lean / Dialect/EVMExec.lean: drop import Batteries.Tactic.Lint; replace the two derived Repr instances whose unused prec argument needed @[nolint unusedArguments] with handwritten instances that don't trip the linter.

Batteries remains a package dependency solely as the lake lint driver; no library module imports it anymore.

The placeholder executable drops from 114M to 4.3M (2.8M stripped), with zero Lean.Elab symbols left in the binary. lake build, lake lint, and lake build yul-semantics all pass; the exe runs.

The exe was still 114M because two library modules imported *tactic*
modules, and a module's `initialize_*` transitively references the
initializers of everything it imports — so `Std.Tactic.BVDecide`
(Basic.lean) and `Batteries.Tactic.Lint` (Dialect.lean) linked the
entire elaborator (libLean, plus libStd/libLake) into every downstream
binary, even though tactics only ever run at proof-checking time.

* Basic.lean: drop `import Std.Tactic.BVDecide` and the one `bv_decide`
  sanity example that used it.
* Dialect.lean / Dialect/EVMExec.lean: drop `import
  Batteries.Tactic.Lint`; replace the two derived `Repr` instances whose
  unused `prec` argument needed `@[nolint unusedArguments]` with
  handwritten instances that don't trip the linter.

Batteries remains a package dependency solely as the `lake lint` driver;
no library module imports it anymore.

The placeholder executable drops from 114M to 4.3M (2.8M stripped), with
zero `Lean.Elab` symbols left in the binary. `lake build`, `lake lint`,
and `lake build yul-semantics` all pass; the exe runs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@chriseth
chriseth merged commit f19c9fc into powdr-labs:main Aug 5, 2026
1 check passed
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.

2 participants