-
Notifications
You must be signed in to change notification settings - Fork 297
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
feat(tactic): tactic block caching #2300
Conversation
There's also:
|
One thing to note is that now that community lean is in use, the serialization/deserialization is like 100x faster using the native calls I added ages ago. |
@khoek, is there a version of this available somewhere that uses the core serialization functions? |
Ok, so it is in a workable state now. In this branch it is included into The first time you do it the cache will have to be generated obviously, and you'll see annotations saying "regenerating proof". Then if you comment out Random observations:
|
If you want to cache only what a specific tactic does in a big long interactive proof (say that tactic was Also, this can be helpful even when your whole file is being cached---if you are trying to write a Obvious candidates for other things to |
In order to make this completely usable while working, we need one more patch to core lean, or the vscode plugin (the way I see it). The problem is that when you edit a There either needs to be a) a simple extension to the |
How about we make a tracking issue for this? At the same time, I would love if |
I think a tracking issue is a great idea. I would love to get this into mathlib... this PR shouldn't rot away. |
@@ -7,6 +7,8 @@ import category_theory.limits.preserves.basic | |||
|
|||
open category_theory category_theory.category | |||
|
|||
cache_file? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
@@ -5,6 +5,10 @@ Authors: Scott Morrison | |||
-/ | |||
import category_theory.natural_isomorphism | |||
|
|||
-- run_cmd (do tactic.unsafe_run_io (tcache.rm_cache_dir >> tcache.mk_cache_dir)) | |||
cache_file? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
namespace tcache | ||
|
||
/-- Generic pure error function. -/ | ||
meta def error {α : Sort u} (message : string) : α := undefined_core message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace by undefined_core
.
This could certainly use module docs/some kind of high-level overview of what's going on. The command docs could also be expanded; someone looking over the doc pages wouldn't learn much from what's there now. |
This is all @khoek's work, I'm just putting it here to make it easy to try out and discuss.
This PR adds tactic block caching to Lean. To turn it on, simply
import tactic.tcache.enable
in some Lean file. Make edits, and observe that the rest of the file magically compiles faster...
There does appear to be one bug:
by X; Y
blocks cause it to produce error messages. Likely this is easy to fix, but I didn't look into it. (Changing them to the preferredby { X, Y }
does solve this problem.)