Skip to content

feat: compiled tactic configuration elaborators, and configurability#13426

Draft
kmill wants to merge 18 commits into
masterfrom
kmill_tactic_config_compile
Draft

feat: compiled tactic configuration elaborators, and configurability#13426
kmill wants to merge 18 commits into
masterfrom
kmill_tactic_config_compile

Conversation

@kmill
Copy link
Copy Markdown
Collaborator

@kmill kmill commented Apr 16, 2026

This PR changes the way tactic configurations work so that they are compiled ahead of time, rather than relying on elaboration and compilation at tactic run time, improving performance. It also introduces some configurability for the generated configuration elaborators. For example, it's now possible to create custom tactic option interpreters. This will be used by simp to support user-defined options like simp +user.mySimprocOption.

@kmill kmill added the changelog-language Language features and metaprograms label Apr 16, 2026
@github-actions github-actions Bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Apr 16, 2026
@leanprover-bot
Copy link
Copy Markdown
Collaborator

leanprover-bot commented Apr 16, 2026

Reference manual CI status:

  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2026-04-13 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-manual, reference manual CI should run now. You can force reference manual CI using the force-manual-ci label. (2026-04-16 01:43:12)
  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2026-05-03 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-manual, reference manual CI should run now. You can force reference manual CI using the force-manual-ci label. (2026-05-05 18:56:25)

mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Apr 16, 2026
@github-actions github-actions Bot added the mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN label Apr 16, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Apr 16, 2026
@mathlib-lean-pr-testing mathlib-lean-pr-testing Bot added the breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan label Apr 16, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

mathlib-lean-pr-testing Bot commented Apr 16, 2026

Mathlib CI status (docs):

mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Apr 16, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Apr 16, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Apr 16, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Apr 16, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Apr 16, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Apr 16, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

@kmill
Copy link
Copy Markdown
Collaborator Author

kmill commented Apr 16, 2026

!bench

@leanprover-radar
Copy link
Copy Markdown

leanprover-radar commented Apr 16, 2026

Benchmark results for fdb1411 against d76e5a1 are in. There are significant results. @kmill

  • build//instructions: -8.2G (-0.07%)

Large changes (3✅, 9🟥)

  • 🟥 build/module/Lean.Elab.Tactic.Grind.Main//instructions: +6.5G (+41.12%)
  • 🟥 build/module/Lean.Elab.Tactic.NormCast//instructions: +5.4G (+55.49%)
  • 🟥 build/module/Lean.Elab.Tactic.Simp//instructions: +5.8G (+38.16%)
  • elab/mut_rec_wf//instructions: -2.8G (-10.32%)
  • elab/mut_rec_wf//task-clock: -299ms (-13.32%)
  • elab/mut_rec_wf//wall-clock: -295ms (-14.42%)
  • 🟥 size/all/.c//lines: +189.6k (+1.72%)
  • 🟥 size/all/.ir//bytes: +5MiB (+1.50%)
  • 🟥 size/all/.olean.private//bytes: +10MiB (+0.85%)
  • 🟥 size/compile/.out//bytes: +33MiB (+1.91%)
  • 🟥 size/install//bytes: +24MiB (+0.95%)
  • 🟥 size/libleanshared.so//bytes: +2MiB (+1.58%)

Medium changes (7✅, 10🟥)

  • build/module/Init.Data.Array.Basic//instructions: -1.7G (-12.45%) (reduced significance based on absolute threshold)
  • build/module/Lean.Elab.MutualInductive//instructions: -1.1G (-2.99%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Lean.Elab.Tactic.BVDecide.Frontend.Attr//instructions: +2.7G (+109.32%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Lean.Elab.Tactic.Decide//instructions: +1.1G (+23.17%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Lean.Elab.Tactic.Do.VCGen.Basic//instructions: +1.2G (+12.91%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Lean.Elab.Tactic.Grind.Config//instructions: +1.7G (+23.60%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Lean.Elab.Tactic.Lets//instructions: +2.8G (+80.37%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Lean.Elab.Tactic.LibrarySearch//instructions: +1.0G (+24.09%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Lean.Elab.Tactic.Omega.Frontend//instructions: +1.2G (+3.26%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Lean.Elab.Tactic.Rewrite//instructions: +1.5G (+38.36%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Lean.Elab.Tactic.SolveByElim//instructions: +3.8G (+86.22%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Lean.Elab.Tactic.Try//instructions: +1.3G (+4.20%) (reduced significance based on absolute threshold)
  • build/module/Lean.Meta.Sym.Pattern//instructions: -1.8G (-7.30%) (reduced significance based on absolute threshold)
  • build/module/Std.Data.DTreeMap.Internal.Queries//instructions: -1.2G (-5.84%) (reduced significance based on absolute threshold)
  • build/module/Std.Tactic.BVDecide.Bitblast.BVExpr.Circuit.Impl.Expr//instructions: -2.0G (-2.96%) (reduced significance based on absolute threshold)
  • build/module/Std.Tactic.BVDecide.Bitblast.BVExpr.Circuit.Impl.Operations.Mul//instructions: -1.2G (-5.22%) (reduced significance based on absolute threshold)
  • build/module/Std.Tactic.BVDecide.Bitblast.BVExpr.Circuit.Lemmas.Expr//instructions: -4.1G (-3.75%) (reduced significance based on absolute threshold)

Small changes (223✅, 12🟥)

Too many entries to display here. View the full report on radar instead.

@kmill kmill force-pushed the kmill_tactic_config_compile branch from fdb1411 to cb42f8a Compare May 5, 2026 17:50
@github-actions github-actions Bot added the changes-stage0 Contains stage0 changes, merge manually using rebase label May 5, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request May 5, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan changelog-language Language features and metaprograms changes-stage0 Contains stage0 changes, merge manually using rebase mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants