perf(Analysis/CStarAlgebra/Matrix): speed up simp call#38045
Open
kbuzzard wants to merge 2 commits intoleanprover-community:masterfrom
Open
perf(Analysis/CStarAlgebra/Matrix): speed up simp call#38045kbuzzard wants to merge 2 commits intoleanprover-community:masterfrom
kbuzzard wants to merge 2 commits intoleanprover-community:masterfrom
Conversation
Member
Author
|
!radar |
PR summary 00dbc4ec64Import changes for modified filesNo significant changes to the import graph Import changes for all files
Declarations diffNo declarations were harmed in the making of this PR! 🐙 You can run this locally as follows## summary with just the declaration names:
./scripts/pr_summary/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/pr_summary/declarations_diff.sh long <optional_commit>The doc-module for No changes to technical debt.You can run this locally as
|
|
Benchmark results for 100b1a8 against 00dbc4e are in. No significant results found. @kbuzzard
Medium changes (1✅)
Small changes (2✅, 2🟥)
|
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.
Remove a lemma from the simp set to stop typeclass inference taking an expensive wrong turn.
The theorem
Matrix.l2_opNorm_diagonalcurrently takes 66018097 mHeartbeats to elaborate (a couple of seconds, even on a fast machine). The reason for this is the finalsimpcall, which takes 2/3 of the time, and the reason it takes so long is this misstep:This can't be proved (n can have size 0) but
simpis darn well going to try anyway. Unfolding the profiler gives over 1000 lines for this failure. To add insult to injury,simpattempts to prove this twice! These two failed proof attempts eat up over 50% of the total time spent on this proof.The simplifier attempts to prove this because it wants to apply
CStarRing.norm_of_mem_unitary, which needs nontriviality as a hypothesis. If we remove this lemma from thesimpset then this speeds up elaboration by a factor of slightly more than 2.I noticed this because a change in the algebra hierarchy which I'm experimenting with, pushed this proof over the line. I'm fixing up my change because of this but having diagnosed the poor performance I thought there was no harm in fixing it anyway.