-
Notifications
You must be signed in to change notification settings - Fork 450
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: asynchronous kernel checking #6368
base: kernel-env-base
Are you sure you want to change the base?
Conversation
06a6e24
to
b44a2ff
Compare
Mathlib CI status (docs):
|
!bench |
Here are the benchmark results for commit 9b36754. |
!bench |
Here are the benchmark results for commit ed17ab3. Benchmark Metric Change
========================================================================
- big_do branches 4.0% (329.8 σ)
- big_do instructions 1.1% (63.6 σ)
- big_do maxrss 5.8% (124.1 σ)
+ big_omega.lean branch-misses -64.9% (-143.9 σ)
+ big_omega.lean branches -70.2% (-4059.2 σ)
+ big_omega.lean instructions -71.1% (-3756.4 σ)
+ big_omega.lean maxrss -54.7% (-105.7 σ)
+ big_omega.lean task-clock -74.6% (-347.4 σ)
+ big_omega.lean wall-clock -74.8% (-327.5 σ)
+ big_omega.lean MT branch-misses -69.1% (-546.0 σ)
+ big_omega.lean MT branches -72.4% (-9861.4 σ)
+ big_omega.lean MT instructions -72.9% (-13535.0 σ)
+ big_omega.lean MT maxrss -66.4% (-47.5 σ)
+ big_omega.lean MT task-clock -80.9% (-135.4 σ)
+ big_omega.lean MT wall-clock -80.9% (-135.2 σ)
+ binarytrees instructions -8.4% (-3211.4 σ)
+ binarytrees.st instructions -8.4% (-5177.1 σ)
- bv_decide_mul branches 1.5% (382.5 σ)
+ bv_decide_mul instructions -1.2% (-215.5 σ)
- bv_decide_mul maxrss 1.6% (42.3 σ)
+ bv_decide_realworld branches -1.5% (-178.8 σ)
+ bv_decide_realworld instructions -3.9% (-529.8 σ)
- bv_decide_realworld maxrss 4.1% (15.4 σ)
+ bv_decide_realworld task-clock -1.8% (-11.5 σ)
+ bv_decide_realworld wall-clock -2.1% (-15.1 σ)
+ const_fold instructions -3.5% (-82.7 σ)
+ deriv instructions -1.9% (-45.7 σ)
+ ilean roundtrip instructions -3.3% (-500.2 σ)
- import Lean branches 340.3% (6011.9 σ)
- import Lean instructions 238.0% (3468.3 σ)
- import Lean maxrss 2.9% (30.2 σ)
- import Lean task-clock 84.4% (17.1 σ)
- import Lean wall-clock 84.1% (17.1 σ)
- language server startup branches 50.5% (88.1 σ)
- language server startup instructions 38.5% (61.2 σ)
- language server startup wall-clock 19.1% (14.3 σ)
- liasolver instructions 3.5% (1661.0 σ)
+ liasolver maxrss -1.4% (-37.9 σ)
- libleanshared.so binary size 3.9%
+ nat_repr instructions -5.0% (-1756.3 σ)
+ parser instructions -4.4% (-1586.4 σ)
+ parser maxrss -1.4% (-37.9 σ)
+ qsort instructions -4.0% (-1866.2 σ)
+ qsort maxrss -1.4% (-16.6 σ)
- rbmap instructions 1.5% (184.0 σ)
+ rbmap_1 instructions -1.8% (-102.6 σ)
+ rbmap_fbip instructions -10.3% (-708.9 σ)
+ rbmap_library instructions -1.9% (-171.1 σ)
- reduceMatch instructions 17.1% (675.1 σ)
- reduceMatch maxrss 19.8% (820.9 σ)
- reduceMatch task-clock 12.8% (14.3 σ)
- reduceMatch wall-clock 12.4% (12.6 σ)
- simp_arith1 branch-misses 3.6% (12.7 σ)
- simp_arith1 branches 129.5% (4425.6 σ)
- simp_arith1 instructions 84.0% (2749.9 σ)
- simp_arith1 maxrss 3.6% (64.0 σ)
- simp_arith1 task-clock 43.7% (66.8 σ)
- simp_arith1 wall-clock 43.3% (55.9 σ)
- stdlib attribute application 199.1% (90.3 σ)
- stdlib dsimp 13.6% (20.7 σ)
- stdlib fix level params 10.8% (21.2 σ)
- stdlib instructions 13.0% (4005.3 σ)
- stdlib maxrss 39.4% (163.9 σ)
- stdlib process pre-definitions 162.7% (292.1 σ)
- stdlib share common exprs 12.5% (131.1 σ)
- stdlib tactic execution 25.2% (338.6 σ)
- stdlib task-clock 16.7% (1478.4 σ)
- stdlib type checking 38.8% (56.0 σ)
- stdlib wall-clock 14.9% (77.2 σ)
- stdlib size bytes .olean 2.7%
- stdlib size lines 2.3%
- stdlib size lines C 1.4%
- stdlib size max dynamic symbols 1.4%
- tests/bench/ interpreted instructions 3.1% (515.5 σ)
- tests/bench/ interpreted maxrss 3.6% (11.5 σ)
- tests/bench/ interpreted task-clock 32.8% (35.8 σ)
- tests/bench/ interpreted wall-clock 12.2% (21.4 σ)
- tests/compiler sum binary sizes 4.7%
+ unionfind instructions -8.2% (-2666.8 σ)
+ unionfind task-clock -11.6% (-20.6 σ)
+ unionfind wall-clock -11.6% (-20.6 σ)
- workspaceSymbols instructions 1.7% (2541.3 σ)
- workspaceSymbols maxrss 3.5% (73.0 σ) |
!bench |
Here are the benchmark results for commit ed17ab3. Benchmark Metric Change
========================================================================
- big_do branches 3.5% (293.7 σ)
- big_do instructions 2.7% (159.7 σ)
- big_do maxrss 5.6% (119.1 σ)
+ big_omega.lean branch-misses -65.2% (-145.9 σ)
+ big_omega.lean branches -70.4% (-4095.9 σ)
+ big_omega.lean instructions -70.7% (-3688.5 σ)
+ big_omega.lean maxrss -54.7% (-105.8 σ)
+ big_omega.lean task-clock -73.7% (-331.5 σ)
+ big_omega.lean wall-clock -73.9% (-312.6 σ)
+ big_omega.lean MT branch-misses -69.8% (-564.6 σ)
+ big_omega.lean MT branches -72.5% (-9938.0 σ)
+ big_omega.lean MT instructions -72.8% (-13467.7 σ)
+ big_omega.lean MT maxrss -66.4% (-47.4 σ)
+ big_omega.lean MT task-clock -80.1% (-129.2 σ)
+ big_omega.lean MT wall-clock -80.2% (-129.0 σ)
+ binarytrees task-clock -5.3% (-15.3 σ)
- bv_decide_mul branches 1.2% (317.9 σ)
- bv_decide_mul maxrss 1.4% (38.1 σ)
+ bv_decide_realworld branches -1.5% (-178.5 σ)
+ bv_decide_realworld instructions -2.6% (-350.6 σ)
- bv_decide_realworld maxrss 4.1% (15.6 σ)
- import Lean branch-misses 8.4% (125.8 σ)
- import Lean branches 349.4% (6047.4 σ)
- import Lean instructions 236.1% (3460.0 σ)
- import Lean maxrss 2.9% (30.4 σ)
- import Lean task-clock 74.1% (15.9 σ)
- import Lean wall-clock 74.0% (15.9 σ)
- language server startup branches 50.2% (87.7 σ)
- language server startup instructions 37.2% (59.7 σ)
- language server startup wall-clock 18.6% (14.0 σ)
- libleanshared.so binary size 1.9%
- parser instructions 1.0% (347.7 σ)
- reduceMatch instructions 17.6% (691.7 σ)
- reduceMatch maxrss 19.8% (821.3 σ)
- reduceMatch task-clock 16.1% (17.4 σ)
- reduceMatch wall-clock 15.7% (15.5 σ)
- simp_arith1 branch-misses 8.3% (28.3 σ)
- simp_arith1 branches 129.8% (4430.4 σ)
- simp_arith1 instructions 83.1% (2733.9 σ)
- simp_arith1 maxrss 3.5% (62.6 σ)
- simp_arith1 task-clock 40.1% (62.9 σ)
- simp_arith1 wall-clock 39.8% (52.7 σ)
- stdlib attribute application 204.4% (91.1 σ)
- stdlib dsimp 13.9% (21.0 σ)
- stdlib fix level params 10.3% (20.4 σ)
- stdlib instructions 13.8% (4219.1 σ)
- stdlib maxrss 39.4% (163.8 σ)
- stdlib process pre-definitions 164.7% (293.5 σ)
- stdlib share common exprs 12.7% (132.2 σ)
- stdlib tactic execution 26.8% (355.2 σ)
- stdlib task-clock 17.6% (1544.3 σ)
- stdlib type checking 39.0% (56.2 σ)
- stdlib wall-clock 15.7% (80.6 σ)
- stdlib size bytes .olean 2.7%
- stdlib size lines 2.3%
- stdlib size lines C 1.4%
- stdlib size max dynamic symbols 1.4%
- tests/bench/ interpreted instructions 5.5% (893.1 σ)
- tests/bench/ interpreted maxrss 3.5% (11.2 σ)
- tests/bench/ interpreted task-clock 36.9% (39.0 σ)
- tests/bench/ interpreted wall-clock 15.6% (26.5 σ)
- tests/compiler sum binary sizes 2.8%
- workspaceSymbols instructions 5.3% (7607.4 σ)
- workspaceSymbols maxrss 3.5% (72.3 σ) |
9dbba8e
to
57d45ce
Compare
…er#6211) This PR verifies the `insertMany` method on `HashMap`s for the special case of inserting lists. --------- Co-authored-by: jt0202 <[email protected]> Co-authored-by: monsterkrampe <[email protected]> Co-authored-by: Johannes Tantow <[email protected]>
This PR improves the E-matching pattern selection heuristics in the `grind` tactic. They now take into account type predicates and transformers.
…dure (leanprover#6654) This PR improves the support for partial applications in the E-matching procedure used in `grind`.
This PR improves the diagnostic information provided in `grind` failure states. We now include the list of issues found during the search, and all search thresholds that have been reached. This PR also improves its formatting.
This PR adds some tests for `grind`, working on `List` lemmas.
This PR improves the `grind` search procedure, and adds the new configuration option: `failures`.
This PR uses `StateRefT` instead of `StateT` to equip the Lake build monad with a build store. As a IO reference, different threads may now contend with the build store. However, benchmark results indicate that this does not have a significant performance impact. On a synchronization front, the lack of a mutex should not be a concern because the build store is a memorization data structure and thus order is theoretically irrelevant.
…over#5145) This PR splits the environment used by the kernel from that used by the elaborator, providing the foundation for tracking of asynchronously elaborated declarations, which will exist as a concept only in the latter. Minor changes: * kernel diagnostics are moved from an environment extension to a direct environment as they are the only extension used directly by the kernel * `initQuot` is moved from an environment header field to a direct environment as it is the only header field used by the kernel; this also makes the remaining header immutable after import
…or (leanprover#6214) Kernel checking will be moved to a different thread but namespace registration should stay on the elaboration thread
Continuation from leanprover#5429: eliminates uses of these two functions that care about something other than reducible defs/theorems, then restricts the function definition to these cases to be more true to its name.
…r#6688) Adapts, with permission, unit tests from `lean-egg` written by Marcus Rossel as regression tests for `grind`.
Motivation: we will remove the `[grind_norm]` attribute.
This PR introduces the central API for making parallel changes to the environment
This PR removes the `[grind_norm]` attribute. The normalization theorems used by `grind` are now fixed and cannot be modified by users. We use normalization theorems to ensure the built-in procedures receive term wish expected "shapes". We use it for types that have built-in support in grind. Users could misuse this feature as a simplification rule. For example, consider the following example: ```lean def replicate : (n : Nat) → (a : α) → List α | 0, _ => [] | n+1, a => a :: replicate n a -- I want `grind` to instantiate the equations theorems for me. attribute [grind] replicate -- I want it to use the equation theorems as simplication rules too. attribute [grind_norm] replicate /-- info: [grind.assert] n = 0 [grind.assert] ¬replicate n xs = [] [grind.ematch.instance] replicate.eq_1: replicate 0 xs = [] [grind.assert] True -/ set_option trace.grind.ematch.instance true in set_option trace.grind.assert true in example (xs : List α) : n = 0 → replicate n xs = [] := by grind -- fails :( ``` In this example, `grind` starts by asserting the two propositions as expected: `n = 0`, and `¬replicate n xs = []`. The normalizer cannot reduce `replicate n xs` as expected. Then, the E-matching module finds the instance `replicate 0 xs = []` for the equation theorem `replicate.eq_1` also as expected. But, then the normalizer kicks in and reduces the new instance to `True`. By removing `[grind_norm]` we elimninate this kind of misuse. Users that want to preprocess a formula before invoking `grind` should use `simp` instead.
This PR aligns `List/Array/Vector.reverse` lemmas.
This PR removes deprecations in the standard library from June 2024.
…nprover#6697) This PR changes the arguments of `List/Array.mapFinIdx` from `(f : Fin as.size → α → β)` to `(f : (i : Nat) → α → (h : i < as.size) → β)`, in line with the API design elsewhere for `List/Array`.
6491153
to
d519e08
Compare
A small boost before leanprover#6691 made `modifyState` more complex, a larger boost after.
!bench |
Here are the benchmark results for commit 46d0d13. Benchmark Metric Change
=======================================================================
- big_do branch-misses 3.8% (10.3 σ)
- big_do branches 1.1% (70.8 σ)
- big_omega.lean instructions 1.1% (99.7 σ)
- big_omega.lean maxrss 6.0% (85.7 σ)
- big_omega.lean MT branches 1.1% (63.8 σ)
- big_omega.lean MT instructions 1.2% (101.3 σ)
- big_omega.lean MT maxrss 20.3% (6675.9 σ)
- bv_decide_inequality.lean branch-misses 1.5% (23.6 σ)
- bv_decide_mul branch-misses 2.6% (18.8 σ)
- bv_decide_realworld maxrss 2.8% (23.4 σ)
- lake config tree instructions 1.0% (30.4 σ)
- reduceMatch maxrss 14.7% (293.2 σ)
- simp_arith1 branch-misses 6.1% (11.3 σ)
- simp_arith1 branches 1.4% (28.6 σ)
- stdlib attribute application 719.2% (176.0 σ)
- stdlib fix level params 10.5% (26.1 σ)
- stdlib instructions 9.1% (8388.2 σ)
- stdlib maxrss 4.0% (86.3 σ)
- stdlib process pre-definitions 137.1% (744.4 σ)
- stdlib share common exprs 9.8% (41.2 σ)
- stdlib tactic execution 52.0% (95.5 σ)
- stdlib task-clock 12.5% (77.5 σ)
- stdlib type checking 24.2% (124.0 σ)
- stdlib wall-clock 17.6% (25.6 σ)
- stdlib size bytes .olean 1.1%
- stdlib size lines 2.4%
- tests/bench/ interpreted maxrss 1.3% (40.6 σ)
- workspaceSymbols instructions 1.5% (1105.7 σ) |
!bench |
Here are the benchmark results for commit 4a8e19c. Benchmark Metric Change
======================================================================
- big_do branch-misses 2.1% (33.5 σ)
- big_do task-clock 7.9% (28.6 σ)
- big_do wall-clock 8.0% (28.4 σ)
- big_omega.lean maxrss 3.8% (79.2 σ)
- big_omega.lean task-clock 2.9% (13.7 σ)
- big_omega.lean MT maxrss 20.4% (200.0 σ)
+ big_omega.lean MT task-clock -8.0% (-33.0 σ)
+ big_omega.lean MT wall-clock -11.9% (-46.6 σ)
- bv_decide_realworld maxrss 2.7% (11.6 σ)
+ import Lean task-clock -8.4% (-18.2 σ)
+ import Lean wall-clock -8.4% (-18.9 σ)
- reduceMatch maxrss 14.7% (478.3 σ)
- simp_arith1 branch-misses 3.3% (19.2 σ)
- simp_arith1 branches 1.0% (140.0 σ)
- simp_arith1 maxrss 1.2% (19.4 σ)
- stdlib attribute application 60.3% (80.4 σ)
- stdlib fix level params 10.6% (13.6 σ)
- stdlib instantiate metavars 17.2% (17.2 σ)
- stdlib instructions 8.7% (9549.8 σ)
- stdlib maxrss 3.7% (120.7 σ)
- stdlib process pre-definitions 141.2% (478.3 σ)
- stdlib share common exprs 9.9% (23.6 σ)
- stdlib tactic execution 54.0% (130.1 σ)
- stdlib task-clock 12.0% (53.0 σ)
- stdlib type checking 25.0% (243.4 σ)
- stdlib wall-clock 12.1% (185.2 σ)
- stdlib size bytes .olean 1.1%
- stdlib size lines 2.4%
- tests/bench/ interpreted maxrss 1.3% (30.4 σ)
- workspaceSymbols instructions 1.5% (742.4 σ) |
This PR implements executing kernel checking in parallel to elaboration, which is a prerequisite for parallelizing elaboration itself.
Stacked on #6214