Commit graph

44 commits

Author SHA1 Message Date
Sebastian Ullrich
044e3b1b56
fix: heartbeats from realizeConst should be ignored (#7473)
Avoids nondeterministic counting from racing threads
2025-03-13 15:10:29 +00:00
Eric Wieser
0d7e126a01
chore: re-land "perf: use C23's free_sized when available" (#6844)
Unreverts #6598

I'll combine #6825 into this before merging.
2025-02-04 12:43:56 +00:00
Sebastian Ullrich
a35bf7ee4c
chore: revert "perf: use C23's free_sized when available" (#6841)
Reverts leanprover/lean4#6598, which broke Windows CI
2025-01-29 09:11:23 +00:00
Eric Wieser
6aa6407af1
perf: use C23's free_sized when available (#6598)
See https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2699.htm for an
explanation of this feature.

---------

Co-authored-by: Chris Kennelly <ckennelly@google.com>
2025-01-28 10:17:15 +00:00
Sebastian Ullrich
f97a7d4234
feat: incremental elaboration of definition headers, bodies, and tactics (#3940)
Extends Lean's incremental reporting and reuse between commands into
various steps inside declarations:
* headers and bodies of each (mutual) definition/theorem
* `theorem ... := by` for each contained tactic step, including
recursively inside supported combinators currently consisting of
  * `·` (cdot), `case`, `next`
  * `induction`, `cases`
  * macros such as `next` unfolding to the above

![Recording 2024-05-10 at 11 07
32](https://github.com/leanprover/lean4/assets/109126/c9d67b6f-c131-4bc3-a0de-7d63eaf1bfc9)

*Incremental reuse* means not recomputing any such steps if they are not
affected by a document change. *Incremental reporting* includes the
parts seen in the recording above: the progress bar and messages. Other
language server features such as hover etc. are *not yet* supported
incrementally, i.e. they are shown only when the declaration has been
fully processed as before.

---------

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
2024-05-22 13:23:30 +00:00
int-y1
ce4ae37c19 chore: fix more typos in comments 2023-10-08 14:37:34 -07:00
Gabriel Ebner
f4d005e86d chore: only build small allocator if enabled
This prevents us from calling alloc/dealloc if LEAN_SMALL_ALLOCATOR is
disabled.
2023-01-24 11:37:43 -08:00
Sebastian Ullrich
d4683e0169 chore: clean up LEAN_EXTRA_FLAGS 2021-11-20 11:04:39 +01:00
Leonardo de Moura
106adb09b9 fix: simplify allocator
Do not move segments between heaps.
We found yet another bug due to this "feature".
The crash is reported here:
https://gist.github.com/semorrison/490496060bbcfa8ea635f3d7be1ac824

@Kha summarized the "root of the evil" as:
using per-heap import lists while segments can be exchanged between heaps doesn't seem compatible.

This is the second bug due to this design decision.
We had fixed one here:
2283ebc5e9/src/runtime/alloc.cpp (L257-L269)

This commit fixes both issues by removing the segment exchange feature.
2021-10-05 16:58:20 -07:00
Sebastian Ullrich
70f99ab655 chore: placate GCC 2021-09-23 16:31:41 +02:00
Leonardo de Moura
c8406a301d chore: reduce src/include/lean 2021-09-07 08:24:54 -07:00
Sebastian Ullrich
904cfd6fcb perf: extract cold path in lean_alloc_small 2021-07-19 13:20:28 -07:00
Sebastian Ullrich
16fbbf98e9 perf: extract cold paths in lean_free_small and mark noinline 2021-07-19 13:20:28 -07:00
Leonardo de Moura
51200c916e chore: make explicit user and internal panics 2021-03-04 07:37:33 -08:00
Leonardo de Moura
52c4b7219f chore: document fix 2021-01-30 17:15:16 -08:00
Leonardo de Moura
29a56db732 fix: check if reused segment is full 2021-01-30 17:02:29 -08:00
Leonardo de Moura
95ebd58ae9 chore: add assertions 2021-01-30 15:49:13 -08:00
Leonardo de Moura
1ca916d9b4 fix: assertion violation 2021-01-30 14:04:47 -08:00
Leonardo de Moura
cde7fd97fa chore: set page size back to 8192
@Kha @Vtec234 The server crashes whenever I try to use a page size
different from 8192. Any ideas?
Note that, we can compile lean, and all tests succeed but `leanserver`
ones. I am wondering whether this is a problem with the process API,
or another API that is currently being used only by the server.
2021-01-30 10:58:34 -08:00
Leonardo de Moura
cf5adbd4fe chore: increase LEAN_MAX_SMALL_OBJECT_SIZE and simplify code 2021-01-30 10:58:34 -08:00
Leonardo de Moura
4848533717 fix: make sure we have "heartbeats" even when `-D SMALL_ALLOC=OFF" 2021-01-24 19:42:45 -08:00
Leonardo de Moura
da5d46cd5d fix: memory access violation 2021-01-24 18:21:20 -08:00
Leonardo de Moura
acfac85ac0 feat: add IO.getNumHeartbeats 2021-01-24 17:45:50 -08:00
Leonardo de Moura
dfd1f23030 fix: avoid unnecessary page allocation
When import objects deleted by other threads, we may add elements to
`p` free list.
2020-11-29 13:33:59 -08:00
Leonardo de Moura
6dd3616298 fix: import pending objects *before* moving segments
@Kha I stopped getting the assertion violation after this fix.
There is another unrelated issue that I will fix in a separate commit.
2020-11-29 13:26:10 -08:00
Sebastian Ullrich
3b8d473188 fix: alloc: do not forget about orphaned pages 2020-09-29 08:01:10 -07:00
Leonardo de Moura
2f1ec93289 chore: move runtime implementation to src/runtime 2020-05-22 14:35:16 -07:00
Leonardo de Moura
1a77ee4f89 chore: delete old runtime directory 2020-05-18 11:33:18 -07:00
Leonardo de Moura
8bdca35282 chore: use #include <lean/runtime/...> for runtime .h files 2020-05-18 11:30:07 -07:00
Leonardo de Moura
dcd15f3424 refactor(runtime): C backend 2019-08-24 07:40:38 -07:00
Leonardo de Moura
94c69fff2b feat(runtime/alloc): auxiliary functions for new runtime 2019-08-21 10:44:40 -07:00
Leonardo de Moura
45ed2995d4 chore(runtime): remove alloc_small 2019-08-15 09:09:44 -07:00
Leonardo de Moura
44bf885829 chore(runtime/alloc): simplify header file 2019-08-15 09:09:44 -07:00
Sebastian Ullrich
8fb004f917 fix(runtime/alloc): fix out-of-bounds pointer reported by ubsan 2019-07-26 12:39:35 -07:00
Leonardo de Moura
6bed0ca5b5 chore(library/compiler): style 2019-05-22 18:46:37 -07:00
Leonardo de Moura
48ed3c5307 feat(runtime): inline hot path small object allocation 2019-05-17 10:12:43 -07:00
Leonardo de Moura
5c7849a869 feat(runtime): eager heap initialization 2019-04-25 18:10:36 -07:00
Leonardo de Moura
eb2633a5f2 fix(runtime/alloc): segment recycling 2019-03-09 13:42:55 -08:00
Leonardo de Moura
8f6998acac fix(runtime/alloc): we may deallocate in a new thread before we allocated anything 2019-03-09 13:20:06 -08:00
Sebastian Ullrich
1e248013f7 chore(runtime/alloc): don't init heap if LEAN_SMALL_ALLOCATOR is off
makes tracking down leaks a bit nicer
2019-03-07 15:52:06 +01:00
Leonardo de Moura
333ba43266 feat(runtime): statistics
We can enabled runtime statistics by using cmake option `-D RUNTIME_STATS`.

cc @kha
2019-03-05 16:01:06 -08:00
Leonardo de Moura
f2ef0eb597 fix(runtime/alloc): bug at import_objs 2019-02-26 07:34:26 -08:00
Leonardo de Moura
a9458fdcb3 chore(runtime/alloc): remove incorrect assertion 2019-02-26 07:33:53 -08:00
Leonardo de Moura
4b44c5ce36 feat(runtime/object): small object allocator 2019-02-23 17:17:56 -08:00