Skip to content

fix: prevent a hang in acLt#13367

Open
eric-wieser wants to merge 1 commit intoleanprover:masterfrom
eric-wieser:eric-wieser/aclt
Open

fix: prevent a hang in acLt#13367
eric-wieser wants to merge 1 commit intoleanprover:masterfrom
eric-wieser:eric-wieser/aclt

Conversation

@eric-wieser
Copy link
Copy Markdown
Contributor

@eric-wieser eric-wieser commented Apr 10, 2026

This PR removes some cases where simp would significantly overrun a timeout.

This is a little tricky to test cleanly; using mathlib's #count_heartbeats as

#count_heartbeats in
set_option maxHeartbeats 200000 in
example (k : Nat) (a : Fin (1 + k + 1) → Nat) :
    0 ≤ sumRange (1 + k + 1) (fun i =>
        if h : i < 1 + k + 1 then a ⟨i, h⟩ else 0) := by
  simp only [Nat.add_comm, sumRange_add]

I see 200010 heartbeats with this PR, and 1873870 (9x the requested limit) without.

This type of failure is wasteful in AI systems which try tactics with a short timeout.

@eric-wieser
Copy link
Copy Markdown
Contributor Author

changelog-language

@github-actions github-actions bot added the changelog-language Language features and metaprograms label Apr 10, 2026
@Rob23oba
Copy link
Copy Markdown
Contributor

!bench

@leanprover-radar
Copy link
Copy Markdown

leanprover-radar commented Apr 10, 2026

Benchmark results for d5cf7d7 against d53b46a are in. There are no significant changes. @Rob23oba

  • 🟥 build//instructions: +3.5G (+0.03%)

Medium changes (2🟥)

  • 🟥 build/module/Init.Data.Nat.Linear//instructions: +2.8G (+5.09%)
  • 🟥 build/module/Init.Data.Nat.SOM//instructions: +1.3G (+6.77%)

Small changes (2🟥)

  • 🟥 build/module/Init.Grind.AC//instructions: +178.8M (+1.68%)
  • 🟥 build/module/Lean.Meta.ACLt//instructions: +17.3M (+0.84%)

@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 10, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase d53b46a0f3a7d0822550f4179ca3dab446a3c448 --onto e0a29f43d2e4685febd0ed6bcfad511f7a235b6f. You can force Mathlib CI using the force-mathlib-ci label. (2026-04-10 19:26:16)

@leanprover-bot
Copy link
Copy Markdown
Collaborator

leanprover-bot commented Apr 10, 2026

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase d53b46a0f3a7d0822550f4179ca3dab446a3c448 --onto 861bc19e0c1c45b5766cc5c9ef0488568368b236. You can force reference manual CI using the force-manual-ci label. (2026-04-10 19:26:18)
  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2026-04-10 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-10 21:51:02)

This PR removes some cases where `simp` would hang instead of reporting a timeout
mathlib-nightly-testing bot pushed a commit to leanprover-community/batteries that referenced this pull request Apr 10, 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 10, 2026
mathlib-nightly-testing bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Apr 10, 2026
@mathlib-lean-pr-testing mathlib-lean-pr-testing bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Apr 10, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

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-language Language features and metaprograms 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.

4 participants