Skip to content

perf: store per-module constant prefix trees in oleans#14362

Draft
Kha wants to merge 21 commits into
masterfrom
olean-const-trie
Draft

perf: store per-module constant prefix trees in oleans#14362
Kha wants to merge 21 commits into
masterfrom
olean-const-trie

Conversation

@Kha

@Kha Kha commented Jul 11, 2026

Copy link
Copy Markdown
Member

This PR replaces the eager construction of the imported-constants hash maps at import time with per-module prefix trees that are precomputed at olean write time, live in the memory-mapped compacted regions, and are merged lazily on first access. Imports get substantially faster and lighter — import Lean wall clock -28%, mathlib's import phase -21%, build memory -5% on stdlib and mathlib alike, header snapshot saves -17% wall at -23% snapshot size — in exchange for ~6% larger stdlib oleans (~4% for mathlib) and 1-3% more build instructions.

Details:

  • New Lean.ConstTrie: per-module prefix trees (ConstTrie α) over constant names, stored in ModuleData (constTrie/extraConstTrie, filled centrally in saveModuleData(Parts)), with children disambiguated by cached per-prefix Name hashes through a compact per-node byte index.
  • ImportedConsts α, the merged import view: single-module subtrees are borrowed directly from the olean regions, prefixes shared between modules get nodes computed lazily on first access, and the subsumption rule for names declared by several modules is applied inline when a node's entry is first accessed.
  • Conflicting declarations are detected by a separate sweep that walks only name prefixes occurring in several modules, pruned by a certificate: module pairs whose data one of the import's direct imports loaded, at the current levels, were already checked by that import's own compile, recursively down to each pair's first co-importer (established by replaying the loader's level-propagation rules bit-parallel in one pass over the sorted modules). Module-system compiles thus pay almost nothing; compiles without the module system re-check name universes no prior compile loaded, such as non-public names of module-system dependencies.
  • Lookups go through a process-global, lock-free cache (open addressing, insert-only, never replacing) whose table doubles with its working set, so whole-environment sweeps at mathlib scale stay cached; hits perform no reference counting on the view and key, and values are marked persistent via the new thread-safe lean_mark_persistent_unshared, which skips multi-threaded subgraphs.
  • Environment.const2ModIdx is memoized in a process-global cache instead of a Thunk in the kernel environment, and --incr-header-save pre-forces the lazy views in truncateToHeader, keeping thunks, closures, and the memoized map out of compacted snapshots; the lookup cache is reset after persisting.
  • Misses against the imported views are reduced by resolving strictly-local hygienic and private names locally and by routing code-generator names extras-first in getModuleIdxFor?.
  • Known costs, both wall-profile relocations of work removed from the import phase: mathlib lint wall +19% (whole-environment sweeps expand the lazy views on demand) and a grown interpretation profile category.

@Kha

Kha commented Jul 11, 2026

Copy link
Copy Markdown
Member Author

!bench

@leanprover-radar

leanprover-radar commented Jul 11, 2026

Copy link
Copy Markdown

Benchmark results for 7a68001 against 8006bb0 are in. There are significant results. @Kha

Warning

These warnings may indicate that the benchmark results are not directly comparable, for example due to changes in the runner configuration or hardware.

  • Bench repo commit hashes for run build differ between commits.
  • Bench repo commit hashes for run other differ between commits.
  • 🟥 build//instructions: +6.3T (+52.95%)

Large changes (55✅, 329🟥)

Too many entries to display here. View the full report on radar instead.

Medium changes (7✅, 1528🟥)

Too many entries to display here. View the full report on radar instead.

Small changes (5✅, 816🟥)

Too many entries to display here. View the full report on radar instead.

@github-actions github-actions Bot added toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN labels Jul 11, 2026
@leanprover-bot

leanprover-bot commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Reference manual CI status:

@leanprover-bot leanprover-bot added the breaks-manual This is not necessarily a blocker for merging, but there needs to be a plan. label Jul 11, 2026
@Kha

Kha commented Jul 11, 2026

Copy link
Copy Markdown
Member Author

!bench mathlib

@leanprover-radar

leanprover-radar commented Jul 11, 2026

Copy link
Copy Markdown

Benchmark results for leanprover-community/mathlib4-nightly-testing@48fbe78 against leanprover-community/mathlib4-nightly-testing@5edfd4c are in. There are significant results. @Kha

  • 🟥 main exited with code 1

No significant changes detected.

@Kha
Kha force-pushed the olean-const-trie branch from 7a68001 to 736e8af Compare July 11, 2026 14:03
@Kha

Kha commented Jul 11, 2026

Copy link
Copy Markdown
Member Author

!bench

@leanprover-radar

leanprover-radar commented Jul 11, 2026

Copy link
Copy Markdown

Benchmark results for 736e8af against 8006bb0 are in. There are significant results. @Kha

Warning

These warnings may indicate that the benchmark results are not directly comparable, for example due to changes in the runner configuration or hardware.

  • Bench repo commit hashes for run build differ between commits.
  • Bench repo commit hashes for run other differ between commits.
  • 🟥 build//instructions: +4.5T (+38.02%)

Large changes (56✅, 232🟥)

Too many entries to display here. View the full report on radar instead.

Medium changes (5✅, 1101🟥)

Too many entries to display here. View the full report on radar instead.

Small changes (6✅, 1324🟥)

Too many entries to display here. View the full report on radar instead.

Kha added 2 commits July 11, 2026 14:09
This PR replaces the eager construction of the imported-constants hash maps in `finalizeImport` (`privateConstantMap`, `publicConstantMap`, `const2ModIdx`; ~530k insertions for `import Lean`) with prefix trees over each module's constant names that are precomputed at olean write time and remain in the memory-mapped compacted regions. Import now only merges the per-module trees, allocating fresh nodes solely for name prefixes shared between modules (~3k nodes / ~81k edges for the stdlib), and lookups walk the merged view, disambiguating children by cached per-prefix `Name` hash. `import Lean` drops from ~527ms to ~393ms; olean sizes grow by ~6%.

Details:

* New `Lean.ConstTrie`: generic per-module tree (`ConstTrie α`), merged import view (`ImportedConsts α`) with single-module subtrees borrowed from the regions and module-index tagging, and the new `ConstMap` structure (`imported` view + `locals` map).
* `ModuleData` gains `constTrie`/`extraConstTrie` fields, filled centrally in `saveModuleData(Parts)`. The extra-const tree replaces the 325k codegen-name entries of `const2ModIdx` (`Kernel.Environment` now holds `allImportedConsts`/`importedExtraConsts` instead, serving `getModuleIdxFor?`).
* Duplicate imported constants are resolved (incl. `subsumesInfo` realizability subsumption and `throwAlreadyImported`) from the merge's reported collisions.
* In `saveModuleDataParts`, all parts' data must stay alive across the chained compactor saves; the tries are therefore attached to all parts up front (the compactor tracks compacted objects by heap address, so per-part temporaries would corrupt later parts via address reuse).
* `stage0/src/stdlib_flags.h` temporarily enables `interpreter.prefer_native` as this is an ABI-breaking change to `Kernel.Environment`/`ConstMap` (to be reverted by `update-stage0`). Stage 1 tests are meaningless on this commit since the stage 1 oleans lack the new `ModuleData` fields; validate against stage 2.

Co-Authored-By: Claude
This PR speeds up constant lookups in the prefix-tree-backed environment by storing each trie node's child key hashes in a `ByteArray` alongside the children, so the per-level binary search runs over contiguous memory instead of chasing child and key pointers, in the memory-mapped per-module trees as well as the merged import spine. This supersedes the `indexed` hash-map wrappers on wide merged nodes, which could not cover wide nodes inside single-module region subtrees and made `Runtime.markPersistent` walk their entries on every import.

