Skip to content

perf: deduplicate core computation inside mkCongrSimpForConst? #9300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kha
Copy link
Member

@Kha Kha commented Jul 10, 2025

No description provided.

@Kha Kha force-pushed the push-nzlortxnlrwo branch from 25638e8 to 2c631f7 Compare July 10, 2025 15:12
github-merge-queue bot pushed a commit that referenced this pull request Jul 11, 2025
This PR uses the `mkCongrSimpForConst?` API in `simp` to reduce the
number of times the same congruence lemma is generated. Before this PR,
`grind` would spend `1.5`s creating congruence theorems during
normalization in the `grind_bitvec2.lean` benchmark. It now spends
`0.6`s. This PR should make an even bigger difference after we merge
#9300.
@Kha Kha force-pushed the push-nzlortxnlrwo branch from 2c631f7 to 86fc2aa Compare July 11, 2025 14:54
@Kha
Copy link
Member Author

Kha commented Jul 11, 2025

!bench

@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 Jul 11, 2025
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Jul 11, 2025

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 5778a3c0f2dbe17fdac88902478362d66c43fd61 --onto 18a82c04fc59d3dba392308e09d65ee431240d89. You can force Mathlib CI using the force-mathlib-ci label. (2025-07-11 15:21:52)
    Forcing Mathlib CI because the force-mathlib-ci label is present, despite problem: - ❗ Batteries CI can not be attempted yet, as the nightly-testing-2025-07-15 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Batteries CI should run now. (2025-07-15 09:40:23)
    Forcing Mathlib CI because the force-mathlib-ci label is present, despite problem: - ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 9328271dd0e3710fcc7224db4eddaa79d2b9c8fc --onto cdab726e3d289b80860ae9f5a7de21d990c8b95f. (2025-07-23 16:33:37)

@leanprover-bot
Copy link
Collaborator

leanprover-bot commented Jul 11, 2025

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 5778a3c0f2dbe17fdac88902478362d66c43fd61 --onto d3dda9f6d4428a906c096067ecb75e432afc4615. You can force reference manual CI using the force-manual-ci label. (2025-07-11 15:21:53)
  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2025-07-15 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. (2025-07-15 09:40:24)
  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 9328271dd0e3710fcc7224db4eddaa79d2b9c8fc --onto d3dda9f6d4428a906c096067ecb75e432afc4615. You can force reference manual CI using the force-manual-ci label. (2025-07-23 16:33:38)
  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2025-07-23 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. (2025-07-24 12:08:38)

@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit 86fc2aa.
There were significant changes against commit 5778a3c:

  Benchmark                   Metric                  Change
  =====================================================================
- bv_decide_inequality.lean   maxrss                    1.9% (1429.6 σ)
- bv_decide_mod               task-clock                6.9%   (71.8 σ)
- bv_decide_mod               wall-clock                6.8%  (120.9 σ)
+ stdlib                      attribute application    -1.3%  (-36.9 σ)
- treemap.lean                iterate                   4.3%

@Kha
Copy link
Member Author

Kha commented Jul 15, 2025

!bench

@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit ed5380a.
There were significant changes against commit aac501a:

  Benchmark                   Metric       Change
  ==========================================================
+ bv_decide_inequality.lean   maxrss        -1.5%  (-33.2 σ)
- bv_decide_mod               task-clock     3.0%   (20.3 σ)
- bv_decide_mod               wall-clock     2.9%   (22.1 σ)
- hashmap.lean                iterate        3.5%
- hashmap.lean                task-clock     6.4%   (47.4 σ)
- hashmap.lean                wall-clock     6.4%   (51.7 σ)
- stdlib                      grind          1.7% (1579.0 σ)

@Kha Kha added the awaiting-mathlib We should not merge this until we have a successful Mathlib build label Jul 15, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jul 15, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Jul 15, 2025
@leanprover-community-bot leanprover-community-bot added the breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan label Jul 15, 2025
@leanprover-community-bot
Copy link
Collaborator

@Kha Kha force-pushed the push-nzlortxnlrwo branch from ed5380a to 123357a Compare July 23, 2025 15:51
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jul 23, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Jul 23, 2025
@leanprover-community-bot
Copy link
Collaborator

@Kha Kha force-pushed the push-nzlortxnlrwo branch from 123357a to 9c4713c Compare July 24, 2025 11:26
@Kha
Copy link
Member Author

Kha commented Jul 24, 2025

!bench

leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jul 24, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Jul 24, 2025
@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit 9c4713c.
There were significant changes against commit 4cbfa48:

  Benchmark                  Metric          Change
  ============================================================
- bv_decide_mod              task-clock        2.4%   (29.9 σ)
- bv_decide_mod              wall-clock        2.3% (1330.5 σ)
- channel.lean               bounded0_spsc    18.3%   (54.3 σ)
+ channel.lean               unbounded_seq    -1.7%
- liasolver                  task-clock        2.8%   (28.3 σ)
- liasolver                  wall-clock        2.8%   (27.2 σ)
+ parser                     task-clock       -7.4%  (-34.8 σ)
+ parser                     wall-clock       -7.4%  (-34.4 σ)
+ stdlib                     grind ring       -3.8%  (-29.2 σ)
- tests/bench/ interpreted   wall-clock        1.9%   (42.0 σ)

@leanprover-community-bot
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-mathlib We should not merge this until we have a successful Mathlib build breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan force-mathlib-ci 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