Zulip Chat Archive
Stream: mathlib4
Topic: Weekly linting log
github mathlib4 bot (Oct 13 2025 at 05:57):
Mathlib's nightly-testing branch (a778305ec3a679802f7dcfa64e2b903d4679ee21) regression run completed.
Warnings: 6
Warning counts
Kevin Buzzard (Oct 13 2025 at 06:00):
What's the first warning?
Edward van de Meent (Oct 13 2025 at 16:38):
the warnings are:
'have ha₂ : ∀ x ∈ spectrum ℝ a, x ≠ 0 :=
by
rw [StarOrderedRing.isStrictlyPositive_iff_spectrum_pos (R := ℝ) a] at ha
grind; grind' can be replaced with 'grind'
and
'have ha₂ : ∀ x ∈ spectrum ℝ a, x ≠ 0 :=
by
rw [StarOrderedRing.isStrictlyPositive_iff_spectrum_pos (R := ℝ) a] at ha
grind; grind' can be replaced with 'grind'
Edward van de Meent (Oct 13 2025 at 16:39):
(dug through the logs)
Alex Meiburg (Oct 13 2025 at 16:40):
At https://github.com/leanprover-community/mathlib4-nightly-testing/blob/e7c30293bf22c84e003230699e8da7bd46c010ef/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/ExpLog.lean#L158, lines 142 and 158, the have := ... grind can be replaces with just a grind [log_smul] and grind [log_pow], it seems
Chris Henson (Oct 13 2025 at 16:55):
How is this linter intended to interact with <;>? Currently if you have a proof that does ... <;> have := ...; grind, each branch will lint individually. Is this intended? (I think it is fine to do this, just curious.)
Kim Morrison (Oct 14 2025 at 04:47):
Chris Henson said:
How is this linter intended to interact with
<;>? Currently if you have a proof that does... <;> have := ...; grind, each branch will lint individually. Is this intended? (I think it is fine to do this, just curious.)
This is relevant for the
'simp only [Set.mem_toFinset]; grind' can be replaced with 'grind'
table row above.
Kim Morrison (Oct 14 2025 at 04:50):
Besides this one, the others are cleaned up in #30528.
github mathlib4 bot (Oct 20 2025 at 05:40):
Mathlib's nightly-testing branch (9e574589c15b3b233d3223f1b35871a798cc2748) regression run completed.
Warnings: 2
Warning counts
github mathlib4 bot (Oct 27 2025 at 05:44):
Mathlib's nightly-testing branch (88d330e19d35d91b0e5b0f6415a6939d00648f20) regression run completed.
Warnings: 4
Warning counts
Kim Morrison (Oct 28 2025 at 05:08):
2nd and 4th done in #30992. The 3rd one is incorrect. The 1st was discussed above: it only applies in one branch of a <;>.
Anne Baanen (Oct 28 2025 at 10:10):
I wanted to extend #29964 (don't warn if a tactic under a try combinator fails) to fix the 1st one, but it is more subtle than that. We'd have to correlate the TacticInfo across <;> branches, which I don't immediately see how to do...
Anne Baanen (Oct 28 2025 at 10:12):
My suspicion is that the 3rd one has to do with an instance cache not being reset somewhere, but I don't have time to investigate this in detail.
Damiano Testa (Oct 28 2025 at 12:20):
I think that the unreachable tactic stores the ranges of the tactics and then removes the ranges whenever something is used. This means that if a tactic is "shared", it counts as used if it is used at least once.
Maybe this machinery could do something similar? I have not actually inspected carefully how it works, though, so maybe this is already happening/unhelpful.
Kim Morrison (Oct 29 2025 at 02:55):
It's one spurious report in a not-that-important linter, let's not sink time into this.
A much cheaper solution would be to remove the <;> and write out both branches!
Chris Henson (Oct 29 2025 at 04:03):
Kim Morrison said:
A much cheaper solution would be to remove the
<;>and write out both branches!
FWIW I enabled the mergeWithGrind linter for CSlib, taking this approach for <;> false positives. Same as here, I think it was one proof to change, but I actually appreciated it identifying a proof where only one branch needed extra theorems passed to grind. Arguably writing out the branches in extreme cases of this is better for readability (and potentially performance I'd guess).
Kim Morrison (Oct 29 2025 at 11:06):
Yeah, <;> where quite different things happen, that happen to be compressible into a single tactic call, has always seemed to me like the obfuscatory side of golfing.
github mathlib4 bot (Nov 10 2025 at 05:44):
Mathlib's nightly-testing branch (d6b7d986955032cac54ae3d348326c295d51adfd) regression run completed.
Warnings: 24
Warning counts
Kim Morrison (Nov 13 2025 at 06:29):
Mostly dealt with in #31578.
github mathlib4 bot (Nov 17 2025 at 05:46):
Mathlib's nightly-testing branch (6a739275610fda3b4c420565ec194b100d14b81b) regression run completed.
Warnings: 7
Warning counts
github mathlib4 bot (Nov 24 2025 at 05:45):
Mathlib's nightly-testing branch (5e87abc94ce4317581dbb90a82be193457516dbe) regression run completed.
Warnings: 10
Warning counts
github mathlib4 bot (Dec 01 2025 at 05:50):
Mathlib's nightly-testing branch (dc19f2a67ff55a2078ba23a4c1740a5eb0d50e41) regression run completed.
Warnings: 21
Warning counts
github mathlib4 bot (Dec 08 2025 at 05:44):
Mathlib's nightly-testing branch (b7d2fa97710d4c43ddee0c0dfb1b4595bbc767e5) regression run completed.
Warnings: 20
Warning counts
Kim Morrison (Dec 11 2025 at 03:35):
Mostly dealt with in #32713
github mathlib4 bot (Dec 15 2025 at 05:52):
Mathlib's nightly-testing branch (3ea6690c3470d61c7d4fd71e7efd6336a6d05ffd) regression run completed.
Warnings: 13
Warning counts
Kim Morrison (Dec 15 2025 at 09:37):
Mostly dealt with in #32893.
Chris Henson (Dec 15 2025 at 09:44):
Probably too messy to be worth detecting automatically, but do you know if any of these are the same proof requiring changes over time? When we were running this linter for every day in CSLib's nightly testing I recall seeing a bit of this.
Kim Morrison (Dec 15 2025 at 09:50):
I'm sorry, I don't understand what you mean by "the same proof requiring changes over time".
Chris Henson (Dec 15 2025 at 09:54):
I've had the experience that between different nightlies/releases this linter will suggest removing a line that later needs to be added back.
Kim Morrison (Dec 15 2025 at 10:03):
Interesting. I haven't seen that; if you see it again please let me know!
Violeta Hernández (Dec 15 2025 at 11:19):
How do you run this linter on another repository?
Chris Henson (Dec 15 2025 at 11:37):
The linter set is linter.weeklyLintSet, which currently just has linter.tacticAnalysis.mergeWithGrind. As I learned by experience, you don't want to set this by default for performance reasons, as it does make grind run in duplicate. For CSLib we set up something similar to Mathlib's .github/workflows/weekly-lints.yml which once a week adds the option to the lakefile and then builds.
github mathlib4 bot (Dec 22 2025 at 05:49):
Mathlib's nightly-testing branch (cc5691da62a63589c16807ca23e36e090f8ddaaa) regression run completed.
Warnings: 9
Warning counts
github mathlib4 bot (Dec 29 2025 at 05:56):
Mathlib's nightly-testing branch (1448aee201be8ab28788e28c114c791c8c847727) regression run completed.
Warnings: 9
Warning counts
github mathlib4 bot (Jan 05 2026 at 06:03):
Mathlib's nightly-testing branch (d55eaa8cc83e0ecbcbd6a552d5994acd3c4c688f) regression run completed.
Warnings: 11
Warning counts
github mathlib4 bot (Jan 19 2026 at 05:57):
Mathlib's nightly-testing branch (7048ffa529b90841dce5015ed4cc61e7fd5d7261) regression run completed.
Warnings: 24
Warning counts
Chris Henson (Jan 19 2026 at 07:56):
I have opened #34121 addressing most of these.
Chris Henson (Jan 19 2026 at 19:44):
Thanks for reviewing quickly! I have two questions regarding the cases I left out:
- What is the preferred way to mark something to be ignored by the
mergeWithGrindlinter? It would be nice to mark places where we currently ignore the linter for performance reasons. You could do this with an#adaptation_noteattached to thegrindcall, does that seem appropriate? - docs#Associated.prod gives an odd false positive, which I think is maybe incompatibility between how
convert/convert_toand the linter work with mvars? (Just a guess, I didn't go compare their implementations)
Anne Baanen (Jan 20 2026 at 13:41):
1: Wouldn't set_option linter.tacticAnalysis.mergeWithGrind false in ... (plus a comment explaining that this is not merged for performance reasons) work too? Probably choose a standard format for the comment, so that the grind developers can easily find test cases.
Anne Baanen (Jan 20 2026 at 13:43):
2: This should be considered a bug in the linter. My schedule is busy this week but hopefully I can check it out next week if that is important for you.
Chris Henson (Jan 20 2026 at 14:02):
- This works too, and is probably better because searching for the linter option is straightforward.
- I'd call this very low priority as it happens on one theorem and is just a tiny bit of CI noise. I'm happy to take a stab at it myself if you'd like.
Anne Baanen (Jan 20 2026 at 14:09):
2: Sounds good! Distributing more knowledge of the tactic analysis linters is a good plan, I'd be happy to help out if you get stuck anywhere :)
github mathlib4 bot (Jan 26 2026 at 05:50):
Mathlib's nightly-testing branch (168b9cff12dab685d3df073d0327ad4bb75843d3) regression run completed.
Warnings: 3
Warning counts
github mathlib4 bot (Feb 02 2026 at 06:07):
Mathlib's nightly-testing branch (20310f506a423528948d509cfa22adc6d4e98936) regression run completed.
Warnings: 14
Warning counts
Kim Morrison :bot: (Feb 02 2026 at 07:19):
github mathlib4 bot (Feb 09 2026 at 06:08):
Mathlib's nightly-testing branch (efc0e39ef9a2a927977844acbabd01dc95fe5987) regression run completed.
Errors: 2
Warnings: 11
Error counts
Warning counts
github mathlib4 bot (Feb 16 2026 at 06:07):
Mathlib's nightly-testing branch (3bbc5c706c3a2ef00ded08af13c3f36be6e58a65) regression run completed.
Errors: 2
Warnings: 13
Error counts
Warning counts
Chris Henson (Feb 18 2026 at 15:12):
In addressing these in #35490, I found the failure in docs#IndexedPartition.coarserPartition interesting, because the reason it fails is that removing a by_contra! changes the this used in the call to grind.
I ended up rewriting the proof in a way I think is better, but the fact that these lines of the log have both an error and warning from the linter seem like a bug in the try/catch logic, right?
Chris Henson (Feb 18 2026 at 15:13):
(I never got around to looking into the last bug I mentioned above, but I'd still like to look into these since they're low priority and a chance for me to learn more about the tactic analysis framework.)
Kim Morrison (Feb 19 2026 at 01:52):
Yes, that sounds like a bug! I'll leave it for you to investigate unless you tell me otherwise. :-)
github mathlib4 bot (Feb 23 2026 at 06:07):
Mathlib's nightly-testing branch (6466c770d151531dc8ce2903db0a959fd582439e) regression run completed.
Warnings: 11
Warning counts
Last updated: Feb 28 2026 at 14:05 UTC