Co-Authored-By: Claude
mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Jul 11, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Jul 11, 2026
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Jul 11, 2026
@leanprover-bot leanprover-bot added builds-manual CI has verified that the Lean Language Reference builds against this PR and removed breaks-manual This is not necessarily a blocker for merging, but there needs to be a plan. labels Jul 11, 2026
@Kha
Kha force-pushed the olean-const-trie branch from 736e8af to 2abb3e2 Compare July 11, 2026 15:26
@Kha

Kha commented Jul 11, 2026

Copy link
Copy Markdown
Member Author

!bench

@leanprover-radar

leanprover-radar commented Jul 11, 2026

Copy link
Copy Markdown

Benchmark results for 2abb3e2 against 8006bb0 are in. There are significant results. @Kha

Warning

These warnings may indicate that the benchmark results are not directly comparable, for example due to changes in the runner configuration or hardware.

  • Bench repo commit hashes for run build differ between commits.
  • Bench repo commit hashes for run other differ between commits.
  • 🟥 build//instructions: +8.2T (+69.20%)

Large changes (49✅, 433🟥)

Too many entries to display here. View the full report on radar instead.

Medium changes (9✅, 1889🟥)

Too many entries to display here. View the full report on radar instead.

Small changes (4✅, 369🟥)

Too many entries to display here. View the full report on radar instead.

mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Jul 11, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Jul 11, 2026
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Jul 11, 2026
This PR restores the intended final form of the trie child index, which the previous commit accidentally carried in an interim form due to a workspace snapshot race: instead of a binary search that composes each probed hash from eight byte loads, the child index stores `[k][2^k + 1 u16 offsets][one fingerprint byte per child]`; the query hash's top `k` bits select a window of on average at most one child, a fingerprint byte filters it, and the final name component comparison (sound on its own, as siblings always differ in their final component) confirms the match.

Co-Authored-By: Claude
@Kha

Kha commented Jul 11, 2026

Copy link
Copy Markdown
Member Author

!bench

@leanprover-radar

leanprover-radar commented Jul 11, 2026

Copy link
Copy Markdown

Benchmark results for e957cab against 8006bb0 are in. There are significant results. @Kha

Warning

These warnings may indicate that the benchmark results are not directly comparable, for example due to changes in the runner configuration or hardware.

  • Bench repo commit hashes for run build differ between commits.
  • Bench repo commit hashes for run other differ between commits.
  • 🟥 build//instructions: +2.6T (+21.58%)

Large changes (52✅, 126🟥)

Too many entries to display here. View the full report on radar instead.

Medium changes (7✅, 560🟥)

Too many entries to display here. View the full report on radar instead.

Small changes (6✅, 1925🟥)

Too many entries to display here. View the full report on radar instead.

mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Jul 11, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Jul 11, 2026
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Jul 11, 2026
@leanprover-radar

leanprover-radar commented Jul 16, 2026

Copy link
Copy Markdown

Benchmark results for leanprover-community/mathlib4-nightly-testing@50dff9c against leanprover-community/mathlib4-nightly-testing@5edfd4c are in. There are significant results. @Kha

  • 🟥 build//instructions: +4.8T (+3.17%)

Large changes (1🟥)

  • 1 hidden

Medium changes (2✅)

  • build/module/Batteries.Data.String.Lemmas//instructions: -3.4G (-10.08%)
  • build/module/Batteries.Recycling.MonadSatisfying.Array//instructions: -1.4G (-14.23%)

Small changes (262🟥)

  • 🟥 build/module/Mathlib.Algebra.Algebra.NonUnitalSubalgebra//instructions: +1.1G (+1.55%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Subalgebra.Basic//instructions: +893.5M (+1.90%)
  • 🟥 build/module/Mathlib.Algebra.BigOperators.Fin//instructions: +1.1G (+2.09%)
  • 🟥 build/module/Mathlib.Algebra.Category.BialgCat.Monoidal//instructions: +1.2G (+3.13%)
  • 🟥 build/module/Mathlib.Algebra.Category.CommHopfAlgCat//instructions: +1.6G (+2.04%)
  • 🟥 build/module/Mathlib.Algebra.Category.ModuleCat.Monoidal.Adjunction//instructions: +1.1G (+3.51%)
  • 🟥 build/module/Mathlib.Algebra.Category.ModuleCat.Presheaf.PushforwardZeroMonoidal//instructions: +1.7G (+1.53%)
  • 🟥 build/module/Mathlib.Algebra.Category.Ring.Limits//instructions: +1.6G (+2.13%)
  • 🟥 build/module/Mathlib.Algebra.DirectSum.Internal//instructions: +960.2M (+2.54%)
  • 🟥 build/module/Mathlib.Algebra.Homology.Factorizations.CM5a//instructions: +1.2G (+2.25%)
  • 🟥 build/module/Mathlib.Algebra.Homology.HomotopyCategory.MappingCocone//instructions: +978.4M (+2.89%)
  • 🟥 build/module/Mathlib.Algebra.Lie.CartanCriterion//instructions: +1.3G (+3.05%)
  • 🟥 build/module/Mathlib.Algebra.Lie.Weights.IsSimple//instructions: +1.5G (+1.90%)
  • 🟥 build/module/Mathlib.Algebra.Lie.Weights.Killing//instructions: +1.7G (+1.86%)
  • 🟥 build/module/Mathlib.Algebra.Lie.Weights.RootSystem//instructions: +1.4G (+2.06%)
  • 🟥 build/module/Mathlib.Algebra.Module.LocalizedModule.Submodule//instructions: +907.4M (+2.28%)
  • 🟥 build/module/Mathlib.Algebra.Module.Torsion.PrimaryComponent//instructions: +1.4G (+2.08%)
  • 🟥 build/module/Mathlib.Algebra.Module.ZLattice.Summable//instructions: +1.3G (+2.68%)
  • 🟥 build/module/Mathlib.Algebra.MvPolynomial.SchwartzZippel//instructions: +1.1G (+2.98%)
  • 🟥 build/module/Mathlib.Algebra.Order.CauSeq.Basic//instructions: +902.9M (+1.90%)
  • and 242 more

mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Jul 16, 2026
@github-actions github-actions Bot added the mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN label Jul 16, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Jul 16, 2026
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Jul 16, 2026
@Kha

Kha commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

!bench

@leanprover-radar

Copy link
Copy Markdown

Benchmark results for 7e710c4 against 8006bb0 are in. (These commits have already been benchmarked in a previous command.) There are significant results. @Kha

Warning

These warnings may indicate that the benchmark results are not directly comparable, for example due to changes in the runner configuration or hardware.

  • Bench repo commit hashes for run build differ between commits.
  • Bench repo commit hashes for run other differ between commits.
  • 🟥 build//instructions: +146.7G (+1.24%)

Large changes (66✅, 12🟥)

  • build/module/Std.Data.DHashMap.Internal.RawLemmas//instructions: -90.6G (-35.46%)
  • build/module/Std.Data.DHashMap.RawLemmas//instructions: -9.4G (-6.06%)
  • build/profile/import//wall-clock: -31s (-19.06%)
  • 🟥 build/profile/interpretation//wall-clock: +14s (+13.31%)
  • build/profile/tactic execution//wall-clock: -1m 37s (-32.42%)
  • 🟥 build/stat/imported bytes//bytes: +2GiB (+9.52%)
  • compiled/incr_header_save//maxrss: -152MiB (-7.39%)
  • compiled/incr_header_save//task-clock: -274ms (-19.15%)
  • compiled/incr_header_save//wall-clock: -273ms (-18.72%)
  • elab/big_beq//maxrss: -65MiB (-3.69%)
  • elab/big_beq_rec//maxrss: -66MiB (-3.70%)
  • elab/big_deceq//maxrss: -64MiB (-3.66%)
  • elab/big_deceq_rec//maxrss: -64MiB (-3.65%)
  • elab/big_do//maxrss: -130MiB (-20.32%)
  • elab/big_match//maxrss: -64MiB (-3.59%)
  • elab/big_match_nat//maxrss: -66MiB (-3.77%)
  • elab/big_match_nat//task-clock: -61ms (-12.34%)
  • elab/big_match_nat//wall-clock: -61ms (-11.81%)
  • elab/big_match_nat_split//maxrss: -65MiB (-3.61%)
  • elab/big_match_partial//maxrss: -69MiB (-3.82%)
  • and 58 more

