feat: look for .ilean.mmap files on watchdog load#14421
Open
robsimmons wants to merge 3 commits into
Open
Conversation
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
robsimmons
marked this pull request as ready for review
July 17, 2026 12:55
mathlib-nightly-testing Bot
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Jul 17, 2026
mathlib-nightly-testing Bot
pushed a commit
to leanprover-community/mathlib4-nightly-testing
that referenced
this pull request
Jul 17, 2026
leanprover-bot
added a commit
to leanprover/reference-manual
that referenced
this pull request
Jul 17, 2026
… penalty to opening the same .ilean.mem file multiple times
mathlib-nightly-testing Bot
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Jul 19, 2026
mathlib-nightly-testing Bot
pushed a commit
to leanprover-community/mathlib4-nightly-testing
that referenced
this pull request
Jul 19, 2026
leanprover-bot
added a commit
to leanprover/reference-manual
that referenced
this pull request
Jul 19, 2026
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 introduces a new, memory-mapped route to loading
ileanobjects into memory. This feature should be treated as undocumented and subject to change without notice in future releases.Lean4web and Workbench memory requirements are, at present, somewhat dominated by the watchdog's ileans. Mmapping ileans has a similar unshared-memory reduction to just deleting them (which is how we've currently ameliorated the problem on live.lean-lang.org).
In my benchmarking (on OSX, with a mathlib nightly-testing 2026-07-15 compiled against this branch):
.ilean.mmapfiles for just the.ileanfiles in Mathlib: watchdog needs 1.1G memory -> watchdog needs 496M memory.ilean.mmapfiles for all.ileanfiles, including those in the core release: watchdog needs 1.1G memory -> watchdog needs 393M memory.This design looks for
.ilean.mmapfiles aside.ileanfiles one time, on watchdog start, and only loads them if they report a file hash matching the current.ilean.hash. There's no mechanism for creating.ilean.mmapfiles, which is intentional: we only intend for this feature to be used for lean4web and workbench environments that we control at first so that we can back out of this design later on. For now, the only difference for users that don't go out of their way to create.ilean.mmapfiles in their.lakedirectories will be one failed file lookup per ilean.For benchmarking I used robsimmons/milean, but I already have a better design for this in mind.