Repository navigation
fix: batteries breakage from lean4#16557 — #do command must build Do.Context.controlInfoCache - #271
Merged
Merged
Conversation
…Do.Context.controlInfoCache`
lean4#16557 ("perf: memoize the control information of `do` sequences",
nightly-2026-11-20) added a `controlInfoCache : ControlInfoCache` field, with no
default, to `Lean.Elab.Do.Context`. The `downstream: update repo batteries` merge
then brought in batteries#1962 ("feat: `#do` command"), whose `elabDoCommandCore`
assembles a `Do.Context` by hand. That file was written against batteries `main`,
which still pins `v4.37.0-rc1`, so `Batteries.Tactic.DoCommand` now fails with
Fields missing: `controlInfoCache`.
Pass a fresh cache at that site, as core itself does in `Do.mkContext`
(`controlInfoCache := ← ControlInfoCache.new`). The `#do` command elaborates one
`doSeq` per invocation, so there is nothing to share between calls.
Verified: batteries `lake build --wfail`, `lake test` (including the new
`BatteriesTest.do_command`) and `lake lint` all green.
Contributor
Author
Build report for fix: batteries breakage from lean4#16557 —
|
| Repo | Critical | Build | Test | Lint |
|---|---|---|---|---|
| aesop | ✅ | ✅ in 0s | ✅ in 3s | ⏭️ |
| batteries | ✅ | ✅ in 1s | ✅ in 3s | ✅ in 1s |
Stayed red
| Repo | Critical | Build | Test | Lint |
|---|---|---|---|---|
| mathlib4 | ✅ | 🟥 in 3s | ⏭️ | ⏭️ |
| reference-manual | ✅ | 🟥 in 5s | ⏭️ | ⏭️ |
| cslib | 🛑 by mathlib4 | ⏭️ | ⏭️ | |
| repl | ✅ in 0s | 🟥 in 17s | ⏭️ |
Stayed green
| Repo | Critical | Build | Test | Lint |
|---|---|---|---|---|
| import-graph | ✅ | ✅ in 2s | ✅ in 4s | ⏭️ |
| lean4-cli | ✅ | ✅ in 0s | ✅ in 0s | ⏭️ |
| plausible | ✅ | ✅ in 0s | ✅ in 2s | ⏭️ |
| ProofWidgets4 | ✅ | ✅ in 0s | ✅ in 0s | ⏭️ |
| quote4 | ✅ | ✅ in 0s | ✅ in 0s | ⏭️ |
| BibtexQuery | ✅ in 1s | ⏭️ | ⏭️ | |
| doc-gen4 | ✅ in 1s | ⏭️ | ⏭️ | |
| illuminate | ✅ in 0s | ✅ in 9s | ⏭️ | |
| lean4-unicode-basic | ✅ in 0s | ⏭️ | ⏭️ | |
| lean4export | ✅ in 0s | ✅ in 5s | ⏭️ | |
| LeanSearchClient | ✅ in 0s | ✅ in 0s | ⏭️ | |
| leansqlite | ✅ in 2s | ✅ in 19s | ⏭️ | |
| nerodia | ✅ in 0s | ✅ in 22s | ⏭️ | |
| verso | ✅ in 17s | ✅ in 3m 34s | ⏭️ | |
| verso-slides | ✅ in 4s | ✅ in 8s | ⏭️ | |
| verso-web-components | ✅ in 0s | ⏭️ | ⏭️ |
Contributor
|
LGTM so I'll merge this as trivial |
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.
Run 44844350878 on
nightly-2026-11-20. This fixes the run's new breakage,batteries(critical), which tookaesop,mathlib4andcslibdown with it as skips. The rest of the red set is carried by PRs that are already open —reference-manualby #268, andmathlib4+replby #270 (approved) — so this PR's own CI stays red onreference-manualuntil those merge.batteries—Do.Contextgained a field, and#dobuilds one by handlean4#16557 ("perf: memoize the control information of
dosequences", @sgraf812, innightly-2026-11-20) added a field with no default toLean.Elab.Do.Context:/-- The `ControlInfo` of the `doSeq` nodes of this `do` block inferred so far. -/ controlInfoCache : ControlInfoCacheThe
downstream: update repo batteriesmerge at the head of this run then brought in batteries#1962 ("feat:#docommand", @Rob23oba), whoseelabDoCommandCoreassembles aDo.Contextitself rather than going throughDo.mkContext. That file was written against batteriesmain, which still pinsv4.37.0-rc1, so on the nightly it fails:Batteries.Tactic.DoCommandis reachable from theBatteriesroot module, so this is a critical-repo build failure, andaesop,mathlib4andcslibwere all skipped behind it.The fix
One field, a fresh cache, exactly what core's own
Do.mkContextwrites:A
ControlInfoCachememoizes the inferredControlInfoof thedoSeqnodes within onedoblock;#doelaborates onedoSeqper invocation, so there is nothing to carry across calls and no reason to park a cache inDoCommandExtensionStatenext to the local context and themutvariables.Upstream batteries cannot see this yet:
nightly-testingis onnightly-2026-11-20and carries the same unadapted file (byte-identical), and there is no batteries PR open that mentionscontrolInfoCacheor lean4#16557 — so the same fix is wanted there.Verified
batteries:lake build --wfail(531 jobs),lake test(including the newBatteriesTest.do_command) andlake lint.aesop:lake build --wfailandlake test, the two phases CI skipped (no lint driver).mathlib4:lake build Mathlib Archive Counterexamples Wanted cache --wfail(18647 jobs),lake test --iofail(19211 jobs) andlake lint, with fix: mathlib4 breakage from importGraph#193 —#import_diffreserved thealltoken #270'simport-graphfix applied locally, sincemathlib4does not parse without it.replwas not rebuilt: it is noncritical, and the sites it failed at are #270's.cslibis left tomathlib-nightly-testingas before.