Medium changes (27✅, 12🟥)

  • 🟥 build/lakeprof/longest rebuild path//instructions: +19.0G (+3.07%)
  • build/module/Init.Data.UInt.Lemmas//instructions: -4.4G (-8.29%)
  • build/module/Std.Data.DHashMap.Internal.WF//instructions: -1.3G (-6.84%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Std.Data.DTreeMap.Internal.Lemmas//instructions: +2.4G (+1.07%)
  • 🟥 build/module/Std.Data.HashMap.RawLemmas//instructions: +2.0G (+1.77%)
  • elab/big_beq//task-clock: -53ms (-6.36%)
  • elab/big_beq//wall-clock: -52ms (-6.11%)
  • elab/big_deceq//instructions: -82.5M (-1.97%)
  • elab/big_deceq//task-clock: -52ms (-10.57%)
  • elab/big_deceq//wall-clock: -54ms (-10.49%)
  • elab/big_deceq_rec//instructions: -77.8M (-1.38%)
  • elab/big_deceq_rec//task-clock: -59ms (-9.62%)
  • elab/big_deceq_rec//wall-clock: -59ms (-9.31%)
  • elab/big_match//instructions: -75.8M (-0.73%)
  • elab/bv_decide_mod//maxrss: -193MiB (-8.68%)
  • elab/cbv_aes//maxrss: -126MiB (-14.58%)
  • elab/delayed_assign//instructions: -85.2M (-2.55%)
  • elab/delayed_assign//task-clock: -49ms (-11.83%)
  • elab/delayed_assign//wall-clock: -47ms (-11.37%)
  • elab/delayed_sharing//instructions: -81.4M (-3.06%)
  • and 18 more
  • and 1 hidden

Small changes (52✅, 2434🟥)

  • build//task-clock: -1m 23s (-3.96%)
  • 🟥 build/module/Init.BinderNameHint//instructions: +13.7M (+4.13%)
  • 🟥 build/module/Init.BinderPredicates//instructions: +55.4M (+2.53%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.ByCases//instructions: +33.8M (+4.24%)
  • 🟥 build/module/Init.CbvSimproc//instructions: +61.3M (+2.85%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Classical//instructions: +42.5M (+3.93%)
  • 🟥 build/module/Init.Control.Basic//instructions: +43.9M (+1.97%)
  • 🟥 build/module/Init.Control.Do//instructions: +30.4M (+5.92%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.EState//instructions: +34.1M (+4.89%)
  • 🟥 build/module/Init.Control.Except//instructions: +32.8M (+2.34%)
  • 🟥 build/module/Init.Control.ExceptCps//instructions: +36.5M (+3.27%)
  • 🟥 build/module/Init.Control.Id//instructions: +22.5M (+4.69%)
  • 🟥 build/module/Init.Control.Lawful.Basic//instructions: +46.9M (+2.15%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.Instances//instructions: +36.7M (+0.53%)
  • 🟥 build/module/Init.Control.Lawful.Lemmas//instructions: +39.6M (+5.63%)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach.Instances//instructions: +45.4M (+2.84%)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach.Lemmas//instructions: +43.2M (+4.24%)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach//instructions: +36.1M (+7.31%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadLift.Instances//instructions: +43.5M (+3.69%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadLift.Lemmas//instructions: +31.0M (+3.55%)
  • and 2466 more

@Kha
Kha force-pushed the olean-const-trie branch from 24158ef to 4716d7a Compare July 16, 2026 09:45
@Kha

Kha commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

!bench

@leanprover-radar

leanprover-radar commented Jul 16, 2026

Copy link
Copy Markdown

Benchmark results for 4716d7a against 8006bb0 are in. There are significant results. @Kha

Warning

These warnings may indicate that the benchmark results are not directly comparable, for example due to changes in the runner configuration or hardware.

  • Bench repo commit hashes for run build differ between commits.
  • Bench repo commit hashes for run other differ between commits.
  • 🟥 build//instructions: +218.9G (+1.85%)

Large changes (63✅, 11🟥)

  • build/module/Std.Data.DHashMap.Internal.RawLemmas//instructions: -91.2G (-35.69%)
  • build/module/Std.Data.DHashMap.RawLemmas//instructions: -10.8G (-6.99%)
  • build/profile/import//wall-clock: -23s (-14.27%)
  • 🟥 build/profile/interpretation//wall-clock: +18s (+17.45%)
  • build/profile/tactic execution//wall-clock: -1m 36s (-32.08%)
  • 🟥 build/stat/imported bytes//bytes: +2GiB (+7.58%)
  • compiled/incr_header_save//maxrss: -306MiB (-14.92%)
  • compiled/incr_header_save//task-clock: -469ms (-32.75%)
  • compiled/incr_header_save//wall-clock: -470ms (-32.25%)
  • elab/big_beq//maxrss: -167MiB (-9.43%)
  • elab/big_beq_rec//maxrss: -167MiB (-9.38%)
  • elab/big_deceq//maxrss: -167MiB (-9.52%)
  • elab/big_deceq_rec//maxrss: -167MiB (-9.48%)
  • elab/big_do//maxrss: -132MiB (-20.57%)
  • elab/big_match//maxrss: -167MiB (-9.35%)
  • elab/big_match_nat//maxrss: -169MiB (-9.63%)
  • elab/big_match_nat_split//maxrss: -169MiB (-9.42%)
  • elab/big_match_partial//maxrss: -169MiB (-9.34%)
  • elab/big_omega//maxrss: -128MiB (-19.45%)
  • elab/big_omega_MT//maxrss: -136MiB (-20.53%)
  • and 53 more
  • and 1 hidden

Medium changes (16✅, 17🟥)

  • 🟥 build/lakeprof/longest rebuild path//instructions: +21.9G (+3.54%)
  • build/module/Init.Data.UInt.Lemmas//instructions: -4.4G (-8.28%)
  • build/module/Std.Data.DHashMap.Internal.WF//instructions: -1.5G (-8.20%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Std.Data.DTreeMap.Internal.Lemmas//instructions: +2.4G (+1.04%)
  • 🟥 build/module/Std.Data.HashMap.RawLemmas//instructions: +2.0G (+1.72%)
  • elab/big_deceq//task-clock: -43ms (-8.66%)
  • elab/big_deceq//wall-clock: -44ms (-8.49%)
  • elab/big_match_nat//task-clock: -46ms (-9.21%)
  • elab/big_match_nat//wall-clock: -43ms (-8.43%)
  • 🟥 elab/bv_decide_rewriter//instructions: +167.4M (+1.82%)
  • elab/cbv_aes//maxrss: -127MiB (-14.69%)
  • 🟥 elab/cbv_decide//instructions: +367.1M (+0.91%)
  • 🟥 elab/cbv_dedup//instructions: +70.5M (+2.21%)
  • 🟥 elab/cbv_divisors//instructions: +456.9M (+0.93%)
  • elab/cbv_leroy//maxrss: -142MiB (-7.64%)
  • elab/delayed_sharing//task-clock: -43ms (-11.96%)
  • elab/delayed_sharing//wall-clock: -43ms (-11.52%)
  • 🟥 elab/grind_bitvec2//instructions: +2.1G (+1.43%)
  • 🟥 elab/grind_list2//instructions: +482.5M (+1.10%)
  • 🟥 elab/iterators//instructions: +74.6M (+2.98%)
  • and 13 more

