fix: do not count kernel checking toward the elaborator's `maxHeartbeats` limit This PR makes kernel type checking never count toward the elaborator's `maxHeartbeats` limit of the enclosing command. Previously, the kernel's allocations counted toward it only when a declaration happened to be checked synchronously on the elaboration thread, so the same kernel work was charged to some commands and not to others. The kernel's own `maxHeartbeats` limit per declaration is unaffected. `lean_add_decl` and `lean_elab_add_decl` now restore the thread-local allocation count read by `IO.getNumHeartbeats` on exit, using the new `scope_restore_num_heartbeats`. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This is the repository for Lean 4.
See Install Lean.
Please read our Contribution Guidelines first.
See Building Lean.