Skip to content

fix: revert #2435#2485

Merged
kim-em merged 1 commit intomasterfrom
revert-2435-refine-natural-fix
Aug 30, 2023
Merged

fix: revert #2435#2485
kim-em merged 1 commit intomasterfrom
revert-2435-refine-natural-fix

Conversation

@kim-em
Copy link
Copy Markdown
Collaborator

@kim-em kim-em commented Aug 30, 2023

Reverts #2435, which thoroughly broke Mathlib, because change statements are now duplicating goals. See the build output at https://github.com/leanprover-community/mathlib4/actions/runs/6021210761/job/16333708649?pr=6863.

I am still working on automatically posting reports on Mathlib builds back to Lean PRs, which would have caught this, but not there yet. What we do have is automatically generated toolchains for releases, e.g. as lean/leanprover-pr-releases:pr-release-XXXX, so at least it is already possible to manually test.

No fault of @thorimur's, but this does demonstrate how our testing library still falls far short. This scenario of change breaking so badly should have been caught well before Mathlib.

@thorimur, I am going to revert your PR for now, and leave it to you to reconsider how to do this. It may be best that we write some proper tests for change first!

@github-actions
Copy link
Copy Markdown
Contributor

Thanks for your contribution! Please make sure to follow our Commit Convention.

@kim-em kim-em added the awaiting-review Waiting for someone to review the PR label Aug 30, 2023
@kim-em kim-em enabled auto-merge (squash) August 30, 2023 06:46
@digama0
Copy link
Copy Markdown
Collaborator

digama0 commented Aug 30, 2023

But change isn't implemented...? Are you talking about the change conv? The implementation of the change tactic is in Mathlib.Tactic.Basic.

@kim-em kim-em merged commit a7efe5b into master Aug 30, 2023
@thorimur
Copy link
Copy Markdown
Contributor

Oh dear, very sorry to have caused this nonetheless!

If I PR core or std4 in the future, I'll be sure to build Mathlib to make sure that only expected breakages occur. I look forward to the automatically posted build reports, however, as a full Mathlib build is quite a bit for my laptop to handle! :) (Though I suppose I could convince CI to do it on a branch/PR.)

I'll start investigating this tomorrow. Will the PR release for #2435 still work? (I've briefly tried elan install leanprover/lean4-pr-releases:pr-release-2435, but am met with an error.)

Also: can/should #2435 be reopened, or should I make a new one (possibly with a new branch)?

@thorimur
Copy link
Copy Markdown
Contributor

thorimur commented Aug 30, 2023

Couldn't resist taking a peek: what's happening (at least in the first example) is that change makes an intermediate fresh natural mvar to simulate a goal when elaborating a local hypothesis. Nothing actually depends on this mvar, so if you simply throw it away—as you might when throwing away all natural mvars!—you don't get any kernel error. As of 2435, we no longer throw it away, and it appears as a spurious unsolved goal. This shouldn't be difficult to fix—assuming there aren't other issues. I'll try to open a mathlib4 PR when I next get the chance (in 12 hours or so). :)

@kim-em
Copy link
Copy Markdown
Collaborator Author

kim-em commented Aug 30, 2023

But change isn't implemented...? Are you talking about the change conv? The implementation of the change tactic is in Mathlib.Tactic.Basic.

Ah, okay, indeed that makes it harder to catch in Lean itself, and I feel less bad about this. With this toolchain many of the uses of change in mathlib are duplicating goals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review Waiting for someone to review the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants