leanprover-community / leanprover-community/mathlib4
linter.countHeartbeats is broken
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 4.1k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
linter.countHeartbeats seems to be currently broken. There was a discussion about the idea of counting heartbeats for every declaration in a file [here](#mathlib4 > count_heartbeats for all declarations in a file? @ 💬) and this prompted the addition of the linter in #20421 . But it seems to me that currently (v4.19.0-rc2) if you try it on any mathlib file, it just reports that all declarations take exactly the same number of heartbeats. See also https://github.com/leanprover-community/mathlib4/pull/21182 .
To reproduce: open a random file in mathlib (e.g. Mathlib/Algebra/Order/Field/Basic.lean), type set_option linter.countHeartbeats true or #count_heartbeats at the top of the file, and observe that every single declaration in the file is now reported as using the same number of heartbeats.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the report in Mathlib/Algebra/Order/Field/Basic.lean using set_option linter.countHeartbeats true or #count_heartbeats. Start from the linter.countHeartbeats entry point and compare the reported values with the behavior described in the linked discussions and pull requests; done means declarations no longer all report the same heartbeat count.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100