Small changes (46✅, 2450🟥)

  • build//task-clock: -1m 16s (-3.62%)
  • 🟥 build/module/Init.BinderNameHint//instructions: +17.2M (+5.17%)
  • 🟥 build/module/Init.BinderPredicates//instructions: +67.0M (+3.06%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.ByCases//instructions: +41.5M (+5.21%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.CbvSimproc//instructions: +80.2M (+3.73%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Classical//instructions: +55.4M (+5.12%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Basic//instructions: +48.3M (+2.16%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Do//instructions: +36.6M (+7.13%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.EState//instructions: +41.0M (+5.88%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Except//instructions: +39.3M (+2.80%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.ExceptCps//instructions: +42.7M (+3.82%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Id//instructions: +28.2M (+5.88%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.Basic//instructions: +56.0M (+2.57%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.Instances//instructions: +38.5M (+0.55%)
  • 🟥 build/module/Init.Control.Lawful.Lemmas//instructions: +54.2M (+7.71%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach.Instances//instructions: +57.1M (+3.58%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach.Lemmas//instructions: +51.2M (+5.03%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach//instructions: +48.2M (+9.76%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadLift.Instances//instructions: +53.9M (+4.56%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadLift.Lemmas//instructions: +40.5M (+4.64%) (reduced significance based on absolute threshold)
  • and 2476 more

mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Jul 16, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Jul 16, 2026
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Jul 16, 2026
@Kha

Kha commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

!bench

@leanprover-radar

leanprover-radar commented Jul 16, 2026

Copy link
Copy Markdown

Benchmark results for 4dd5587 against 8006bb0 are in. There are significant results. @Kha

Warning

These warnings may indicate that the benchmark results are not directly comparable, for example due to changes in the runner configuration or hardware.

  • Bench repo commit hashes for run build differ between commits.
  • Bench repo commit hashes for run other differ between commits.
  • 🟥 build//instructions: +211.3G (+1.78%)

Large changes (62✅, 10🟥)

  • build/module/Std.Data.DHashMap.Internal.RawLemmas//instructions: -91.3G (-35.72%)
  • build/module/Std.Data.DHashMap.RawLemmas//instructions: -10.9G (-7.02%)
  • build/profile/import//wall-clock: -23s (-14.40%)
  • 🟥 build/profile/interpretation//wall-clock: +15s (+14.97%)
  • build/profile/tactic execution//wall-clock: -1m 36s (-32.24%)
  • 🟥 build/stat/imported bytes//bytes: +2GiB (+7.58%)
  • compiled/incr_header_save//maxrss: -304MiB (-14.82%)
  • compiled/incr_header_save//task-clock: -439ms (-30.69%)
  • compiled/incr_header_save//wall-clock: -442ms (-30.28%)
  • elab/big_beq//maxrss: -167MiB (-9.42%)
  • elab/big_beq_rec//maxrss: -167MiB (-9.33%)
  • elab/big_deceq//maxrss: -166MiB (-9.46%)
  • elab/big_deceq_rec//maxrss: -166MiB (-9.45%)
  • elab/big_do//maxrss: -131MiB (-20.41%)
  • elab/big_match//maxrss: -167MiB (-9.36%)
  • elab/big_match_nat//maxrss: -167MiB (-9.53%)
  • elab/big_match_nat_split//maxrss: -167MiB (-9.33%)
  • elab/big_match_partial//maxrss: -169MiB (-9.34%)
  • elab/big_omega//maxrss: -125MiB (-19.00%)
  • elab/big_omega_MT//maxrss: -130MiB (-19.68%)
  • and 51 more
  • and 1 hidden

Medium changes (22✅, 20🟥)

  • 🟥 build/lakeprof/longest rebuild path//instructions: +21.7G (+3.51%)
  • build/module/Init.Data.UInt.Lemmas//instructions: -4.5G (-8.46%)
  • build/module/Std.Data.DHashMap.Internal.WF//instructions: -1.5G (-8.14%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Std.Data.DTreeMap.Internal.Lemmas//instructions: +2.4G (+1.05%)
  • 🟥 build/module/Std.Data.HashMap.RawLemmas//instructions: +1.9G (+1.71%)
  • elab/big_deceq//task-clock: -44ms (-9.00%)
  • elab/big_deceq//wall-clock: -46ms (-8.92%)
  • elab/big_deceq_rec//wall-clock: -46ms (-7.37%)
  • elab/big_match_nat//task-clock: -49ms (-9.86%)
  • elab/big_match_nat//wall-clock: -48ms (-9.28%)
  • 🟥 elab/bv_decide_rewriter//instructions: +165.5M (+1.80%)
  • elab/cbv_aes//maxrss: -133MiB (-15.43%)
  • 🟥 elab/cbv_decide//instructions: +380.2M (+0.94%)
  • 🟥 elab/cbv_dedup//instructions: +68.7M (+2.15%)
  • 🟥 elab/cbv_divisors//instructions: +512.3M (+1.05%)
  • elab/cbv_leroy//maxrss: -160MiB (-8.61%)
  • 🟥 elab/charactersIn//maxrss: +31MiB (+3.77%)
  • elab/delayed_assign//task-clock: -41ms (-9.93%)
  • elab/delayed_assign//wall-clock: -41ms (-9.91%)
  • elab/delayed_sharing//task-clock: -42ms (-11.88%)
  • and 22 more

Small changes (43✅, 2446🟥)

  • build//task-clock: -1m 26s (-4.08%)
  • 🟥 build/module/Init.BinderNameHint//instructions: +16.6M (+5.00%)
  • 🟥 build/module/Init.BinderPredicates//instructions: +63.8M (+2.91%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.ByCases//instructions: +39.7M (+4.99%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.CbvSimproc//instructions: +77.8M (+3.62%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Classical//instructions: +55.1M (+5.09%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Basic//instructions: +50.7M (+2.27%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Do//instructions: +35.9M (+6.98%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.EState//instructions: +40.3M (+5.79%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Except//instructions: +37.7M (+2.69%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.ExceptCps//instructions: +42.3M (+3.78%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Id//instructions: +28.6M (+5.96%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.Basic//instructions: +56.0M (+2.56%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.Instances//instructions: +40.9M (+0.59%)
  • 🟥 build/module/Init.Control.Lawful.Lemmas//instructions: +50.8M (+7.21%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach.Instances//instructions: +55.0M (+3.44%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach.Lemmas//instructions: +51.9M (+5.10%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach//instructions: +47.0M (+9.52%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadLift.Instances//instructions: +53.0M (+4.49%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadLift.Lemmas//instructions: +39.8M (+4.56%) (reduced significance based on absolute threshold)
  • and 2469 more

@Kha

Kha commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

!bench mathlib

@leanprover-radar

leanprover-radar commented Jul 16, 2026

Copy link
Copy Markdown

Benchmark results for leanprover-community/mathlib4-nightly-testing@e583f21 against leanprover-community/mathlib4-nightly-testing@5edfd4c are in. There are significant results. @Kha

  • 🟥 build//instructions: +7.2T (+4.75%)

Large changes (1🟥)

  • 1 hidden

