Skip to content

perf: forward and backward borrow propagation is non-forced#13066

Merged
hargoniX merged 1 commit intomasterfrom
hbv/non_forced_propagation
Mar 23, 2026
Merged

perf: forward and backward borrow propagation is non-forced#13066
hargoniX merged 1 commit intomasterfrom
hbv/non_forced_propagation

Conversation

@hargoniX
Copy link
Copy Markdown
Contributor

@hargoniX hargoniX commented Mar 23, 2026

This PR changes the behavior of forward and backward projection propagation in the context of user defined borrows. The reason to have them be "forced" override (i.e. override user annotations as well) was that a user annotated borrowed value can potentially flow into a reset-reuse transitively through a projection and must thus have accurate reference count. The reasons that this is no longer necessary are:

  1. Forward never had to be forced anyways, it can only affect the z in let z := oproj x i which can't be annotated by a user
  2. Backward is no longer necessary as the forward propagator for user annotations prevents the reset-reuse insertion from working with values that have user defined borrow annotations entirely.

@hargoniX
Copy link
Copy Markdown
Contributor Author

!bench

@leanprover-radar
Copy link
Copy Markdown

leanprover-radar commented Mar 23, 2026

Benchmark results for 040275c against b5036e4 are in. There are no significant changes. @hargoniX

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

Small changes (3✅)

  • build/profile/interpretation//wall-clock: -307ms (-6.08%)
  • size/compile/.out//bytes: -5MiB (-0.27%)
  • size/libleanshared.so//bytes: -300kiB (-0.21%)

@hargoniX hargoniX added changelog-compiler Compiler, runtime, and FFI release-ci Enable all CI checks for a PR, like is done for releases labels Mar 23, 2026
@hargoniX hargoniX marked this pull request as ready for review March 23, 2026 21:39
@hargoniX hargoniX requested a review from leodemoura as a code owner March 23, 2026 21:39
@hargoniX hargoniX enabled auto-merge March 23, 2026 21:39
@hargoniX hargoniX added this pull request to the merge queue Mar 23, 2026
@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 Mar 23, 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 b5036e4d81b399447a5c9f684da2d46d84910854 --onto 4bf7fa7447eea00cecba8327bb9c9e5f4485f0a7. You can force Mathlib CI using the force-mathlib-ci label. (2026-03-23 21:43:27)

@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 b5036e4d81b399447a5c9f684da2d46d84910854 --onto cfa8c5a036d6990635c6ec50b02d0e806995cec3. You can force reference manual CI using the force-manual-ci label. (2026-03-23 21:43:28)

Merged via the queue into master with commit fb1dc91 Mar 23, 2026
44 of 47 checks passed
@hargoniX hargoniX deleted the hbv/non_forced_propagation branch March 23, 2026 22:02
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 release-ci Enable all CI checks for a PR, like is done for releases 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