Repository navigation
fix: reference-manual breakage from nightly-2026-11-22 (lean4#16627) - #274
Merged
Merged
Conversation
lean4#16627 makes `MessageData.format` respect `maxTraceChildren`, so trace nodes with more than 50 children now print the first 50 followed by `N more entries... (increase `maxTraceChildren` to see more)`. Two nodes of the `grind` diagnostics pinned by the `#check_msgs` block in front of the first `eraseSwap` (86 and 119 entries) are therefore truncated, and the block fails with `❌️ Docstring on `#check_msgs` does not match generated message` — the two truncation markers are the only difference. The diagnostics are the point of that example, so lift the limit for the command (`maxTraceChildren 0` = no limit) instead of pinning a truncated list. The `set_option` sits outside `-- ANCHOR: eraseSwap_init`, so the code the manual shows is unchanged. Co-Authored-By: Claude Opus 5 <[email protected]>
This was referenced Nov 22, 2026
Kha
pushed a commit
that referenced
this pull request
Nov 23, 2026
1 of 4 for [run 45055845730](https://github.com/leanprover/downstream-lean4/actions/runs/45055845730), with #273, #274 and #275 — one PR per author of the upstream change behind each breakage, so each asks that author for review. This one stands alone: `batteries` and `aesop` go green with it and nothing else. `batteries` was the only repo that CI could build this round: `aesop`, `mathlib4` and `cslib` were all skipped behind it, so this unblocks three more repos. ### `batteries` — lean4#15687 (`Kha`) lean4#15687 makes `unfold` on a non-recursive definition independent of whether `f.eq_def` happens to have been realized already: it now always unfolds by plain delta expansion, and so no longer reduces the resulting `match` on a constructor. In `Float.Model.UnpackedFloat.pack_unpack`, `unfold pack` therefore leaves the two `have`s of `pack`'s `.finite` arm *inside* the unreduced `match`, where `extract_lets` cannot reach them: ``` Batteries/Data/Float/Lemmas/Basic.lean:77:4: Tactic `extract_lets` failed: made no progress Batteries/Data/Float/Lemmas/Basic.lean:94:4: Tactic `extract_lets` failed: made no progress ``` Fix: reduce the match with `dsimp -zeta only` before `extract_lets`, in both the subnormal and the normal case. This is byte-for-byte the hunk the bot already carries on `adaptation-15687` (#265) and `adaptation-16623` (#266) — both now `CONFLICTING`, because upstream has since split `Batteries/Data/Float/Lemmas.lean` into `Batteries/Data/Float/Lemmas/{Basic,Arithmetic,Order}.lean`, so neither can merge as it stands. Applying it at the new location is what makes `master` build. **Verified:** `batteries` `lake build --wfail`, `lake test` and `lake lint` all green; `aesop` `lake build --wfail` and `lake test` green (it has no lint driver). <!-- downstream-watch: unattended --> Co-authored-by: downstream-lean4[bot] <downstream-lean4[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5 <[email protected]>
Contributor
Author
Build report for Remove useless commentStayed red
Stayed green
|
This was referenced Nov 23, 2026
david-christiansen
pushed a commit
that referenced
this pull request
Nov 25, 2026
…4#16627) (#283) Fix for the `reference-manual` half of [run 45592905939](https://github.com/leanprover/downstream-lean4/actions/runs/45592905939) (`nightly-2026-11-24`). One commit. The rest of the red set is either carried by PRs that are already open or cannot be fixed on this nightly at all — see "Rest of the red set" below. ## `reference-manual` — stale `maxTraceChildren` adaptation `extended-examples/IndexMapGrind.lean` pins the `grind` diagnostics of the `eraseSwap` example in a `#check_msgs` docstring. lean4#16627 made `MessageData.format` respect `maxTraceChildren`, so that output grew two `N more entries... (increase maxTraceChildren to see more)` lines. Both sides then adapted, in opposite directions: * downstream, #274 put `set_option maxTraceChildren 0 in` above the block, so the full trace is printed again and the old expectation still matches; * upstream, [leanprover/reference-manual#1008](leanprover/reference-manual#1008) (in `nightly-testing` as `226acc32c`) regenerated the expected output *with* the two truncation lines. `downstream: update repo reference-manual` (3d92f74) merged the second one in. The two changes touch different lines, so there was no conflict and both survived — and the `set_option` suppresses exactly the truncation the new expectation requires. `IndexMapGrind` failed with ``` error: extended-examples/IndexMapGrind.lean:637:0: ❌️ Docstring on `#check_msgs` does not match generated message: ``` and `Tutorial.Grind.IndexMap`, which builds `IndexMapGrind` as a nested project to resolve its anchors, failed behind it at 76 sites with `Build process failed.`. **Fix:** delete the now-stale `set_option`. The file is byte-identical to upstream `226acc32c` again. **Verified:** `lake build` green, 1680/1680 jobs, with `IndexMapGrind` and `Tutorial.Grind.IndexMap` genuinely recompiled rather than replayed. `reference-manual` defines no test or lint driver (`lake check-test` and `lake check-lint` both exit 1), so `build` is its full set of phases. Built with elan v4.4.0 first on `PATH`, matching CI, because the manual pins `elan --help` output. ## Superseded PRs closed The same `reference-manual` update rewrote `Manual/VCGen.lean`, `Tutorial/VCGen.lean` and `Manual/NotationsMacros/DoElab.lean` upstream, which makes #268 (lean4#16557, lean4#16569) and #275 (lean4#16451) unnecessary: all three modules compiled green in the verification build without them, and both PRs had become `CONFLICTING` against `master`. Closed as superseded. ## Rest of the red set, not in this PR Verified on `3d92f744` with the open #273 and #279 applied locally: * **`mathlib4` build — green.** `lake build Mathlib Archive Counterexamples Wanted cache --wfail`: 18661 jobs, 0 warnings. `Mathlib.Data.Int.Init` (`lia`, lean4#16668) was fixed by #273's hunk; master has since taken a different fix for that one file directly (`d9ac508c`, `congr 1; lia` instead of `congrArg motive`), so #273 will need its `Data/Int/Init.lean` hunk dropped, but its other 27 files are still the next `lia` layers. `Pentagonal.Ring` (lean4#16680) is fixed by #279. * **`mathlib4` test and lint — still red, and not fixable on this nightly.** Once the build is unblocked, both phases hit the clash that also keeps `import-graph` red: `environment already contains 'Lean.SourceInfo.getLeading?' from ImportGraph.Lean.Syntax`. 22 `MathlibTest` modules fail on it, and `batteries/runLinter` dies with the same message as an `uncaught exception`, so `lake lint` never runs a linter at all. CI has never reached these phases, because the `mathlib4` build failed first. * **`repl` — also this clash, not the `lia` cascade.** Its `test` phase fails at `test/Mathlib/test/H20231020`, and it still fails with Mathlib fully built: the REPL reports no error for `import Mathlib.…` but hands back an environment with none of Mathlib's contents, so the following `open BigOperators`/`Real`/`Nat`/`Topology` all fail with `unknown namespace`. A plain `lake env lean` on a one-line `import Mathlib.Basic.Real.Basic` in that project shows what the REPL swallows: `import Lean.Fmt.Util.Basic failed, environment already contains 'Lean.SourceInfo.getLeading?'`. So the duplicate breaks *every non-module consumer* of Mathlib, not only `ImportGraphTest` — Mathlib's own module-system build does not see `ImportGraph`'s private imports, but a non-module importer does. * **`import-graph`** — `ImportGraphTest` fails with the same clash. #281 fixes it by deleting the duplicate and using the core declaration that lean4#16718 moved into `Init.Prelude`; that needs `nightly-2026-11-25` or later, so #281 is deliberately red on the current nightly (its own run 45411679303 fails `ImportGraph.Lean.Syntax` with `Invalid field getLeading?`). Nothing here changes that and no competing fix is proposed — this is the PR author's own call. * **`cslib`** — skipped behind `mathlib4`, left to its own bot. So merging this PR, #273 and #279 does *not* turn `master` green: `mathlib4`'s test and lint phases, `import-graph` and `repl` all need the `nightly-2026-11-25` bump together with #281. <!-- downstream-watch: unattended --> Co-authored-by: downstream-lean4[bot] <downstream-lean4[bot]@users.noreply.github.com>
Kha
pushed a commit
that referenced
this pull request
Nov 26, 2026
Sole fix for [run 45176665928](https://github.com/leanprover/downstream-lean4/actions/runs/45176665928) — everything else that run reports red is already carried by open PRs: `mathlib4` also needs #273 (lean4#16668) and the bot's #163 (`adaptation-13851`), and `reference-manual` needs #268 and #275. On its own this PR's CI therefore stays red on `mathlib4` (at `Mathlib.Data.Int.Init`, four thousand modules before the one fixed here) and on `reference-manual`; that is expected, and it was verified with all four applied. `repl` fails on the same `mathlib4` modules rebuilt through `test/Mathlib`, and `cslib` was only ever skipped behind `mathlib4`. ### `mathlib4` — lean4#16680 (`leodemoura`) lean4#16680 makes `grind`'s *local* E-matching theorems — the ones built from `∀`-hypotheses in the context — take their instances and anchors from the **preprocessed** type of the hypothesis rather than from whatever `mkOfEqTrueCore` handed back. In `Pentagonal.tprod_one_sub_pow` (`Mathlib/Combinatorics/Enumerative/Pentagonal/Ring.lean`) the line before the failure is exactly such a hypothesis: ```lean have h1 (k : ℕ) : pentagonal (k + 1) = ((k + 1) * (3 * k + 2) / 2) := by grind [pentagonal_def] have h2 (k : ℕ) : pentagonal (-k) = (k * (3 * k + 1) / 2) := by grind [pentagonal_neg] ``` and with `h1` in the context the second `grind` now exhausts `(instances := 1000)`, `(ematch := 5)` and `(ringSteps := 100000)`. The declaration's heartbeats are gone with it, so the `rw` two lines further down fails as `(deterministic) timeout` — two errors, one cause. The module takes **315s** to fail, where the whole file used to elaborate in well under a second. `h1` is the whole trigger, not the theorem's five hypotheses and not `h` above it: * `clear h1` alone, before the `grind`, fixes it — the module is back to **0.9s** for the entire file; * `h1`'s own `grind` is fine with the full context, as long as `h2` has not run yet; * the same `h2` goal in a file with no context at all proves in 0.6s on this nightly. `h1` is only used by the `simp_rw` after both `have`s, so clearing it inside `h2`'s proof costs nothing. An `#adaptation_note` records why, because the interesting question is upstream: whether `grind` should be 300× slower because an unrelated equation about the same function sits in the context is for lean4#16680's author to decide, and that is a better outcome than `clear`ing hypotheses at every future site. Nothing else in `mathlib4` moved on this nightly. ### Verification On `master@origin` (`c2ff11e2`, `nightly-2026-11-23`) with #273 and #163's three `mathlib4` hunks applied locally: * `lake build Mathlib Archive Counterexamples Wanted cache --wfail` — green, 18655 jobs (the previous build stopped at 18647/18655 on this module, which also hid `Pentagonal.PowerSeries`, `Pentagonal.EulerFunction` and `Mathlib` itself); * `lake test --iofail` — green, 19219 jobs; * `lake lint` — green. `reference-manual` was verified in the same tree with #268 and #275 applied: full `lake build` green, 1668 jobs, with elan 4.4.0 first on `PATH` so the pinned `elan --help` blocks match CI. It defines no test or lint driver. `repl`'s test phase was not rebuilt here — its failures are these same `mathlib4` modules compiled through `test/Mathlib`. One thing that is *not* fixed by anything, because it needs no fix: `Tutorial.Grind.IndexMap` failed in this run with `permission denied (error code: 13)` on `.lake/build/lib/lean/IndexMapGrind.ilean`. #274 changed `IndexMapGrind.lean`, so for one run no cached artifact existed, and the parent `lake build` and the nested `lake build +IndexMapGrind:highlighted` that `Tutorial/Grind/IndexMap.lean` spawns both had to build the module — the parent won and replaced the output with a read-only hardlink into the artifact cache. The artifact is in the cache now, both sides replay it, and the module builds green locally. It will recur for one run on every future change to that file. <!-- downstream-watch: unattended --> Co-authored-by: downstream-lean4[bot] <downstream-lean4[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
3 of 4 for run 45055845730, with #272, #273 and #275 —
reference-manualgoes green only with this PR and #275 and the still-open #268, so on its own this PR's CI stays red onreference-manualuntil those merge. Verified together.reference-manual— lean4#16627 (TwoFX)lean4#16627 makes
MessageData.formatrespectmaxTraceChildren, so a trace node withmore than 50 children now prints its first 50 followed by
N more entries... (increase `maxTraceChildren` to see more). Two nodes of thegrinddiagnostics that the#check_msgsblock in front of the firsteraseSwappins(
extended-examples/IndexMapGrind.lean) have 86 and 119 entries, so the block fails withand the two truncation markers are the only difference in the diff — everything else
still matches.
Tutorial.Grind.IndexMapthen fails too, because it extracts anchorsfrom that module through a nested
lake build.Those diagnostics are the whole point of the example, so this lifts the limit for the
one command (
maxTraceChildren 0= no limit, which is how core's own guard reads it)rather than pinning a truncated list. The
set_optionsits outside-- ANCHOR: eraseSwap_init, so the code the manual renders is unchanged.Verified:
lake build IndexMapGrindgreen, and the repo's fulllake buildis greenwith the two commits of this round plus #268 applied (
lake testandlake lintreportno driver configured, so
buildis the whole phase set here).