Repository navigation
Conversation
assumptions.toml lists every binder of the headline theorems, the three #1949 sorries, every field of Rv64ProgramImage and the scope premises, each with its Jolt anchors and either a necessity witness or the reason it has none. - JoltConstraints/Audit/Premises.lean fails the build when a binder of a headline theorem or a field of BlockConforms or Rv64ProgramImage changes. - JoltConstraints/Audit/ImageFields.lean proves that DecodedFrom implies next_pc_no_wrap, instruction_loaded and program_end_ge_ram_start. - JoltConstraints/Audit/Necessity.lean has witnesses for JoltField, BlockConforms.riscv and memory_init_in_program. - scripts/check-assumptions.py checks the registry against the sorries, the image fields, the Lean lists, the witnesses and the bug-report headers; lean.yml runs it before the build. - .github/workflows/jolt-main-drift.yml regenerates the constraint data from Jolt main each night, diffs the anchor files against the pin and updates the issue "Drift against Jolt main". It never fails. - Bug-report folders get TOML headers with their status; AGENTS.md gets a re-pin section.
…n CI scripts/check-lean-policy.py scans every Lean file of the three libraries, with comments and string contents removed, and fails on sorry, admit, an axiom that scripts/lean-policy-allowlist.toml does not list, native_decide, bv_decide, decide +kernel, maxHeartbeats, synthInstance options, respectTransparency false, debug.skipKernelTC, and maxRecDepth outside the five options that scripts/regen-sail-model.sh inserts into the generated Sail model. The allowlist names the 67 floating-point axioms of LeanRV64D/RiscvExtras.lean and each maxRecDepth option with the definition it precedes; an entry that no longer matches the source also fails. lean.yml runs the script on every build.
JoltConstraints/Audit/Commands.lean holds the audit commands, now in a module that imports only Lean: - #assert_axioms fails unless a declaration's axioms are among propext, Classical.choice and Quot.sound; - #audit_statements lists the headline theorems, necessity witnesses and derived facts, resolves each name exactly, checks its axioms, and compares its pretty-printed statement and the fingerprints of the repository definitions in the dependency closure of its statement with a checked-in table. A changed definition below a statement, such as a new restriction inside JoltInstance.initial_state, fails the build and is named in the error. JoltConstraints/Audit/Statements.lean applies it to 14 theorems. scripts/update-audit-tables.py rewrites the expected binder lists and the table from the build in one command. scripts/check-assumptions.py now checks that the registry's witness and derived_by names equal the lists the build resolves, instead of matching name suffixes in the source. The registry gains the Dory-only configuration (scope), tracer initialization and host allocation (correspondence), and derived entries for the three premises removed on 2026-11-25, so their Jolt checks stay watched.
The nightly drift report now compares every Jolt file the Lean sources cite (scripts/jolt_citations.py), not only the registry anchors, and lists the citations that resolve to no file at the pin. The job writes the report and updates the issue even when an earlier step fails. The report opens with whether the run could monitor Jolt main; a failed checkout, pin fetch, Lean setup, report or issue update fails the job, while drift never does. The generator writes into an empty directory, and the equivalence result is labelled by whether it produced new data. No step keeps an earlier night's report.
scripts/check-sail-model.sh now requires the Sail entry of lakefile.toml and lake-manifest.json to name exactly the repository, tag and commit in [runtime] of sail-import/PROVENANCE.toml. Its new --inputs-only mode runs that check, the tree digest, the input digests and the memory-region comparison without downloading or building anything; CI runs it on every build. A change to lakefile.toml, lake-manifest.json or lean-toolchain now also triggers the full regeneration check.
The JoltField witness shows only that [Field F] does not imply JoltField; the BlockConforms.riscv witness shows only that DecodedFrom admits a row of a Jolt instruction, with no trace. Neither builds an object that meets every other premise of its headline theorem. The docstrings now say so, every registry entry with a witness states what it proves in the new witness_shows field (checked by check-assumptions.py), and the stronger witnesses are listed as follow-ups. The design report no longer lists expansion-parity, decoder-sweep or lookup-table checks, which this branch does not have, and its order of work records the checks added after the review.
…n-Jolt crates
The checkout-prefix rule stripped every leading segment up to a 'jolt/', which
turned crates/jolt-claims/src/protocols/jolt/... into an unresolvable suffix.
Brace lists such as virt/{load,store}_{b,h,w}.rs now count as one citation per
file, and citations of vendored crates or of scripts/ are skipped. Add
--lean-root to scan another checkout.
… citations in CI jolt-drift-report.py exits with status 3 when the report it wrote says that monitoring failed, for example when the anchor comparison raised; the workflow publishes that report and fails the step. A failed copy of the regenerated constraint files now fails the generation step instead of leaving the equivalence build to run on partly replaced files. lean_source.strip_comments turns a block comment into a space, so that by/- c -/admit and axiom/- c -/name no longer slip past check-lean-policy.py. jolt_citations.py reports a brace list cut by a line break, and --check makes any unresolved citation an error; the constraint-generation job runs it against the pin.
The AdviceLD necessity witness now shows that its word 0x060000DB decodes to AdviceLD x1, which DecodedFrom requires of every Jolt row. The binder list of sail_reproduces loses hcfg, and the statement table records the exact step count and the changed definitions: RowFromParcel, SourceInstruction.DecodesFrom, JoltCustomInstruction.decode?, Decode.joltSuccessWord, JoltInstance.initial_state and JoltISA.Instr.rewriteNative.
…ll name actualTable computed owner fingerprints per root and kept the last one under the name without its private prefix. A later root that reached only some members of an owner replaced the fingerprint of an earlier root that reached more, and two private declarations with the same name shared one line. In both cases a changed definition could leave the table unchanged. actualTable now unions the closures of all roots, computes each owner's fingerprint once over the union, and keys each line by the full declaration name (tableKey), which keeps the private module. It still records which roots use each line. JoltConstraints/Audit/Test/Fingerprints.lean tests a private-name collision, an owner member reached by an earlier root only, and that the table does not depend on root order; all three fail on the previous code. JoltConstraints.lean imports the test, so the default build runs it. The regenerated table changes the fingerprints of seven structures whose projections or recursors an earlier root reached and a later one did not: InstructionFlags, JoltDevice, JoltInstance, MemoryLayout, ProverConfig, Rv64ProgramImage and SourceInstructionRow. No key changes: the table has no private declarations. It still has 701 lines.
The policy scanner passed two compiling proofs of False: one used sorryAx, which
was not banned, and one followed a «skip/-» identifier, whose /- the scanner read
as the start of a block comment that hid the rest of the file. The maxRecDepth
allowlist also exempted the whole line of an allowed option, so a second option
on that line passed.
- check-lean-policy.py bans sorryAx, and exempts an allowlisted maxRecDepth by
the span of that one option, which must be directly followed by the definition
the allowlist names.
- lean_source.py skips «…» identifiers, reads character literals with escapes,
and reads each string literal both as a plain and as an interpolated string.
It keeps the code in braces, takes the interpolated reading after s!, m! and
f!, and reports source it cannot read unambiguously, which the policy check
rejects. Previously s!"{(sorry : Nat)}" hid its sorry.
- scripts/tests/test_lean_policy.py scans the fixtures in
scripts/tests/lean-policy/ (outside the scanned libraries) and requires each
one to fail, and clean.lean to pass. CI runs it in the policy step.
The nightly report compared only anchor files and files cited in Lean comments. A change to ADDI::exec in tracer/src/instruction/addi.rs, which no comment cites, produced an empty report, and so did changes to jolt_success.rs, the Cargo lockfile and ram_output_check.rs. The report now lists every file that changed between the pin and Jolt main and sorts it into anchored, cited, unclassified or other. Unclassified files are production Rust (*.rs outside tests/, benches/ and examples/) and build inputs (Cargo.toml, Cargo.lock, rust-toolchain*, build.rs) in a directory the model depends on: tracer/, common/, the jolt-program, jolt-riscv, jolt-verifier, jolt-prover, jolt-claims, jolt-witness, jolt-lookup-tables and jolt-r1cs crates and their derive crates, and every directory that holds a cited file. Build inputs at Jolt's top level count too. The new section lists them with counts and whether each was added, deleted or modified. Drift still does not fail the job. scripts/tests/test_drift_report.py builds a temporary Git repository with a pin and a main commit and checks the new section; it fails on the previous script.
The report cut lists at 60 entries, the generated diff at 30,000 characters and the issue body at 64,000, and told the reader that the run's log had the rest. The log had only the diff statistic, and the job uploaded nothing. jolt-drift-report.py takes --evidence-dir and writes the full report, every changed Jolt file with its group, the unresolved citations, the full Jolt diff of the anchored, cited and unclassified files, the diff statistic of every changed file, and the generated stat and diff there. Each shortened part now points to the drift-evidence artifact of the run. The workflow also saves the generator's output, and uploads the directory with actions/upload-artifact v7.0.2, pinned by commit; a failed upload counts as a monitoring failure. scripts/tests/test_drift_report.py checks that a cut generated diff is kept in full in the evidence directory and that the note names the artifact; it fails on the previous script.
AGENTS.md still accepted bv_decide and asked for each use to be listed in "Proofs owed", while scripts/check-lean-policy.py rejects it. The rules also named only native_decide, decide +kernel and maxHeartbeats, and did not say that CI rejects a staged sorry. The rules now list what the policy check rejects (sorry, admit, sorryAx, native_decide, bv_decide, decide +kernel, new axioms, maxHeartbeats, synthInstance options, respectTransparency false, debug.skipKernelTC, and maxRecDepth outside the five allowlisted Sail definitions) and the axiom check of the audited theorems. The review checklist no longer asks for bv_decide uses, and the top-down workflow notes that a branch with a staged sorry cannot merge.
Completeness gains the setupSized premise (registry entry SetupSized). The new scope entry DefaultDorySetup records that soundness covers verifiers built with Jolt's default Dory setup: the verifier checks neither the setup size nor an upper bound on the committed chunk width. The statement table changes only for dorySetupLogN, one_hot_fits_setup, lrwProgramAuto and the two completeness theorems.
The scanner treated `!` and `?` as identifier characters wherever they appeared. It therefore missed a raw string or character literal right after the negation operator: `!r"\" == ""` hid the `admit` on the next line. It also missed literals after a number (`syntax:2r"…"`) and after `?` in the syntax language, and read the `r` of a dotted identifier (`Foo.r"…"`) as the start of a raw string. lean_source.py now reads one whole token at a time, the way Lean's `tokenFn` does. With Lean's `isIdFirst` and `isIdRest`, `!` and `?` continue an identifier only after an identifier start, and a `.` followed by an identifier start continues the identifier. Numbers and name literals are single tokens. A string directly after the token `s!`, `m!` or `f!` is interpolated, also in `!s!"…"`, and not after an identifier that ends in `s!`. Character escapes follow Lean (`\u` takes four hex digits). The scanner raises an error where the boundary depends on Lean's token table or parser: a `#` command name that runs into a raw string (`#checkr"…"`) or into characters other than letters and `_`, and a raw string directly after a `.` that is not part of an identifier. The new fixtures compile with `lake env lean`. Seven of them passed the old scanner with no error.
The hand list of watched crates missed crates the model depends on. With the pin's citations, `crates/jolt-utils/src/math.rs` counted as "other", although its `log2_power_of_two` sets the advice dimensions in `CommitmentMatrixShape::advice_from_max_bytes`, and so did the expansion generator `crates/jolt-lean-gen/src/main.rs`. The report now reads the workspace members from Jolt's top-level Cargo.toml at the pin and at main, and watches every member crate (and the top-level `jolt` package's `src/`) except those in EXCLUDED_CRATES: examples, jolt-eval, the inline fixture tests, z3-verifier and jolt-profiling, each with its reason. `tracer/`, `common/` and the directories of cited files stay watched. The "Unclassified changed files" section names every crate that main adds to the workspace and lists the excluded crates. A missing or invalid Cargo.toml counts as a monitoring failure.
The evidence report.md was rendered from the same text as the issue body, after the sections had cut lists at MAX_LIST and the generated diff at MAX_DIFF. The artifact meant to hold the full data was therefore shortened too. changed-files.tsv also lacked the Lean files that cite each changed file, which the issue body drops past MAX_LIST. `compare` now gathers the comparison once, and `render_report` renders it twice: with MAX_LIST and MAX_DIFF for the issue body, and with no limits for report.md. Upstream issue states are read once for both. changed-files.tsv has a header row and, for each file, the Lean files that cite it and the registry entries anchored in it. The file status (added, deleted, modified) now comes from one `git diff --name-status` call instead of a `git show` per file. New tests render a list longer than MAX_LIST and a generated diff longer than MAX_DIFF, and check that each is complete in the evidence directory and cut in the issue body.
DefaultDorySetup said closing the gap needs a Jolt change. Jolt's own checks already limit the committed chunk width to powers of two up to 128, and only width 128 is unsafe. A setup-size parameter with the weak condition setupLogN <= 135 closes the gap on the Lean side. Issue #76 records that design and the Akita counterpart.
This branch has not been deployed
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.
This PR adds checks that tell us when a Jolt change, or a change to the Lean model, alters what the headline theorems say. It is stacked on #73.
#73 removed four premises (
HeapNoWrap,ImageNonempty,RamRegionFitsand the 2 GiB caveat) that the pinned Joltff6fc6568already guaranteed. Each re-pin had transcribed the Jolt check that made the premise true, but no step asked which premise the new check made provable.reports/2026-11-25-stale-assumptions.mddescribes the finding and the design. An external review of the stack on 2026-11-25 then showed that the first version of these checks missed changes below the theorem binders and did not enforce the axiom policy; this version fixes those gaps (see "Fixes from the external review" below). A second external review then found gaps in these checks themselves, fixed under "Fixes from the second external review".What fails the build or CI
BlockConformsorRv64ProgramImagechanges a field#expect_binders,#expect_fieldsJoltConstraints/Audit/Premises.leanJoltInstance.initial_state)#audit_statements: the pretty-printed statement and a fingerprint of each of the 701 repository definitions in the union of the statements' dependency closures, keyed by full declaration name and compared with a checked-in table; the error names each changed definitionJoltConstraints/Audit/Statements.leanpropext,Classical.choiceandQuot.sound#assert_axioms, run by#audit_statementson all 14 audited theoremsJoltConstraints/Audit/Commands.leansorry,sorryAx,admit, unlistedaxiom,native_decide,bv_decide,decide +kernel,maxHeartbeats,synthInstanceoption,respectTransparency falseordebug.skipKernelTCanywhere in the three libraries, or amaxRecDepthoutside the five that the Sail generator insertsscripts/check-lean-policy.py, on every build.github/workflows/lean.ymlsorrywithout a registry entry, or a witness or derived fact whose name does not resolve exactly in Leanscripts/check-assumptions.py; with--jolt-dir(run by hand at a re-pin) it also checks that every anchor exists at the pin.github/workflows/lean.ymlscripts/jolt_citations.py --check.github/workflows/constraint-generation.ymllakefile.tomlorlake-manifest.jsondiffers from[runtime]insail-import/PROVENANCE.tomlscripts/check-sail-model.sh --inputs-only, on every build; a change tolakefile.toml,lake-manifest.jsonorlean-toolchainalso triggers the full regeneration check.github/workflows/lean.ymlAfter an intended change,
scripts/update-audit-tables.pyrewrites the expected binder lists and the statement table from the build in one command.git diffofStatements.leanthen shows each changed statement in full and one line per changed definition, for review.Assumption registry
assumptions.tomlhas 28 entries: every binder of the five headline theorems (including #73's new completeness premiseSetupSized), every field ofRv64ProgramImage, the scope premises (DecodedFrom,BlockConforms.riscv,JoltField), and:DoryConfiguration, because the configuration and sizing model covers only the base Dory build, not theakitafeature, andDefaultDorySetup, because soundness covers only verifiers built with the default Dory setup: nothing in the verifier bounds the setup size or the committed chunk width (the entry gives a parameter set that passes every check). Sizing model: cover non-default Dory setups and the Akita build #76 records a Lean-side design that lifts this scope andDoryConfiguration;TracerInitialization(the model loads preprocessing'smemory_init, while the tracer loads only some section types and caps memory for atohostsymbol) andHostAllocation(the model assumes a host advice write always allocates);Each entry gives its Lean name and kind, the Jolt functions it depends on as
path (fn)anchors at the pin, and its necessity witness with awitness_showsline saying exactly what the witness proves, or the reason it has none.scripts/check-assumptions.pychecks that every witness and derived name equals the list the Lean build resolves, instead of matching name suffixes in the source.Necessity witnesses
JoltConstraints/Audit/Necessity.leanholds examples showing that the model does not already guarantee a premise. If a re-pin makes the premise provable, the witness stops building. Each docstring now says exactly what it proves:joltField_not_implied:[Field F]does not implyJoltField(ZMod 2). It does not build a satisfying assignment over a small field.blockConformsRiscv_not_implied:DecodedFromadmits a program whose only row is Jolt's ownAdviceLD x1. It does not build a trace.memoryInitInProgram_not_derived: a non-text section of size 0 with one byte of data puts a byte pastprogram_end.JoltConstraints/Audit/ImageFields.leanprovesnext_pc_no_wrap,instruction_loadedandprogram_end ≥ RAM_STARTfromDecodedFrom, without using the image fields.Nightly comparison against Jolt main
.github/workflows/jolt-main-drift.ymlruns nightly and on demand. It:JoltConstraints.ConstraintGen.Equivon it;git diff --statfrom the pin to main over every registry anchor and every Jolt file a Lean comment cites (scripts/jolt_citations.py, 291 files), and lists the entries and Lean files each changed file backs. It also lists, in their own section, changed production Rust files and build inputs that nothing cites, in every crate of Jolt's workspace except examples,jolt-eval, inline fixtures,z3-verifierandjolt-profiling;jolt-drift), with the report fromscripts/jolt-drift-report.py, and uploads the full report, path lists and diffs as thedrift-evidenceartifact. Where the issue body is cut, it points at the artifact.The report opens with whether the run could monitor Jolt main. Drift never fails the job. A failed checkout, pin fetch, regeneration copy, Lean setup, anchor comparison, report or issue update does: the report is still published, says which step failed, and never repeats an earlier night's content.
actionlintpasses on both workflows. The workflow has not run on GitHub yet: scheduled runs start once it is on the default branch.Bug reports and re-pin procedure
bug-report/has a TOML header withstatus,reproduced_at,fixed_byandregistry. New READMEs fordevice-readonly-storesandram-address-wraparound.device-readonly-storeshas status and revision "unknown" (Input/advice stores: potential soundness gap a16z/jolt#2041 is open).ram-address-wraparoundhas revision "unknown". The "fixed by feat!: end proofs at halts and bind the panic claim; delete the flag words a16z/jolt#2451" status ofram-val-terminationis inferred: the reproducer was not rerun.AGENTS.mdgains a section, "Re-pinning Jolt": read the drift issue, move the pin in one commit, run the registry check against the new Jolt checkout, ask for each new Jolt check which entry it makes provable, and rerun open reproducers.Fixes from the external review
initial_state) passed; the nightly job watched 18 files and missedcommon/src/jolt_device.rs, the verifier and its configuration.#audit_statementsfingerprints every definition below each statement; the nightly job watches every cited Jolt file; the registry gains the scope, correspondence and derived entries above.sorry:admit, a newaxiomor a banned tactic passed, and#print axiomsprinted without failing.check-lean-policy.pyand#assert_axioms. A block comment now counts as a token separator, soby/- c -/admitis also rejected.witness_showssay exactly what each proves; stronger witnesses are under Not done.DoesNotExist.joltField_not_impliedpassed).PROVENANCE.toml, and dependency files did not trigger the Sail check.check-sail-model.sh --inputs-onlyon every build, and the wider trigger.The model and documentation findings (F1–F4, F11–F13) are fixed in #73, whose description lists them.
Fixes from the second external review
A second review of this PR at
20b949b, and an independent review of the fixes, found these gaps in the checks.JoltConstraints/Audit/Test/checks a private-name collision, a member reached by an earlier theorem only, and independence from theorem order. The table lists 701 definitions (this description earlier said 699).tracer/src/instruction/addi.rswent unreported.Cargo.toml.sorryAx, treated/-inside«…»as a comment, exempted a whole line for one allowedmaxRecDepth, and misread raw strings and character literals after!,?, digits and dotted names.sorryAxis banned. The scanner reads Lean tokens the way Lean's tokenizer does, exempts allowed options by their exact position, and fails closed where it cannot decide.scripts/tests/lean-policy/has a fixture for each bypass; each compiles and the scanner rejects it.AGENTS.mdstill saidbv_decidewas accepted.Not done
ff6fc6568is the next step.memory_init_in_programdoes not follow fromDecodedFrom:ElfSectionrecords nothing about the data length of a non-text section, and the witness above shows the gap. Closing it changes a definition.DecodedFromnow implies fromRv64ProgramImagealso changes a definition.BlockConforms.riscvwitness at the block level, with a trace.Validation
42b14f7):python3 scripts/check-assumptions.py --jolt-dir <Jolt at ff6fc6568>reports "28 entries, 0 sorry, 52 binders and fields, 14 audited theorems: all registered", and every anchor resolves.scripts/check-lean-policy.py: 784 files pass; the allowlist covers the 67 floating-point axioms ofLeanRV64D/RiscvExtras.leanand the 5 generatedmaxRecDepthoptions.scripts/jolt_citations.py --check: 291 cited files resolve at the pin.python3 -m unittest discover -s scripts/tests: 14 tests pass.actionlintpasses on all workflows.e07a6fe.lake build JoltConstraintssucceeds locally (2493 jobs) on the stacked T5 branch, which contains every Lean change here, including#audit_statementson all 14 audited theorems with onlypropext,Classical.choiceandQuot.sound. I builtJoltConstraints.Auditand its tests on this branch, not the whole library; CI builds it.dorySetupLogN,lrwProgramAuto,one_hot_fits_setupand the two completeness theorems).jolt-drift-report.pyexits with status 3 and still writes the report when it has no Jolt checkout, and with status 0 against a checkout at the pin. On a synthetic Jolt commit that changes onlyADDI::exec, the old report finds nothing and the new one lists the file. The nightly workflow and its artifact upload have not run on GitHub.6763e65and45d484e. A review of the second round found three issues in the scripts, fixed in22cbf75,48640dcand42b14f7.🤖 Generated with Claude Code