Skip to content

fix: support macro_inline on csimp-ed declarations - #14791

Merged
hargoniX merged 1 commit into
masterfrom
hbv/compiler_csimp_macro_inline
Aug 18, 2026
Merged

hargoniX merged 1 commit into
masterfrom
hbv/compiler_csimp_macro_inline

Conversation

@hargoniX

Copy link
Copy Markdown
Member

This PR makes the compiler macro_inline results of csimp lemmas.

@hargoniX
hargoniX requested a review from leodemoura as a code owner August 14, 2026 17:12
@hargoniX hargoniX added the changelog-compiler Compiler, runtime, and FFI label Aug 14, 2026
@hargoniX

Copy link
Copy Markdown
Member Author

!bench

@leanprover-radar

leanprover-radar commented Aug 14, 2026 •

Copy link
Copy Markdown

Benchmark results for 8b2e7c7 against 1239205 are in. No significant results found. @hargoniX

  • 🟥 build//instructions: +636.5M (+0.01%)

Small changes (2✅)

  • ✅ build/module/Init.Data.Repr//instructions: -17.2M (-0.95%)
  • ✅ vcgen/MatchIota/1500/vcgen//wall-clock: -13ms (-6.45%)

@Rob23oba

Rob23oba commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

One thing I thought of doing was to run CSimp.replaceConstant inside of macroInline (or I guess more precisely, one thing I did in #14626). I don't know the performance implications but that sounds like it would be the right thing to do to make sure that even longer chains of csimp and macro_inline work.
Edit: I don't know the precise performance implications of that though but maybe worth trying

@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 Aug 14, 2026
@mathlib-lean-pr-testing

Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 12392058ad1e8a6da2d76abe60640a4f3bc5f7fd --onto def75fdfc2f92326e0e42d3380fe9434f80f3ffd. You can force Mathlib CI using the force-mathlib-ci label. (2026-08-14 17:32:36)

@leanprover-bot

Copy link
Copy Markdown
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 12392058ad1e8a6da2d76abe60640a4f3bc5f7fd --onto 3fc29d37a70f8fd904ebab848557c12383543008. You can force reference manual CI using the force-manual-ci label. (2026-08-14 17:32:38)

@hargoniX
hargoniX added this pull request to the merge queue Aug 18, 2026
Merged via the queue into master with commit 9319b09 Aug 18, 2026
25 checks passed
TwoFX pushed a commit that referenced this pull request Aug 18, 2026
This PR makes the compiler `macro_inline` results of `csimp` lemmas.

(cherry picked from commit 9319b09)
FawadHa1der added a commit to FawadHa1der/lean4 that referenced this pull request Oct 23, 2026
298 upstream commits. The line's merge base with v4.35.0 is master (leanprover#14729); the line also carries the
v4.34.0 release branch's backports (leanprover#14788, leanprover#14791, leanprover#14833, leanprover#14838, leanprover#14849, leanprover#14477's intrinsic-
verification change, leanprover#14938, leanprover#15104), which v4.35.0 holds as the master originals, several reworked
since. Eighteen files conflicted; how each was resolved:

- Upstream-only files (no fork commit touches them): v4.35.0's version, byte for byte —
  CMakeLists.txt (version 4.35), src/Init/{Core,Prelude}.lean, src/Lean/Compiler/LCNF/ToDecl.lean,
  src/Lean/Elab/{BuiltinDo/For,Do/Basic,Tactic/Do/Contract}.lean, src/Lean/Server/InfoUtils.lean
  (drops the v4.34.0-only backport leanprover#15104, which v4.35.0 does not carry), tests/elab/
  {csimp_macroinline,experimentalIntrinsic,intrinsicVerification}.lean; tests/elab/14383.lean (a
  v4.34.0-backport test v4.35.0 does not have) removed. Afterwards every upstream-only file equals
  v4.35.0; the 57 files that differ are the fork's own.
- src/include/lean/lean.h, src/runtime/object.cpp: the conflicts were upstream's reference-count
  ("sticky"/rc_model) code against its v4.34.0 backport: v4.35.0's side; the line's older
  lean_dec_ref_cold (backport, with LEAN_LAZY_RC, which v4.35.0 removed) deleted so v4.35.0's is the
  only one. Kept: the fork's pointer-width LEAN_SCALAR_PTR_LITERAL (lean.h) and task manager
  (0035/0038, object.cpp) — each file now differs from v4.35.0 by exactly those.
- src/stdlib.make.in: the `lean` link keeps the fork's ${LEAN_WASM_SYMTAB} (0039) and takes
  upstream's new ${CMAKE_DYN_EXE_LINKER_FLAGS_MAKE} (leanprover#14884), which is empty under Emscripten
  (-rdynamic and the shared libraries are added only outside it) and needed by native64.
- src/Lean/Shell.lean: both imports (the fork's Lean.Compiler.InitAttr, upstream's Std.Async.Process).
- src/runtime/uv/event_loop.cpp: v4.35.0's line (a comment differed).
- .github/workflows/{build-template,ci}.yml: the fork's CI.
- stage0/: v4.35.0's, with the line's two pointer-width gates re-applied by hand (the patch's context
  moved); wasm64-build/stage0-line-edits.patch refreshed from `git diff --text v4.35.0 -- stage0`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport releases/v4.34.0 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.

5 participants