Medium changes (2✅)

  • build/module/Batteries.Data.String.Lemmas//instructions: -3.5G (-10.35%)
  • build/module/Batteries.Recycling.MonadSatisfying.Array//instructions: -1.3G (-13.70%)

Small changes (3862🟥)

  • 🟥 build/module/Aesop.BuiltinRules.Assumption//instructions: +261.7M (+9.52%)
  • 🟥 build/module/Mathlib.Algebra.AddConstMap.Basic//instructions: +984.2M (+3.94%)
  • 🟥 build/module/Mathlib.Algebra.AddConstMap.Equiv//instructions: +691.3M (+8.94%)
  • 🟥 build/module/Mathlib.Algebra.AffineMonoid.Basic//instructions: +575.0M (+14.73%)
  • 🟥 build/module/Mathlib.Algebra.AffineMonoid.Embedding//instructions: +790.1M (+14.95%)
  • 🟥 build/module/Mathlib.Algebra.AffineMonoid.Irreducible//instructions: +655.7M (+7.44%)
  • 🟥 build/module/Mathlib.Algebra.AffineMonoid.UniqueSums//instructions: +743.7M (+13.45%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Bilinear//instructions: +724.4M (+4.43%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Defs//instructions: +722.4M (+6.07%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Epi//instructions: +868.8M (+6.32%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Equiv//instructions: +870.0M (+2.10%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Hom.Rat//instructions: +586.4M (+14.29%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Hom//instructions: +748.5M (+3.71%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.IsSimpleRing//instructions: +567.2M (+16.25%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.NonUnitalHom//instructions: +795.8M (+2.93%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.NonUnitalSubalgebra//instructions: +1.2G (+1.78%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Operations//instructions: +1.4G (+2.71%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Pi//instructions: +677.3M (+5.35%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Prod//instructions: +637.2M (+7.66%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Spectrum.Basic//instructions: +1.1G (+4.00%)
  • and 3842 more

@Kha

Kha commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

!bench

@Kha

Kha commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

!bench mathlib

@leanprover-radar

leanprover-radar commented Jul 16, 2026

Copy link
Copy Markdown

Benchmark results for 1bc40e1 against 8006bb0 are in. There are significant results. @Kha

Warning

These warnings may indicate that the benchmark results are not directly comparable, for example due to changes in the runner configuration or hardware.

  • Bench repo commit hashes for run build differ between commits.
  • Bench repo commit hashes for run other differ between commits.
  • 🟥 build//instructions: +227.2G (+1.92%)

Large changes (61✅, 12🟥)

  • build/module/Std.Data.DHashMap.Internal.RawLemmas//instructions: -91.3G (-35.70%)
  • build/module/Std.Data.DHashMap.RawLemmas//instructions: -10.9G (-7.01%)
  • 🟥 build/profile/interpretation//wall-clock: +18s (+17.69%)
  • build/profile/tactic execution//wall-clock: -1m 36s (-32.18%)
  • 🟥 build/stat/imported bytes//bytes: +2GiB (+7.59%)
  • compiled/incr_header_save//maxrss: -294MiB (-14.33%)
  • compiled/incr_header_save//task-clock: -397ms (-27.77%)
  • compiled/incr_header_save//wall-clock: -397ms (-27.24%)
  • elab/big_beq//maxrss: -169MiB (-9.56%)
  • elab/big_beq_rec//maxrss: -169MiB (-9.50%)
  • elab/big_deceq//maxrss: -169MiB (-9.65%)
  • elab/big_deceq_rec//maxrss: -170MiB (-9.63%)
  • elab/big_do//maxrss: -136MiB (-21.13%)
  • elab/big_match//maxrss: -170MiB (-9.50%)
  • elab/big_match_nat//maxrss: -171MiB (-9.72%)
  • elab/big_match_nat_split//maxrss: -170MiB (-9.50%)
  • elab/big_match_partial//maxrss: -169MiB (-9.38%)
  • elab/big_omega//maxrss: -131MiB (-19.85%)
  • elab/big_omega_MT//maxrss: -132MiB (-20.06%)
  • elab/big_struct//maxrss: -130MiB (-24.12%)
  • and 52 more
  • and 1 hidden

Medium changes (23✅, 16🟥)

  • 🟥 build/lakeprof/longest rebuild path//instructions: +22.5G (+3.64%)
  • build/module/Init.Data.UInt.Lemmas//instructions: -4.6G (-8.49%)
  • build/module/Std.Data.DHashMap.Internal.WF//instructions: -1.5G (-8.19%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Std.Data.DTreeMap.Internal.Lemmas//instructions: +2.3G (+1.01%)
  • 🟥 build/module/Std.Data.HashMap.RawLemmas//instructions: +2.0G (+1.71%)
  • build/profile/import//wall-clock: -18s (-11.06%)
  • elab/big_beq//task-clock: -48ms (-5.78%)
  • elab/big_deceq//task-clock: -47ms (-9.41%)
  • elab/big_deceq//wall-clock: -48ms (-9.23%)
  • elab/big_deceq_rec//wall-clock: -47ms (-7.42%)
  • elab/big_match_nat//task-clock: -52ms (-10.45%)
  • elab/big_match_nat//wall-clock: -51ms (-9.86%)
  • 🟥 elab/bv_decide_rewriter//instructions: +177.8M (+1.93%)
  • elab/cbv_aes//maxrss: -127MiB (-14.75%)
  • 🟥 elab/cbv_decide//instructions: +365.2M (+0.90%)
  • 🟥 elab/cbv_dedup//instructions: +74.4M (+2.33%)
  • elab/cbv_leroy//maxrss: -142MiB (-7.66%)
  • elab/delayed_assign//task-clock: -41ms (-10.03%)
  • elab/delayed_assign//wall-clock: -41ms (-9.79%)
  • elab/delayed_sharing//task-clock: -47ms (-13.12%)
  • and 19 more

Small changes (45✅, 2445🟥)

  • build//task-clock: -1m 18s (-3.69%)
  • 🟥 build/module/Init.BinderNameHint//instructions: +15.7M (+4.73%)
  • 🟥 build/module/Init.BinderPredicates//instructions: +68.4M (+3.12%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.ByCases//instructions: +40.7M (+5.11%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.CbvSimproc//instructions: +86.3M (+4.02%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Classical//instructions: +56.0M (+5.18%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Basic//instructions: +49.4M (+2.21%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Do//instructions: +37.0M (+7.21%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.EState//instructions: +41.7M (+5.98%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Except//instructions: +39.8M (+2.84%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.ExceptCps//instructions: +42.8M (+3.83%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Id//instructions: +28.8M (+6.01%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.Basic//instructions: +57.6M (+2.64%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.Instances//instructions: +43.3M (+0.62%)
  • 🟥 build/module/Init.Control.Lawful.Lemmas//instructions: +54.2M (+7.71%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach.Instances//instructions: +59.0M (+3.69%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach.Lemmas//instructions: +52.9M (+5.19%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach//instructions: +49.3M (+9.99%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadLift.Instances//instructions: +56.2M (+4.76%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadLift.Lemmas//instructions: +42.4M (+4.86%) (reduced significance based on absolute threshold)
  • and 2470 more

@leanprover-radar

leanprover-radar commented Jul 16, 2026

Copy link
Copy Markdown

Benchmark results for leanprover-community/mathlib4-nightly-testing@717c4e4 against leanprover-community/mathlib4-nightly-testing@5edfd4c are in. There are significant results. @Kha

  • 🟥 build//instructions: +6.9T (+4.57%)

Large changes (1🟥)

  • 1 hidden

Medium changes (2✅)

  • build/module/Batteries.Data.String.Lemmas//instructions: -3.5G (-10.41%)
  • build/module/Batteries.Recycling.MonadSatisfying.Array//instructions: -1.3G (-13.64%)

