Conversation
b4f91ed to
78682df
Compare
|
!bench |
|
Benchmark results for 78682df against e7e3588 are in! @sgraf812
Large changes (2✅)
Medium changes (79✅, 1🟥) Too many entries to display here. View the full report on radar instead. Small changes (837✅, 17🟥) Too many entries to display here. View the full report on radar instead. |
f93e9e4 to
5655b34
Compare
|
I looked into the only reported medium regression in #12656 (comment): ~+20% more instructions in Lean/Meta/Match/Rewrite.lean. It's not related to the do elaborator; it's LCNF taking more time, presumably to simplify away the |
5655b34 to
b27d73d
Compare
|
It's a bit unfortunate that there have to be so many adaptations regarding do let rec loop (i : Nat) (h : i ≤ as.size) (b : β) : m β := do
match i, h with
| 0, _ => pure b
| i+1, h =>Edit: Nice to see some good performance wins, though! |
|
Mathlib CI status (docs):
|
|
Reference manual CI status:
|
That's actually a good point. I opened #12673. |
Rob23oba
left a comment
There was a problem hiding this comment.
I'm not entirely sure why all of these changes are necessary, can you explain?
|
Also, is it planned that we get Example where it would be really nice to have ForInNew
import Lean
set_option backward.do.legacy false
open Lean Meta Elab Term
elab tk:"with_cont " fn:term : doElem <= dec => do
let combinator ← elabTerm fn none
let type ← inferType combinator
let .forallE _ t b _ ← whnfForall type | throwFunctionExpected combinator
let u := (← read).monadInfo.u
let cont ← withLetDecl dec.resultName (.const ``PUnit [u.succ]) (.const ``PUnit.unit [u.succ]) fun e => do
mkLetFVars #[e] (← dec.k)
let contTy ← inferType cont
unless ← isDefEq t contTy do
throwErrorAt tk "error"
let res := (← read).doBlockResultType
let monad := (← read).monadInfo.m
let expect := .app monad res
unless ← isDefEq b expect do
throwErrorAt tk "other error"
return combinator.beta #[cont]
@[doElem_control_info doElemWith_cont_]
def controlInfoWithCont : Do.ControlInfoHandler := fun _ => pure .pure
def test (n : Nat) : ReaderM Nat Nat := do
for i in *...n do
with_cont withReader (· + 1)
read
#guard ((test 0).run 3).run == 3
#guard ((test 5).run 3).run == 8 -- fails :-( |
|
Yes, I agree that |
8cae8e1 to
d05cf36
Compare
This reverts commit 2f62915.
013e497 to
04b9496
Compare
|
!bench |
|
Benchmark results for 04b9496 against c1ab166 are in! @sgraf812
Large changes (2✅)
Medium changes (76✅, 1🟥) Too many entries to display here. View the full report on radar instead. Small changes (827✅, 25🟥) Too many entries to display here. View the full report on radar instead. |
The helper function matched on `.packageFacet` instead of `.targetFacet`, causing `collectTargetFacetArray` and `collectSharedExternLibs` to never find any target facet jobs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| {it : IterM (α := α) m β} : | ||
| (it.drop n).step = (do | ||
| match (← it.step).inflate with | ||
| (it.drop n).step = ( |
There was a problem hiding this comment.
Huh, seems like putting do at the end of this line and undoing the changes to lines 22-24 fixes the issue (some kind of elaboration order issue? by exact also works btw but is really ugly)
This PR turns on the new
doelaborator in Init, Lean, Std, Lake and the testsuite.