Open and answer this issue on GitHub.
wip, ci · opened 2026-11-29 · updated 2026-11-29 · 1 comment
Found while answering the owner’s question why check of a toolchain file proves everything again (owner, 2026-11-29: “absolute Pflicht”).
Related: “The corpus-wide ledger tests reuse the committed proofs books and run as Nikaia tests” (#2862) does the same for the corpus tests; this issue does not wait for it.
Facts: CI and caches, Ledger and bounds proofs
sysroot::lower_std (crates/nikaia/src/sysroot.rs) lowers the compiler package (crates/nikaia-std/src/compiler/) and the runtime package (crates/nikaia-std/src/runtime/) through lower_package and never opens a proofs book: sysroot.rs names neither Book nor proofs. Every uncached run solves every bounds question fresh.project.rs inferred() calls crate::proofs::Book::read(&self.layout.root), and project::with_recorded_proofs does for explanation flags. Both packages have a nikaia.toml, so check of one of their files reads a book once one exists, but git ls-files | grep nikaia.proofs lists none under crates/nikaia-std/ (it lists benches/lowering, examples/, packages/, tests/*).check of benches/lowering counts 6.51 G Ir with its book against 8.31 G without (callgrind, the report of “Proofs book for benches/lowering” #2871).Owner, 2026-11-29: the toolchain packages get committed proofs books like every project, written by lower-std and read by check. Nothing is skipped: an answer in the book is one already proved, every other question is solved (ADR-270 D4).
lower_package runs the compiler and the runtime package inside proofs::with_book(Book::read(package)); its parallel inference uses proofs::in_parallel (book copied to workers, merged after); a dependency’s files (json, logic) are answered from their own books through proofs::for_package / for_unit, kept out of this book (ADR-270 D23). Test: a .nika test in tests/compiler/tests/ or the it/sysroot.rs drift check showing a second lower-std changes no file.lower-std writes crates/nikaia-std/src/compiler/nikaia.proofs and crates/nikaia-std/src/runtime/nikaia.proofs through project_write_proofs (project_write.nika). Files served from the per-file cache asked no question, so their entries are kept from the book as read, not dropped; the builder chooses how (e.g. keep every read entry whose unit is a cached file). A whole-package cache hit writes nothing.Package::drift (or --locked) fails when the book lower-std would write differs from the committed one.docs/measuring.md): check of crates/nikaia-std/src/compiler/bounds_walk.nika, and an uncached lower-std of a git archive HEAD copy, each with and without the book.lower-std writes both books, a second uncached lower-std leaves every file unchanged, and check of a compiler file counts fewer Ir with the book than without (both figures in the report); the commit that commits the books carries Fixes #N; one Found: line per finding.
crates/nikaia/src/sysroot.rs (calls to the existing book functions only), crates/nikaia-std/src/compiler/*.nika where a step needs it, the two new nikaia.proofs, crates/nikaia/tests/it/sysroot.rs only to keep it passing.sysroot.rs to proofs::with_book, in_parallel, Book::read and project::write_proofs, no decision in them; allowed by the owner’s order of 2026-11-29. The report lists it for #557 / #125.check without lower-std writing it: nothing would keep the book current.From the report of the run of issue-2939 (#2939):
the book of the compiler package cannot reach 10 MB by encoding alone: the hex keys alone are 11.4 MB, the sv logs in nikaia.proofs.d are >= 28 MB as varints (gzip -9 10.7 MB); #2939 waits for a decision on what the book keeps
Generated by Claude Code