Small changes (3171🟥)

  • 🟥 build/module/Mathlib.Algebra.AddConstMap.Basic//instructions: +880.7M (+3.52%)
  • 🟥 build/module/Mathlib.Algebra.AddConstMap.Equiv//instructions: +623.8M (+8.06%)
  • 🟥 build/module/Mathlib.Algebra.AffineMonoid.Basic//instructions: +519.1M (+13.30%)
  • 🟥 build/module/Mathlib.Algebra.AffineMonoid.Embedding//instructions: +757.0M (+14.32%)
  • 🟥 build/module/Mathlib.Algebra.AffineMonoid.Irreducible//instructions: +603.5M (+6.85%)
  • 🟥 build/module/Mathlib.Algebra.AffineMonoid.UniqueSums//instructions: +721.2M (+13.04%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Bilinear//instructions: +706.7M (+4.32%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Hom.Rat//instructions: +546.0M (+13.31%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Hom//instructions: +751.9M (+3.72%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.NonUnitalHom//instructions: +748.3M (+2.75%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.NonUnitalSubalgebra//instructions: +1.2G (+1.75%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Operations//instructions: +1.5G (+2.75%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Pi//instructions: +633.7M (+5.00%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Prod//instructions: +668.6M (+8.03%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Spectrum.Quasispectrum//instructions: +1.0G (+3.07%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.StrictPositivity//instructions: +798.8M (+10.34%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Subalgebra.Basic//instructions: +1.1G (+2.41%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Subalgebra.Directed//instructions: +678.6M (+5.67%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Subalgebra.IsSimpleOrder//instructions: +742.5M (+12.44%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Subalgebra.Lattice//instructions: +1.2G (+2.78%)
  • and 3151 more

@Kha

Kha commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

!bench

@leanprover-radar

leanprover-radar commented Jul 17, 2026

Copy link
Copy Markdown

Benchmark results for 61fdbb4 against 8006bb0 are in. There are significant results. @Kha

Warning

These warnings may indicate that the benchmark results are not directly comparable, for example due to changes in the runner configuration or hardware.

  • Bench repo commit hashes for run build differ between commits.
  • Bench repo commit hashes for run other differ between commits.
  • 🟥 build//instructions: +98.3G (+0.83%)

Large changes (73✅, 12🟥)

  • build/module/Std.Data.DHashMap.Internal.RawLemmas//instructions: -90.8G (-35.51%)
  • build/module/Std.Data.DHashMap.RawLemmas//instructions: -9.4G (-6.08%)
  • build/profile/import//wall-clock: -46s (-28.38%)
  • 🟥 build/profile/interpretation//wall-clock: +15s (+14.88%)
  • build/profile/tactic execution//wall-clock: -1m 36s (-32.05%)
  • 🟥 build/stat/imported bytes//bytes: +2GiB (+9.52%)
  • compiled/incr_header_save//maxrss: -165MiB (-8.03%)
  • compiled/incr_header_save//task-clock: -243ms (-16.98%)
  • compiled/incr_header_save//wall-clock: -242ms (-16.57%)
  • elab/big_beq//maxrss: -84MiB (-4.76%)
  • elab/big_beq_rec//maxrss: -86MiB (-4.84%)
  • elab/big_deceq//maxrss: -83MiB (-4.72%)
  • elab/big_deceq//task-clock: -66ms (-13.42%)
  • elab/big_deceq//wall-clock: -68ms (-13.11%)
  • elab/big_deceq_rec//maxrss: -85MiB (-4.80%)
  • elab/big_do//maxrss: -140MiB (-21.86%)
  • elab/big_match//maxrss: -85MiB (-4.73%)
  • elab/big_match_nat//maxrss: -87MiB (-4.98%)
  • elab/big_match_nat//task-clock: -69ms (-14.03%)
  • elab/big_match_nat//wall-clock: -68ms (-13.16%)
  • and 65 more

Medium changes (42✅, 9🟥)

  • 🟥 build/lakeprof/longest rebuild path//instructions: +17.9G (+2.90%)
  • build/module/Init.Data.UInt.Lemmas//instructions: -4.4G (-8.26%)
  • build/module/Std.Data.DHashMap.Internal.WF//instructions: -1.3G (-6.92%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Std.Data.DTreeMap.Internal.Lemmas//instructions: +2.4G (+1.03%)
  • 🟥 build/module/Std.Data.HashMap.RawLemmas//instructions: +2.0G (+1.75%)
  • elab/big_beq//instructions: -148.5M (-1.68%)
  • elab/big_beq//task-clock: -66ms (-7.89%)
  • elab/big_beq//wall-clock: -63ms (-7.42%)
  • elab/big_beq_rec//instructions: -156.1M (-0.98%)
  • elab/big_beq_rec//task-clock: -71ms (-5.58%)
  • elab/big_beq_rec//wall-clock: -72ms (-5.59%)
  • elab/big_deceq//instructions: -158.5M (-3.78%)
  • elab/big_deceq_rec//instructions: -155.4M (-2.76%)
  • elab/big_deceq_rec//task-clock: -62ms (-10.16%)
  • elab/big_deceq_rec//wall-clock: -63ms (-10.05%)
  • elab/big_match//instructions: -157.8M (-1.52%)
  • elab/big_match//task-clock: -70ms (-7.72%)
  • elab/big_match//wall-clock: -69ms (-7.41%)
  • elab/big_match_nat//instructions: -147.2M (-3.12%)
  • elab/big_match_partial//instructions: -123.3M (-0.89%)
  • and 30 more
  • and 1 hidden

Small changes (45✅, 2388🟥)

  • build//task-clock: -1m 35s (-4.51%)
  • 🟥 build/module/Init.BinderNameHint//instructions: +14.2M (+4.26%)
  • 🟥 build/module/Init.BinderPredicates//instructions: +52.4M (+2.39%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.ByCases//instructions: +29.8M (+3.74%)
  • 🟥 build/module/Init.CbvSimproc//instructions: +50.2M (+2.34%)
  • 🟥 build/module/Init.Classical//instructions: +38.1M (+3.52%)
  • 🟥 build/module/Init.Control.Basic//instructions: +43.5M (+1.95%)
  • 🟥 build/module/Init.Control.Do//instructions: +27.1M (+5.27%)
  • 🟥 build/module/Init.Control.EState//instructions: +30.5M (+4.38%)
  • 🟥 build/module/Init.Control.Except//instructions: +31.1M (+2.21%)
  • 🟥 build/module/Init.Control.ExceptCps//instructions: +34.0M (+3.04%)
  • 🟥 build/module/Init.Control.Id//instructions: +20.0M (+4.18%)
  • 🟥 build/module/Init.Control.Lawful.Basic//instructions: +44.8M (+2.05%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.Instances//instructions: +36.9M (+0.53%)
  • 🟥 build/module/Init.Control.Lawful.Lemmas//instructions: +35.2M (+5.01%)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach.Instances//instructions: +39.3M (+2.46%)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach.Lemmas//instructions: +34.0M (+3.34%)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach//instructions: +26.8M (+5.43%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadLift.Instances//instructions: +38.8M (+3.29%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadLift.Lemmas//instructions: +31.8M (+3.64%)
  • and 2413 more

@Kha

Kha commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

!bench

@leanprover-radar

leanprover-radar commented Jul 17, 2026

Copy link
Copy Markdown

Benchmark results for 9d845af against 8006bb0 are in. There are significant results. @Kha

Warning

These warnings may indicate that the benchmark results are not directly comparable, for example due to changes in the runner configuration or hardware.

  • Bench repo commit hashes for run build differ between commits.
  • Bench repo commit hashes for run other differ between commits.
  • 🟥 build//instructions: +151.3G (+1.28%)

Large changes (65✅, 12🟥)

  • build/module/Std.Data.DHashMap.Internal.RawLemmas//instructions: -90.7G (-35.49%)
  • build/module/Std.Data.DHashMap.RawLemmas//instructions: -9.4G (-6.07%)
  • build/profile/import//wall-clock: -38s (-23.85%)
  • 🟥 build/profile/interpretation//wall-clock: +16s (+15.27%)
  • build/profile/tactic execution//wall-clock: -1m 34s (-31.40%)
  • 🟥 build/stat/imported bytes//bytes: +2GiB (+9.52%)
  • compiled/incr_header_save//maxrss: -149MiB (-7.25%)
  • compiled/incr_header_save//task-clock: -222ms (-15.54%)
  • compiled/incr_header_save//wall-clock: -224ms (-15.34%)
  • elab/big_beq//maxrss: -67MiB (-3.79%)
  • elab/big_beq_rec//maxrss: -68MiB (-3.83%)
  • elab/big_deceq//maxrss: -69MiB (-3.92%)
  • elab/big_deceq_rec//maxrss: -67MiB (-3.80%)
  • elab/big_do//maxrss: -133MiB (-20.77%)
  • elab/big_match//maxrss: -69MiB (-3.84%)
  • elab/big_match_nat//maxrss: -70MiB (-4.01%)
  • elab/big_match_nat//task-clock: -59ms (-11.84%)
  • elab/big_match_nat//wall-clock: -56ms (-10.94%)
  • elab/big_match_nat_split//maxrss: -67MiB (-3.77%)
  • elab/big_match_partial//maxrss: -68MiB (-3.79%)
  • and 57 more

Medium changes (20✅, 12🟥)

  • 🟥 build/lakeprof/longest rebuild path//instructions: +20.2G (+3.27%)
  • build/module/Init.Data.UInt.Lemmas//instructions: -4.5G (-8.29%)
  • build/module/Std.Data.DHashMap.Internal.WF//instructions: -1.3G (-6.82%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Std.Data.DTreeMap.Internal.Lemmas//instructions: +2.3G (+0.99%)
  • 🟥 build/module/Std.Data.HashMap.RawLemmas//instructions: +2.0G (+1.77%)
  • 🟥 build/profile/elaboration//wall-clock: +14s (+6.27%)
  • elab/big_deceq//task-clock: -52ms (-10.46%)
  • elab/big_deceq//wall-clock: -49ms (-9.59%)
  • elab/big_deceq_rec//task-clock: -50ms (-8.21%)
  • elab/big_deceq_rec//wall-clock: -49ms (-7.84%)
  • elab/bv_decide_mod//maxrss: -213MiB (-9.58%)
  • elab/cbv_aes//maxrss: -124MiB (-14.37%)
  • elab/delayed_assign//task-clock: -47ms (-11.46%)
  • elab/delayed_assign//wall-clock: -49ms (-11.66%)
  • 🟥 elab/grind_bitvec2//instructions: +1.9G (+1.32%)
  • 🟥 elab/grind_list2//instructions: +480.5M (+1.10%)
  • 🟥 elab/iterators//instructions: +59.8M (+2.39%)
  • elab/reduceMatch//wall-clock: -63ms (-8.34%)
  • elab/riscv-ast//maxrss: -189MiB (-14.23%)
  • elab/simp_congr//maxrss: -110MiB (-18.01%)
  • and 11 more
  • and 1 hidden

Small changes (52✅, 2444🟥)

  • build//task-clock: -1m 17s (-3.67%)
  • 🟥 build/module/Init.BinderNameHint//instructions: +16.1M (+4.85%)
  • 🟥 build/module/Init.BinderPredicates//instructions: +56.3M (+2.57%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.ByCases//instructions: +33.1M (+4.15%)
  • 🟥 build/module/Init.CbvSimproc//instructions: +64.6M (+3.01%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Classical//instructions: +42.9M (+3.97%)
  • 🟥 build/module/Init.Control.Basic//instructions: +44.8M (+2.00%)
  • 🟥 build/module/Init.Control.Do//instructions: +29.2M (+5.68%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.EState//instructions: +32.2M (+4.63%)
  • 🟥 build/module/Init.Control.Except//instructions: +34.1M (+2.43%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.ExceptCps//instructions: +36.7M (+3.28%)
  • 🟥 build/module/Init.Control.Id//instructions: +22.5M (+4.68%)
  • 🟥 build/module/Init.Control.Lawful.Basic//instructions: +49.2M (+2.25%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.Instances//instructions: +40.5M (+0.58%)
  • 🟥 build/module/Init.Control.Lawful.Lemmas//instructions: +39.5M (+5.61%)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach.Instances//instructions: +45.6M (+2.85%)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach.Lemmas//instructions: +39.3M (+3.86%)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach//instructions: +32.1M (+6.51%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadLift.Instances//instructions: +44.3M (+3.75%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadLift.Lemmas//instructions: +33.3M (+3.82%)
  • and 2476 more

The constants view was still merged eagerly at import because conflicting declarations must be reported then. Split the two concerns: the view is now merged lazily like the extra-constants view, with the subsumption rule for names declared by several modules applied inline when a node's entry is first accessed, and conflict detection runs as a separate check over a duplicate sweep that walks only name prefixes occurring in several modules.

The check exempts module pairs certified by one of the import's direct imports: replaying the loader's level propagation from each direct import's perspective (bit-parallel over one reverse pass of the topologically sorted modules) shows which modules' data that import's own compile loaded, and at which level; pairs it loaded at the current import's levels were checked by that compile, recursively down to each pair's first co-importer. The sweep skips certified subtrees, so module-system compiles pay almost nothing; compiles without the module system re-check name universes no prior compile loaded, such as non-public names of module-system dependencies.

Locally, module-file compiles drop to the lazy merge's numbers (`Init.Data.Sum` -4.5% instructions vs the eager merge) and a clean stdlib rebuild is unchanged; a non-module `import Lean` pays the full check (+1.6%) as its `all`-level universe has no certifier. Validated by the full-stdlib trie oracle, the duplicate-sweep-vs-eager-merge equivalence check, and the leanchecker conflict suite including the level-escalation case `PrivateConflictC`; `ReplaceAxiom` now passes the environment's IR extension state through to its rebuilt environment as code generation of its own module accesses it.

Co-Authored-By: Claude
@Kha

Kha commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

!bench

@leanprover-radar

leanprover-radar commented Jul 17, 2026

Copy link
Copy Markdown

Benchmark results for 5d27b34 against 8006bb0 are in. There are significant results. @Kha

Warning

These warnings may indicate that the benchmark results are not directly comparable, for example due to changes in the runner configuration or hardware.

  • Bench repo commit hashes for run build differ between commits.
  • Bench repo commit hashes for run other differ between commits.
  • 🟥 build//instructions: +123.0G (+1.04%)

