Skip to content

perf: improve proof-over-applied cases in ToLCNF#12814

Open
Rob23oba wants to merge 2 commits intoleanprover:masterfrom
Rob23oba:new-cases-overapp
Open

perf: improve proof-over-applied cases in ToLCNF#12814
Rob23oba wants to merge 2 commits intoleanprover:masterfrom
Rob23oba:new-cases-overapp

Conversation

@Rob23oba
Copy link
Contributor

@Rob23oba Rob23oba commented Mar 5, 2026

This PR changes the handling of proof-over-applied cases expressions in ToLCNF to avoid generating function declarations that are called immediately. This is a less invasive version of #12284 (which has since been reverted) that only affects proof overapplications, not all overapplications. However, this is also the only case we really need for #8309 (and other occasions like match h : _).

@github-actions github-actions bot added the changelog-compiler Compiler, runtime, and FFI label Mar 5, 2026
@Rob23oba Rob23oba marked this pull request as ready for review March 5, 2026 16:06
@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 Mar 5, 2026
@leanprover-bot
Copy link
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2026-03-05 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-03-05 18:02:27)

mathlib-nightly-testing bot pushed a commit to leanprover-community/batteries that referenced this pull request Mar 5, 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 Mar 5, 2026
mathlib-nightly-testing bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Mar 5, 2026
@Rob23oba
Copy link
Contributor Author

Rob23oba commented Mar 5, 2026

!bench

@leanprover-radar
Copy link

leanprover-radar commented Mar 5, 2026

Benchmark results for b29fa21 against 333ab1c are in! @Rob23oba

  • build//instructions: -1.0G (-0.01%)

Small changes (7✅, 8🟥)

  • build/module/Lean.Compiler.LCNF.LambdaLifting//instructions: -32.0M (-0.77%)
  • 🟥 build/module/Lean.Compiler.LCNF.ToLCNF//instructions: +1.1G (+5.78%) (reduced significance based on *//lines)
  • 🟥 build/module/Lean.Elab.Do.InferControlInfo//instructions: +152.1M (+1.00%) (reduced significance based on absolute threshold)
  • build/module/Lean.Elab.Tactic.BVDecide.Frontend.BVDecide.Reify//instructions: -23.2M (-0.34%)
  • 🟥 build/module/Lean.Elab.Tactic.BVDecide.Frontend.Normalize.Simproc//instructions: +337.9M (+0.94%) (reduced significance based on absolute threshold)
  • build/module/Lean.Elab.Tactic.Do.ProofMode.Specialize//instructions: -24.4M (-0.45%)
  • 🟥 build/module/Lean.Elab.Tactic.Do.VCGen//instructions: +95.1M (+0.29%)
  • 🟥 build/module/Lean.Meta.CasesInfo//instructions: +25.8M (+1.57%)
  • build/module/Lean.Meta.LitValues//instructions: -36.7M (-0.88%)
  • 🟥 build/module/Lean.Meta.Tactic.Grind.Canon//instructions: +62.7M (+0.54%)
  • 🟥 build/module/Lean.Meta.Tactic.Grind.MarkNestedSubsingletons//instructions: +29.0M (+0.70%)
  • 🟥 build/module/Std.Do.SPred.Notation//instructions: +72.7M (+0.36%)
  • build/module/Std.Internal.Http.Data.Status//instructions: -55.0M (-0.79%)
  • elab/big_beq//instructions: -54.3M (-0.54%)
  • elab/big_beq_rec//instructions: -65.1M (-0.34%)

@mathlib-lean-pr-testing mathlib-lean-pr-testing bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Mar 5, 2026
@mathlib-lean-pr-testing
Copy link

Mathlib CI status (docs):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-mathlib CI has verified that Mathlib builds against this PR changelog-compiler Compiler, runtime, and FFI 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