Issue #2931: lower-std keeps a proofs book for the compiler and runtime packages, and check of their files reads it

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

What happens today

Decision

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).

To build

  1. 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.
  2. 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.
  3. A stale committed book is caught as a stale lowered file is: Package::drift (or --locked) fails when the book lower-std would write differs from the committed one.
  4. Commit both books.
  5. Measure with callgrind (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.

Done when

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.

Files and limits

Ruled out

Comments

keywan-ghadami, 2026-11-29

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

Back to Open Issues