Large changes (67✅, 12🟥)

  • build/module/Std.Data.DHashMap.Internal.RawLemmas//instructions: -90.6G (-35.44%)
  • build/module/Std.Data.DHashMap.RawLemmas//instructions: -9.3G (-6.03%)
  • build/profile/import//wall-clock: -46s (-28.45%)
  • 🟥 build/profile/interpretation//wall-clock: +14s (+13.48%)
  • build/profile/tactic execution//wall-clock: -1m 36s (-32.04%)
  • 🟥 build/stat/imported bytes//bytes: +2GiB (+9.54%)
  • compiled/incr_header_save//maxrss: -190MiB (-9.24%)
  • compiled/incr_header_save//task-clock: -410ms (-28.61%)
  • compiled/incr_header_save//wall-clock: -411ms (-28.19%)
  • elab/big_beq//maxrss: -67MiB (-3.76%)
  • elab/big_beq_rec//maxrss: -66MiB (-3.72%)
  • elab/big_deceq//maxrss: -66MiB (-3.78%)
  • elab/big_deceq//task-clock: -57ms (-11.47%)
  • elab/big_deceq//wall-clock: -56ms (-10.80%)
  • elab/big_deceq_rec//maxrss: -66MiB (-3.77%)
  • elab/big_do//maxrss: -137MiB (-21.36%)
  • elab/big_match//maxrss: -67MiB (-3.72%)
  • elab/big_match_nat//maxrss: -68MiB (-3.89%)
  • elab/big_match_nat//task-clock: -60ms (-12.16%)
  • elab/big_match_nat_split//maxrss: -68MiB (-3.77%)
  • and 59 more

Medium changes (24✅, 17🟥)

  • 🟥 build/lakeprof/longest rebuild path//instructions: +20.5G (+3.30%)
  • build/module/Init.Data.UInt.Lemmas//instructions: -4.4G (-8.26%)
  • build/module/Std.Data.DHashMap.Internal.WF//instructions: -1.2G (-6.72%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Std.Data.DTreeMap.Internal.Lemmas//instructions: +2.5G (+1.10%)
  • 🟥 build/module/Std.Data.HashMap.RawLemmas//instructions: +2.0G (+1.80%)
  • elab/big_beq//task-clock: -57ms (-6.76%)
  • elab/big_beq//wall-clock: -55ms (-6.42%)
  • elab/big_deceq_rec//task-clock: -53ms (-8.58%)
  • elab/big_deceq_rec//wall-clock: -53ms (-8.33%)
  • elab/big_match//task-clock: -62ms (-6.79%)
  • elab/big_match//wall-clock: -61ms (-6.58%)
  • elab/big_match_nat//wall-clock: -59ms (-11.37%)
  • elab/bv_decide_mod//maxrss: -213MiB (-9.56%)
  • 🟥 elab/bv_decide_rewriter//instructions: +163.6M (+1.78%)
  • elab/cbv_aes//maxrss: -125MiB (-14.49%)
  • 🟥 elab/cbv_decide//instructions: +365.7M (+0.90%)
  • elab/cbv_decide//maxrss: -62MiB (-3.41%)
  • 🟥 elab/cbv_dedup//instructions: +49.8M (+1.56%)
  • 🟥 elab/cbv_divisors//instructions: +535.1M (+1.09%)
  • elab/delayed_assign//task-clock: -47ms (-11.36%)
  • and 20 more
  • and 1 hidden

Small changes (50✅, 2420🟥)

  • build//task-clock: -1m 38s (-4.66%)
  • 🟥 build/module/Init.BinderNameHint//instructions: +12.7M (+3.81%)
  • 🟥 build/module/Init.BinderPredicates//instructions: +58.1M (+2.65%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.ByCases//instructions: +31.6M (+3.97%)
  • 🟥 build/module/Init.CbvSimproc//instructions: +56.1M (+2.61%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Classical//instructions: +41.5M (+3.83%)
  • 🟥 build/module/Init.Control.Basic//instructions: +46.0M (+2.06%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Do//instructions: +27.4M (+5.33%)
  • 🟥 build/module/Init.Control.EState//instructions: +30.7M (+4.42%)
  • 🟥 build/module/Init.Control.Except//instructions: +33.6M (+2.39%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.ExceptCps//instructions: +34.2M (+3.06%)
  • 🟥 build/module/Init.Control.Id//instructions: +20.8M (+4.33%)
  • 🟥 build/module/Init.Control.Lawful.Basic//instructions: +48.2M (+2.21%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.Instances//instructions: +42.1M (+0.60%)
  • 🟥 build/module/Init.Control.Lawful.Lemmas//instructions: +36.3M (+5.17%)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach.Instances//instructions: +43.3M (+2.71%)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach.Lemmas//instructions: +37.9M (+3.72%)
  • 🟥 build/module/Init.Control.Lawful.MonadAttach//instructions: +29.0M (+5.87%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadLift.Instances//instructions: +40.6M (+3.44%) (reduced significance based on absolute threshold)
  • 🟥 build/module/Init.Control.Lawful.MonadLift.Lemmas//instructions: +31.0M (+3.55%)
  • and 2450 more

@Kha

Kha commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

!bench mathlib

@leanprover-radar

leanprover-radar commented Jul 17, 2026

Copy link
Copy Markdown

Benchmark results for leanprover-community/mathlib4-nightly-testing@8d7209e against leanprover-community/mathlib4-nightly-testing@5edfd4c are in. There are significant results. @Kha

  • 🟥 build//instructions: +3.3T (+2.21%)

Large changes (1🟥)

  • 1 hidden

Medium changes (2✅)

  • build/module/Batteries.Data.String.Lemmas//instructions: -3.3G (-9.96%)
  • build/module/Batteries.Recycling.MonadSatisfying.Array//instructions: -1.4G (-14.18%)

Small changes (2✅, 103🟥)

  • build/module/Batteries.Lean.Meta.Simp//instructions: -321.0M (-10.34%)
  • 🟥 build/module/Mathlib.Algebra.Algebra.Subalgebra.Basic//instructions: +745.6M (+1.59%)
  • 🟥 build/module/Mathlib.Algebra.Category.ModuleCat.Presheaf.PushforwardZeroMonoidal//instructions: +1.4G (+1.32%)
  • 🟥 build/module/Mathlib.Algebra.Order.Field.Basic//instructions: +1.1G (+2.24%)
  • 🟥 build/module/Mathlib.Algebra.Order.Floor.Ring//instructions: +1.2G (+2.38%)
  • 🟥 build/module/Mathlib.Algebra.Order.Group.Pointwise.Interval//instructions: +983.7M (+1.86%)
  • 🟥 build/module/Mathlib.Algebra.Order.Ring.StandardPart//instructions: +2.1G (+2.36%)
  • 🟥 build/module/Mathlib.Algebra.Order.ToIntervalMod//instructions: +1.3G (+1.64%)
  • 🟥 build/module/Mathlib.Algebra.SkewMonoidAlgebra.Basic//instructions: +1.0G (+1.66%)
  • 🟥 build/module/Mathlib.Algebra.TrivSqZeroExt.Basic//instructions: +1.2G (+1.67%)
  • 🟥 build/module/Mathlib.AlgebraicGeometry.AffineTransitionLimit//instructions: +3.9G (+1.83%)
  • 🟥 build/module/Mathlib.AlgebraicGeometry.IdealSheaf.Basic//instructions: +1.6G (+2.20%)
  • 🟥 build/module/Mathlib.AlgebraicGeometry.Modules.Sheaf//instructions: +4.3G (+1.93%)
  • 🟥 build/module/Mathlib.AlgebraicGeometry.Modules.Tilde//instructions: +5.6G (+1.84%)
  • 🟥 build/module/Mathlib.Analysis.Analytic.CPolynomialDef//instructions: +1.2G (+2.26%)
  • 🟥 build/module/Mathlib.Analysis.CStarAlgebra.ApproximateUnit//instructions: +1.7G (+2.42%)
  • 🟥 build/module/Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Basic//instructions: +2.0G (+2.54%)
  • 🟥 build/module/Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Instances//instructions: +2.3G (+2.46%)
  • 🟥 build/module/Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order//instructions: +2.6G (+2.26%)
  • 🟥 build/module/Mathlib.Analysis.CStarAlgebra.GelfandDuality//instructions: +1.6G (+2.37%)
  • and 85 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan builds-manual CI has verified that the Lean Language Reference builds against this PR mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants