fv: machine-check all 104 chip determinism theorems in Lean - #537
Merged
Merged
Conversation
eigmax
force-pushed
the
feat/fv-determinism
branch
4 times, most recently
from
October 1, 2026 18:21
5be8083 to
3098a87
Compare
Every core chip with a determinism statement (57 chips, 104 theorems) is machine-checked in Lean 4; `#print axioms` lists only propext, Classical.choice and Quot.sound for each. - zkm-picus replays the analyser's derivation of every output column as Lean step lemmas, with gadget summaries proved once as library theorems and generated accelerator snippets; its propagation maps are BTreeMaps, so the generated files are byte-identical across runs. - crates/fv/lean4/check: regen_all.sh regenerates every chip file and the generated snippets from the checkout (they are no longer committed); check.sh splits a chip file into dependency-ordered modules, lifts and flattens the large proofs, and builds them in parallel under a 30-minute cap per module. - Paper: one Security section and one arithmetisation section, the determinism results and the three soundness gaps the statements exposed (#534, #535, #536), and the fifth review pass. - Toolchain pinned to nightly-2026-09-17, the date of the latest zkm toolchain release, with the lints it adds fixed (recursion limit in zkm-curves and zkm-core-machine, two index loops in zkm-pcs). - The PLONK verifier template defines VK_ROOT() and keeps hashPublicValues' doc comment; README drops the AI-assistant acknowledgement. No AIR, verifying key or recursion program changes.
eigmax
force-pushed
the
feat/fv-determinism
branch
from
October 1, 2026 18:24
3098a87 to
2102bcf
Compare
3 tasks done
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.
Summary
Every core chip with a determinism statement (57 chips, 104 theorems) is machine-checked in Lean 4: for each,
#print axiomslists onlypropext,Classical.choiceandQuot.sound(nosorry, no added axiom). The statements exposed three soundness gaps, now closed in the constraints (#534, #535, #536).crates/fv/picus): the analyser's derivation of every output column is replayed as Lean step lemmas; gadget summaries (field operations, byte comparison, leading-one, canonical word, septic chord/sqrt) are library theorems proved once, and accelerator snippets are generated per chip by family generators, shipped in the archive below. The propagation maps areBTreeMaps, so generation is deterministic.regen_all.sh(regenerates every chip file and the 24 generated snippets, byte-identical across runs) andcheck.sh(splits a chip file into dependency-ordered modules, rewrites the large proofs, and builds them in parallel under a 30-minute cap per module) are not in this PR; they and the snippet generators ship in the archive below (src/crates/fv/lean4/check,src/crates/fv/lean4/snippets/tools) and land in a follow-up PR. The chip files are generated, so they are no longer committed.docs/paper): one arithmetisation section (frame, buses and chips); "Putting it all together" after the components, with an end-to-end block-proof protocol; one Security section (proved relation and open hypotheses, soundness accounting, composition, key binding, digest assumption, trace uniqueness, conformance and determinism, post-quantum); six review passes.nightly-2026-09-17, the date of the latest zkm toolchain release; the lints it adds are fixed (recursion limit inzkm-curvesandzkm-core-machine, two index loops inzkm-pcs).VK_ROOT()and keepshashPublicValues' doc comment; SysLinux and the Global gadgets gain doc comments and analyser marks only; README drops the AI-assistant acknowledgement. No AIR, verifying key or recursion program changes.The checked chip files and snippets, with a per-chip table (
STATUS.md,CLOSED.txt), are archived athttps://zkm-toolchain.s3.amazonaws.com/fv/ziren-fv-lean-20261001b.tar.gz(.sha256beside it);BASE_COMMIT.txtnames this commit.Test plan
regen_all.shrun three times: chip files and snippets byte-identical across runs.check.shon one 124-core machine: 104/104deterministictheorems with standard axioms only; all 7,414 modules of the 62 chip files build withrc=0and nosorry; slowest module 1,300 s under the 30-minute cap. The archived files are the ones checked.nightly-2026-09-17: fmt, clippy (workspace andark), the twelve-packagecargo test -rloop,zkm-picustests,zkm-core-machinecost and Weierstrass tests, verifier malformed-input tests under both feature sets — all passed.