perf: detect unnecessary repeated checks in more situations#11078
Closed
perf: detect unnecessary repeated checks in more situations#11078
Conversation
Contributor
Author
|
!radar |
|
Benchmark results for 1353298 against e76bbef are in! @hargoniX Runs (2)
|
Contributor
Author
|
Well clearly that's no good, time to investigate after vacation :D |
1353298 to
1dbb2f2
Compare
1dbb2f2 to
cc72ace
Compare
Contributor
Author
|
!radar |
|
Benchmark results for cc72ace against 27e5e21 are in! @hargoniX Major changes (2)
Minor changes (12)
|
github-merge-queue bot
pushed a commit
that referenced
this pull request
Nov 17, 2025
This PR fixes a bug in the LCNF simplifier unearthed while working on #11078. In some situations caused by `unsafeCast`, the simplifier would record incorrect information about `cases`, leading to further bugs down the line. Suppose we have `v : NonScalar` due to an `unsafeCast` and we run `cases` on it, expecting `Prod.mk fst snd`. The current code attempts to record both the arguments from the constructor application in the case arm `fst`, `snd` and the parameters for the type by inspecting the discr `v`. However, `NonScalar` does of course not have any parameters, causing the simplifier to record wrong information. This patch makes the `cases` infrastructure more cautious when extracting information from the type of `v`.
cc72ace to
a27d665
Compare
Contributor
Author
|
!radar |
|
Benchmark results for a27d665 against bef8574 are in! @hargoniX Major changes (2)
Minor changes (13)
|
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
Contributor
Author
|
Seems like this breaks reuse more than it helps :( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR improves on #11020 to remove even more unnecessary checks