Repository navigation
perf: replay tactics when only trailing whitespace is changed - #11958
Conversation
|
!bench |
|
Benchmark results for d23b858 against d92cdae are in! @Kha Small changes (4🟥)
|
|
Reference manual CI status:
|
|
Mathlib CI status (docs):
|
1b4ea22 to
f8fff06
Compare
|
Mathlib CI status (docs):
|
fix: command-level info tree
… but for future-proofing
|
!bench |
|
Benchmark results for 0c2b5e1 against 4792cd2 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.
Large changes (9🟥)
Medium changes (3🟥)
Small changes (2✅, 17🟥)
|
|
!bench |
This comment was marked as outdated.
This comment was marked as outdated.
|
!bench |
This comment was marked as outdated.
This comment was marked as outdated.
|
!bench |
|
Benchmark results for 7cfe500 against 0a8abcb are in. There are significant results. @Kha
Large changes (1✅, 1🟥)
Medium changes (1✅, 2🟥)
Small changes (6✅, 27🟥) Too many entries to display here. View the full report on radar instead. |
|
!bench |
|
Benchmark results for 40157b1 against 0a8abcb are in. No significant results found. @Kha
Medium changes (1🟥)
Small changes (6✅, 7🟥)
|
`InfoTree.addTrailing` now returns the original tree when a subtree is unchanged, so only nodes whose syntax actually changes are reallocated. Changed children are updated via `PersistentArray.set`, keeping unchanged leaf chunks of the children array shared as well. This removes most of the allocation and refcounting overhead of reapplying trailing whitespace on snapshot tree walks and in the tactic block elaborator, and restores structural sharing between tactic snapshot info trees and the surrounding command info tree.
…tree (leanprover#15093) This PR fixes the goal view showing the state after the enclosing tactic instead of the nested block's goal on the line after the last tactic of a nested `have ... := by` block or `·` bullet, e.g. after an empty `·` where the next tactic is about to be typed (leanprover#15053). Tactic steps are elaborated without the trailing whitespace of their last token for incremental reuse (leanprover#11958), which is re-added to the resulting info trees afterwards. `InfoTree.addTrailing?` passed each node's own trailing whitespace to its children instead of the trailing being added, which cut off propagation at the `by` token node that `have ... := by tacs` expands to via `with_annotate_state`, so the last nested tactic never regained its whitespace. Term-level blocks ending a tactic step additionally hide behind an unsubstituted info hole at that point, so `evalSepTactics` now substitutes holes before re-adding. Co-authored-by: Claude Fable 5.1 <[email protected]>
This PR adjusts the elaborator and snapshot tree system so as not to rerun tactics when whitespace directly following them is changed, preventing loss of progress when preparing to type the next tactic.
We do this by removing the trailing whitespace before passing a tactic from the tactic block elaborator to
evalTactic. The removed whitespace is saved in the snapshot tree and reapplied on access such that no consumers have to be adapted.