Skip to content

feat: extract simple array literals as static initializers#12724

Merged
hargoniX merged 2 commits intomasterfrom
hbv/simple_ground_array_literals
Feb 27, 2026
Merged

feat: extract simple array literals as static initializers#12724
hargoniX merged 2 commits intomasterfrom
hbv/simple_ground_array_literals

Conversation

@hargoniX
Copy link
Contributor

@hargoniX hargoniX commented Feb 27, 2026

This PR implements support for extracting simple ground array literals into statically initialized data.

@hargoniX
Copy link
Contributor Author

!bench

@leanprover-radar
Copy link

leanprover-radar commented Feb 27, 2026

Benchmark results for a7dbf89 against 9843794 are in! @hargoniX

  • build//instructions: -2.0G (-0.02%)

Large changes (3✅, 1🟥)

  • compiled/binarytrees.st//instructions: -43.9M (-0.07%)
  • 🟥 compiled/qsort//instructions: +192.7M (+1.15%)
  • size/compile/.out//bytes: -27MiB (-1.40%)
  • size/libleanshared.so//bytes: -879kiB (-0.61%)

Medium changes (1✅)

  • compiled/hashmap//instructions: -3.4M (-0.09%)

Small changes (2✅, 4🟥)

  • 🟥 build/module/Init.Data.Nat.SOM//instructions: +278.0M (+1.24%)
  • 🟥 build/module/Lean.Compiler.IR.EmitC//instructions: +192.6M (+1.54%) (reduced significance based on *//lines)
  • 🟥 compiled/liasolver//instructions: +2.8M (+0.07%)
  • 🟥 compiled/unionfind//instructions: +3.0M (+0.01%)
  • compiled/workspaceSymbolsNewRanges//instructions: -7.6M (-1.02%)
  • size/install//bytes: -5MiB (-0.23%)

@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Feb 27, 2026
@mathlib-lean-pr-testing
Copy link

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 9843794e3f269b65bdce1fc72c373b77b8442750 --onto 87ec768a509c45987a7d73258da0cc1ef047925c. You can force Mathlib CI using the force-mathlib-ci label. (2026-02-27 14:00:16)

@leanprover-bot
Copy link
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 9843794e3f269b65bdce1fc72c373b77b8442750 --onto 8038a8b8904f89ad9542c8eda11379f8f006eab1. You can force reference manual CI using the force-manual-ci label. (2026-02-27 14:00:17)

@hargoniX hargoniX force-pushed the hbv/simple_ground_array_literals branch from 3961b69 to c15b0ca Compare February 27, 2026 16:57
@hargoniX hargoniX added changelog-compiler Compiler, runtime, and FFI release-ci Enable all CI checks for a PR, like is done for releases labels Feb 27, 2026
@hargoniX
Copy link
Contributor Author

!bench

@leanprover-radar
Copy link

leanprover-radar commented Feb 27, 2026

Benchmark results for c15b0ca against 81a5eb5 are in! @hargoniX

  • build//instructions: -1.6G (-0.01%)

Large changes (2✅, 1🟥)

  • compiled/binarytrees.st//instructions: -35.0M (-0.05%)
  • 🟥 compiled/qsort//instructions: +193.2M (+1.15%)
  • size/compile/.out//bytes: -20MiB (-1.04%)

Medium changes (2✅)

  • compiled/liasolver//instructions: -21.5M (-0.52%)
  • size/libleanshared.so//bytes: -587kiB (-0.41%)

Small changes (2✅, 3🟥)

  • 🟥 build/module/Lean.Compiler.IR.EmitC//instructions: +166.7M (+1.33%) (reduced significance based on *//lines)
  • 🟥 build/module/Lean.Compiler.LCNF.SimpleGroundExpr//instructions: +1.8G (+26.36%) (reduced significance based on *//lines)
  • compiled/hashmap//instructions: -2.2M (-0.06%)
  • 🟥 compiled/unionfind//instructions: +4.8M (+0.02%)
  • compiled/workspaceSymbolsNewRanges//instructions: -6.1M (-0.82%)

@hargoniX hargoniX marked this pull request as ready for review February 27, 2026 16:59
@hargoniX hargoniX requested a review from leodemoura as a code owner February 27, 2026 16:59
@leanprover-radar
Copy link

Benchmark results for c15b0ca against 81a5eb5 are in! @hargoniX

  • build//instructions: -1.6G (-0.01%)

Large changes (2✅, 1🟥)

  • compiled/binarytrees.st//instructions: -35.0M (-0.05%)
  • 🟥 compiled/qsort//instructions: +193.2M (+1.15%)
  • size/compile/.out//bytes: -20MiB (-1.04%)

Medium changes (2✅)

  • compiled/liasolver//instructions: -21.5M (-0.52%)
  • size/libleanshared.so//bytes: -587kiB (-0.41%)

Small changes (2✅, 3🟥)

  • 🟥 build/module/Lean.Compiler.IR.EmitC//instructions: +166.7M (+1.33%) (reduced significance based on *//lines)
  • 🟥 build/module/Lean.Compiler.LCNF.SimpleGroundExpr//instructions: +1.8G (+26.36%) (reduced significance based on *//lines)
  • compiled/hashmap//instructions: -2.2M (-0.06%)
  • 🟥 compiled/unionfind//instructions: +4.8M (+0.02%)
  • compiled/workspaceSymbolsNewRanges//instructions: -6.1M (-0.82%)

@hargoniX hargoniX force-pushed the hbv/simple_ground_array_literals branch from c15b0ca to 0a17d13 Compare February 27, 2026 17:42
@hargoniX hargoniX removed the release-ci Enable all CI checks for a PR, like is done for releases label Feb 27, 2026
@hargoniX hargoniX force-pushed the hbv/simple_ground_array_literals branch from 0a17d13 to d683ac0 Compare February 27, 2026 18:23
@hargoniX hargoniX enabled auto-merge February 27, 2026 18:23
@hargoniX hargoniX disabled auto-merge February 27, 2026 18:33
@hargoniX hargoniX force-pushed the hbv/simple_ground_array_literals branch from d683ac0 to ef9ff5e Compare February 27, 2026 18:33
@hargoniX hargoniX enabled auto-merge February 27, 2026 18:34
@hargoniX hargoniX added this pull request to the merge queue Feb 27, 2026
Merged via the queue into master with commit 2e9e5db Feb 27, 2026
15 checks passed
@hargoniX hargoniX deleted the hbv/simple_ground_array_literals branch February 27, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-compiler Compiler, runtime, and FFI 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