feat: increase default stack size from 8MB to 1GB#12971
Merged
Kha merged 3 commits intoleanprover:masterfrom Mar 20, 2026
Merged
feat: increase default stack size from 8MB to 1GB#12971Kha merged 3 commits intoleanprover:masterfrom
Kha merged 3 commits intoleanprover:masterfrom
Conversation
Member
Author
|
!bench |
|
Benchmark results for 938bb81 against 61a3443 are in. Significant changes detected! @Kha
Large changes (5🟥)
Medium changes (1✅, 2🟥)
Small changes (2✅, 4🟥)
|
As stack pages are allocated dynamically, this should not change the memory usage of programs but can prevent them from stack overflowing.
Collaborator
|
Reference manual CI status:
|
mathlib-nightly-testing bot
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Mar 18, 2026
mathlib-nightly-testing bot
pushed a commit
to leanprover-community/mathlib4-nightly-testing
that referenced
this pull request
Mar 18, 2026
|
Mathlib CI status (docs):
|
mathlib-nightly-testing bot
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Mar 19, 2026
mathlib-nightly-testing bot
pushed a commit
to leanprover-community/mathlib4-nightly-testing
that referenced
this pull request
Mar 19, 2026
|
Mathlib CI status (docs):
|
Member
Author
|
!bench mathlib |
|
Benchmark results for leanprover-community/mathlib4-nightly-testing@0458de3 against leanprover-community/mathlib4-nightly-testing@a0c49ce are in. Significant changes detected! @Kha
Large changes (1✅)
Small changes (2✅, 2🟥)
|
hargoniX
approved these changes
Mar 20, 2026
mathlib-nightly-testing bot
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Mar 20, 2026
mathlib-nightly-testing bot
pushed a commit
to leanprover-community/mathlib4-nightly-testing
that referenced
this pull request
Mar 20, 2026
|
Mathlib CI status (docs):
|
mathlib-nightly-testing bot
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Mar 20, 2026
mathlib-nightly-testing bot
pushed a commit
to leanprover-community/mathlib4-nightly-testing
that referenced
this pull request
Mar 20, 2026
|
Mathlib CI status (docs):
|
mathlib-nightly-testing bot
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Mar 20, 2026
mathlib-nightly-testing bot
pushed a commit
to leanprover-community/mathlib4-nightly-testing
that referenced
this pull request
Mar 20, 2026
|
Mathlib CI status (docs):
|
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 increases Lean's default stack size, including for the main thread of Lean executables, to 1GB.
As stack pages are allocated dynamically, this should not change the memory usage of programs but can prevent them from stack overflowing.
The stack size (of any Lean thread) can now be customized via the
LEAN_STACK_SIZE_KBenvironment variable.maincan be prevented from running on a new thread by settingLEAN_MAIN_USE_THREAD=0, in which case the default OS stack size management applies to the main thread again.