You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
leanchecker checks every module under a name prefix, in parallel #429
leanchecker <Module> checks every module whose name starts with<Module>, all in parallel. LeanChecker.lean (toolchain v4.34.1) matches with target.isPrefixOf m and runs one IO.asTask per matching module.
LeanFrontier.NumberTheory.MarkovTree is both a file and a folder of 20 modules, so checking it checks 21 modules at once. That's what killed the v4.34.1 upgrade audit in its 6 GB container (#423 raised it to 12 GB).
Measured locally on v4.34.1 (/usr/bin/time -l lake env leanchecker <m>):
module
modules under the prefix
time
peak memory
NumberTheory.MarkovTree.Paths
0
9 s
1.2 GB
NumberTheory.SternBrocot.Intervals
0
7 s
1.2 GB
NumberTheory.SternBrocot
3
9 s
6.0 GB
NumberTheory.MarkovTree
20
73 s
13.5 GB
MarkovTree itself is trivial for the kernel: compiled with -Dprofiler=true, its type checking takes 18 ms. It passed the receiver in 2 GB on 21 Sep because the folder was empty then.
Consequences
The upgrade audit (tools/audit_mathlib_upgrade.py) calls leanchecker once per corpus module, so every module under a prefix is checked again with its parent. It's correct but redundant, and the memory spike grows by about 0.6 GB per child. 12 GB leaves room for roughly 20 more MarkovTree/* modules.
The receiver (kernel_recheck in tools/frontier_validate.py) only checks newly submitted modules. It's affected only if a submission adds a file whose folder already has modules. Since fix: the receiver names a silent kernel-recheck kill, with room to avoid one #426, that case is reported as a memory kill rather than a silent rejection.
Options
Leave it; revisit when the largest family nears ~35 modules. (current choice)
Check each module exactly once: the audit calls leanchecker only for modules that no other corpus module is a prefix of. That removes the redundancy; peak memory stays equal to the largest family.
A Tools/ executable replaying exactly one module (leanchecker's replayFromImports, about 20 lines). Best memory, but it adds trusted code and we could no longer say the corpus was checked by the standard leanchecker.
Recommendation: option 2 when a family approaches the limit.
leanchecker <Module>checks every module whose name starts with<Module>, all in parallel.LeanChecker.lean(toolchain v4.34.1) matches withtarget.isPrefixOf mand runs oneIO.asTaskper matching module.LeanFrontier.NumberTheory.MarkovTreeis both a file and a folder of 20 modules, so checking it checks 21 modules at once. That's what killed the v4.34.1 upgrade audit in its 6 GB container (#423 raised it to 12 GB).Measured locally on v4.34.1 (
/usr/bin/time -l lake env leanchecker <m>):NumberTheory.MarkovTree.PathsNumberTheory.SternBrocot.IntervalsNumberTheory.SternBrocotNumberTheory.MarkovTreeMarkovTreeitself is trivial for the kernel: compiled with-Dprofiler=true, its type checking takes 18 ms. It passed the receiver in 2 GB on 21 Sep because the folder was empty then.Consequences
tools/audit_mathlib_upgrade.py) calls leanchecker once per corpus module, so every module under a prefix is checked again with its parent. It's correct but redundant, and the memory spike grows by about 0.6 GB per child. 12 GB leaves room for roughly 20 moreMarkovTree/*modules.kernel_recheckintools/frontier_validate.py) only checks newly submitted modules. It's affected only if a submission adds a file whose folder already has modules. Since fix: the receiver names a silent kernel-recheck kill, with room to avoid one #426, that case is reported as a memory kill rather than a silent rejection.Options
Tools/executable replaying exactly one module (leanchecker'sreplayFromImports, about 20 lines). Best memory, but it adds trusted code and we could no longer say the corpus was checked by the standard leanchecker.Recommendation: option 2 when a family approaches the limit.