Skip to content

feat: sync dtumad fork (Jun–Oct 2026): native AIR→Sail soundness, whole-chip faithfulness, full-state model, Lean 4.33.1 - #123

Open
dtumad wants to merge 1440 commits into
succinctlabs:mainfrom
dtumad:main
Open

dtumad wants to merge 1440 commits into
succinctlabs:mainfrom
dtumad:main

Conversation

@dtumad

@dtumad dtumad commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Scope of this description. Base: upstream main at 512e944a (#104, 2026-06-25). Head: dtumad/sp1-lean main at bd7ecf1d (dtumad#150, 2026-10-15). The base is an ancestor of the head, so there are no upstream-only commits. The range has 1,274 commits (1,155 non-merge) and touches 1,767 files. The head branch keeps moving: open fork PRs dtumad#151 and dtumad#153 are not described here. File links below are pinned to bd7ecf1d. Fork PRs and issues are written dtumad/sp1-lean#N; a bare #N means an upstream PR in this repository.

Summary

Since #104, development moved through a stack of upstream PRs (#106–#117, #119–#122) and then, from September, to the fork, where it continued through dtumad#1–150. This PR is the single place to review all of it. The work falls into four groups.

  1. The machine-level theorem was replaced. Upstream's sp1_machine_soundness depended on a sorry (sp1_witness_decode) and concluded only that some sub-trail of rows is Sail-correct row by row. It is gone. In its place is supported_core_native_sound, a closed theorem over a 55-table native Clean ensemble. It applies to a single shard with no active syscall rows: COMMIT, HINT, WRITE and the other host calls are excluded. From constraints and channel balance, plus explicit semantic premises (provider truth and uniqueness, the start state, code/data separation), it derives an exhaustive, clock-ordered official-Sail execution.
  2. Faithfulness and conformance to SP1 were strengthened.
    • Proved, relative to a trusted extractor: all 25 instruction chips are faithful as whole chips to the constraint lists extracted from SP1 v6.4.0. The assertions agree (iff) on every row, and the active interaction multisets agree on accepted rows.
    • Tested, not proved: separately, differential tests compare Clean's generated Rust against live SP1 v6.9.0 for all 25 instruction families and the six byte providers.
  3. The semantic side became a full-state model. There is a complete execution model (Sail state + concrete eight-call host + clock) with exact finite snapshots, write permissions and resource limits. A shard-level capstone statement is fixed and checked, but its two target hypotheses are not yet instantiated. Completeness is proved for a deterministic but noncomputable compiler, on a readiness-restricted, syscall-free domain. So far that domain is inhabited only by an empty-shard fixture, and totality over ordinary shards is open.
  4. The infrastructure was rebuilt. Lean 4.28 → 4.33.1, the Sail model generated in-tree, riscv-lean retired, a core/full build split, a compiled-library trust policy in place of the axiom census, zero sorry, zero hand-written maxHeartbeats, and CI rewritten for GitHub-hosted runners.

The repository is sorry-free. The hand-written libraries declare no axioms (gated); the vendored generated Sail model declares 75 extern axioms, 74 of them allowlisted by the trust policy. Every theorem below is labelled closed, conditional or open:

  • closed means proved; its listed premises are part of the theorem's input relation;
  • conditional means it depends on hypothesis bundles that nothing instantiates;
  • open means not proved.

The boundaries are spelled out in Known limitations.

Why a fork. Stacking PRs on this repository blocked integration: each PR waited on the one below it, and CI ran on self-hosted runners we could not use from a fork. Moving to dtumad/sp1-lean gave the work its own PRs, issues and CI. This PR tracks the result for review and syncing.

How to read this PR

The diff is not reviewable line by line. Most of it is generated, and much of the hand-written churn is in proofs whose statements are what matter. Sizes, measured from git diff --numstat 512e944a bd7ecf1d:

Part Files Lines (+ / −) Notes
Hand-written Lean, scripts, Rust, docs 1,381 +315.8k / −41.4k hand-written tree grows from 342 to 1,252 files (72k → 351k lines)
Vendored generated Sail model (LeanRV64D/) 161 +174.3k regenerated byte-identically in CI
Committed fixtures (export/: SP1 trace dumps, R1CS/WASM gadgets) 74 +99.5k
Extracted Rust-AIR oracles (SP1Clean/Extracted/) 96 +20.3k / −3.9k written only by update_extracted.py
Snapshots, nolints.json, deleted test vectors ~55 +13.6k / −11.4k

.gitattributes marks LeanRV64D/**, SP1Clean/Extracted/** and export/** as linguist-generated.

Suggested review route (the fork's own audit route lives in docs/assurance.md and docs/semantics.md):

  1. What is proved now: the theorem table and the premises it lists.

  2. SP1Clean/Soundness/AIR.lean: the closed AIR→Sail theorem and the exact relations it relates.

  3. One instruction end to end. ADD:

    For depth, DivRem: Semantics/Specs/DivRem.lean.

  4. Faithful/ChipOracle.lean (ChipFaithful): exactly what is compared with SP1's Rust.

  5. FormalModel/Shard.lean and Soundness/Shard/Contract.lean: the full-state target, which is conditional.

  6. The new repository setup, then the trust policy scripts/trust_policy.json.

At a glance

Significance: ★★★ changes what is proved, or what SP1 must trust or review · ★★ major · ★ moderate. Size counts hand-written lines only: XL ≥ 20k · L 5–20k · M 1–5k · S < 1k.

Change Sig. Size Type
Native AIR→Sail soundness (supported_core_native_sound) replaces the sorry-backed GatedVm capstone ★★★ XL proof result
Ordering and memory grounding: exhaustive ranked trail, timed per-location memory walk, refresh elimination ★★★ XL proof result
Whole-chip ChipFaithful for all 25 instruction chips (SP1 v6.4.0 extraction); exact 34+6-table Core AIR relation ★★★ XL faithfulness
Full-state execution model (Sail + eight-call host + clock), snapshots, write policy, resource contract ★★★ XL proof result
Shard capstone statement Shard.statement_iff (conditional), installed six-call host checkpoint (closed) ★★★ XL proof result
Deterministic witness compiler + supported_core_native_complete (restricted domain); generic Clean table builder ★★★ XL proof result
Clean pinned to a fork (dtumad/clean@c4abcbb9): built-in Rust export plus rewritten ensemble/verifier definitions used by every ensemble theorem ★★★ (dep) toolchain/deps
Trust policy on compiled oleans replaces the committed axiom census; zero-sorry gate ★★★ S trust/CI
Instruction layer re-architected: pure Semantics/Specs, bundled Circuits/Gadgets, explicit selectors, new system and host chips ★★ XL architecture
Clean built-in Rust export compared with live SP1 v6.9.0 (25 families + 6 byte providers), plus fixed-column authentication ★★ L export/conformance
Lean/Mathlib 4.28 → 4.33.1; Sail model generated in-tree; riscv-lean retired; PolyFun added ★★ L toolchain/deps
New layout: SP1Core/SP1Clean split, strata, To* upstream-staging libraries, module system (partial) ★★ M architecture
CI on ubuntu-latest with strict --wfail --iofail; build-time campaign; maxHeartbeats 259 → 0 ★★ M CI/perf
Docs restructured (maintained guides 11 → 20, generated snapshots removed), plus dated audits and an external review disposition ★ M docs

What is proved now, compared with upstream

Upstream at 512e944a. There were 25 chips with per-chip soundness/completeness and correct_<op>_native Sail bridges. Faithfulness anchors existed per operation: mostly stated only for is_real = 1, with syntactic interaction comparison for 4 chips. The machine theorem sp1_machine_soundness covered 25 tables and 4 channels, had no provider tables, and inherited one sorry. Target.sp1_target_execution was conditional on an open TargetObligations bundle. Witness generation was checked by native_decide vectors for 10 chip traces and 13 operations. The audit allowed one sorry and nine sorryAx carriers.

At bd7ecf1d. The main library has no sorry, no project axiom, no native_decide and no skipKernelTC, all gated. Theorem dependencies are restricted to the trust policy.

Result Where Status Boundary (read before citing)
Per-chip soundness and completeness for 25 instruction families; per-chip Sail step ChipKind.advance (one real try_step produces the row's effect) Proofs/Chips/*, Alignment/Chips/*/Bridge.lean closed Chip Assumptions (19 chips still assume operand/immediate ranges); channel guarantees discharged at machine level; 25 families, not all of RV64IM
ChipFaithful for 25/25 instruction chips, plus MemoryBump/StateBump (SyscallInstrs uses a factored variant) Faithful/ChipOracle.lean, Faithful/SupportedMachine.lean closed Against SP1 v6.4.0 extraction; the extractor is trusted; reconstructed rows; interactions compared on accepted rows, nonzero multiplicities
supported_core_native_sound: native 55-table relation ⇒ official-Sail run (ordinary, or ending in modeled HALT) Soundness/AIR.lean closed Premises: provider truth/uniqueness, start state, SailCodeMemoryCompatible, SyscallTableInactive; single shard
supported_core_boot_to_halt_single_shard Soundness/BootHalt.lean closed One shard that both boots and halts; no inhabitant is constructed
exists_exhaustiveTrail: balance + strict rank ⇒ walk whose multiset equals all edges Soundness/RankedGrounding.lean closed Generic graph theorem; the circuit must establish the premises
ExecutionSnapshot.equivalent_iff: executable comparison ⇔ equality of complete realized states Model/Core/ExecutionSnapshot.lean closed Sparse; no dense RAM
HostHintReadCPU.source_execution_with_memory: raw constraints + balance of an 89-table host ensemble ⇒ an ExecutionPath with write permission and endpoint facts (PC/clock, memory/register frames, host) for an existential target Soundness/HostHintReadFinalSnapshot.lean closed Six of eight host calls (no WRITE/VERIFY); existential target; caller-indexed queue cursor/banks/channels
supported_core_native_complete: deterministic nativeTrace compiler onto the 55-table relation Soundness/NativeCompleteness.lean closed on a restricted domain Needs NativeTraceReady (13 fields, incl. syscall-free and exit 0) + channel capacity; noncomputable
…_shard_correct_of_totality, …_language_eq_of_totality same conditional On NativeShardTraceTotal, which is open
Soundness.Shard.statement_iff: ensemble.Statement header ↔ ∃ events, AdmissibleExecution … Soundness/Shard/Contract.lean conditional SoundnessTarget/CompilerTarget are not instantiated; a CI manifest pins their types
sp1_air_sound_of_obligations (exact upstream 34+6-table AIR ⇒ semantics) Soundness/CoreAIR.lean conditional 12 uninstantiated obligations; no unqualified sp1_air_sound is declared
CounterExample.statement_iff: a complete Realizes instance (raw acceptance ⇔ semantic traces) Soundness/Examples/Counter.lean closed A toy bounded counter over ZMod 97, not SP1

Explicitly not claimed:

  • cryptographic verifier soundness (verifyCore = true ⇒ execution);
  • exact refinement of SP1's deployed AIR;
  • full RV64IM, compressed instructions, floating point, precompiles, or user/mprotect mode;
  • multi-shard composition;
  • WRITE/VERIFY in the AIR;
  • a verified Rust lowering (the Rust comparisons are tests);
  • extractor correctness;
  • that the generated R1CS/WASM or Rust is a complete SP1 backend.

The new repository setup

Toolchain and dependencies

Package Upstream 512e944a Fork bd7ecf1d Why / exit path
Lean / Mathlib v4.28.0 v4.33.1 (via 4.30 → 4.31 → 4.32.2) Clean main and PolyFun moved to 4.33
Clean Verified-zkEVM/clean@292b9cc3 (an intermediate commit of Verified-zkEVM/clean#398, since merged) dtumad/clean@c4abcbb9 See below. The exit is upstream Verified-zkEVM/clean#446 landing; that will need a migration, because Verified-zkEVM/clean#446 has since diverged
Sail runtime rems-project/lean-sail@v4 (transitive) dtumad/lean-sail@bde9ecc6 = tag v5 + 1 line The open PreSail disambiguation; Lean 4.33's ambiguousOpen warning otherwise breaks --wfail. Exit: rems-project/lean-sail#14
Sail RV64 model succinctlabs/sail-riscv-lean @ moving branch, hand-edited in-tree, generated LeanRV64D/ (161 files) Generated from sail-riscv 61266bd4 with compiler 41694abd plus a 2-key overlay (CLINT and the simple interrupt generator disabled; their windows sit inside SP1's RAM). sail-regen.yml checks byte-identical regeneration
riscv-lean succinctlabs/riscv-lean @ moving branch removed Replaced by Semantics/ISA/RV64.lean (30 pure reference functions) and re-proved bridges in Proofs/Sail/RV64Bridge.lean
PolyFun (+ cslib) — Verified-zkEVM/PolyFun@997828ce Labeled machine-trace vocabulary for the shard target; its axiom-sweep script powers check_trust.py
CompPoly — transitive via Clean R1CS gadget export

The Clean fork is the main new trust dependency.

All pins are immutable commits or tags. scripts/check_pins.py cross-checks the Lake manifest, the Cargo SP1 crates, the Sail tree hash and scripts/provenance.json. Do not run bare lake update.

Libraries and build targets

Target Contents Built by
SP1Core (default) strata 0–6: Math, Model, Semantics, Circuits, Extracted, FormalModel, gadgets, chips and chip proofs (root SP1Clean/Core.lean) lake build
ToClean / ToMathlib / ToPolyFun (default) module-mode "to upstream" additions in the upstream's own namespace; may not import SP1Clean lake build
SP1Clean everything above plus strata 7–11: Faithful, Soundness, Alignment (Sail bridges), Proofs/Sail, Completeness, Composition lake build SP1Clean
SP1CoreTest / SP1CleanTest tests; the only place native_decide is allowed lake test / lake build SP1CleanTest
LeanRV64D, LeanRV64DRvfi the generated Sail model (Rvfi built with the legacy do elaborator to dodge leanprover/lean4#13858: 718 s → 2.5 s) dependency
backendGadgets (exe) WASM/R1CS gadget fixtures full CI

⚠️ A bare lake build no longer checks faithfulness, machine soundness, the Sail bridges or completeness. Use the full command below. The old per-pillar libraries (SP1Math … SP1Proofs) and sp1Lint are gone, and linting is Batteries runLinter plus Mathlib's standard set. Strata are enforced by scripts/check_layering.sh (docs/layering.md).

Directory map (SP1Clean/)

Directory Role vs upstream
Math/ word and arithmetic foundations small changes
Semantics/ ISA/RV64.lean reference functions; Specs/ pure semantic contracts for gadgets and chips new
Circuits/ Types/ native column types; Gadgets/ bundled gadget circuits + witness generation + proofs (Clean-style Specs/Types/Gadgets split) new
Model/ Core/: the complete execution model (state, steps, paths, snapshots, host calls, write policy, resources); Semantics/: Sail step/frame/fetch vocabulary; Machine/: PolyFun machine 11 → 123 files
Extracted/ generated: whole-chip ChipOracle/ (25), SystemOracle/ (12), Core AIR manifest, opcode table, provenance. Upstream's Extracted/Circuit/ is gone restructured
FormalModel/ the audit surface: Contracts/ (chip/reader specs and assumptions), TraceGen/, Shard.lean (full-state target), CoreAIRRelation.lean 6 → 73 files
Native/ chip mains (now including Halt, SyscallInstrs, MemoryBump, StateBump, host chips), operations, readers expanded
Proofs/ Chips/<X>/{Formal,Complete,Witgen}, Operations/, Completeness/ (trace compiler, assembly, closure), Sail/ (advance, decode, RV64 bridge) expanded
Alignment/ per-chip Sail bridges Alignment/Chips/<X>/Bridge.lean (moved from Proofs/Chips/<X>/) new
Faithful/ whole-chip ChipFaithful anchors, SupportedMachine.lean, exact CoreAIR.lean restructured
Soundness/ native capstone AIR.lean, grounding (ranked/timed/typed), host assemblies, Shard/, NativeCompleteness.lean, Examples/ 27 → 232 files
Composition/ exact-Rust→native transport (instruction segment closed; providers and Sail under named contracts) new

Top level: ToClean/ (42 files), ToMathlib/ (6), ToPolyFun/ (2), LeanRV64D/ (generated), rust/sp1-comparison (SP1 v6.9.0 inventory and export comparison), rust/witgen-interp (legacy JSON witness interpreter), export/ (fixtures), tools/backend-gadgets (pinned Node/snarkjs), scripts/ (9 → 60 files). SP1CleanTest/ now holds Core/, Alignment/ and three TraceGenTests/ support files.

Where did upstream things go?

Upstream 512e944a Fork bd7ecf1d
Soundness/SP1GatedVm.lean (sp1_machine_soundness, one sorry), GatedVm/*, TargetVm.lean deleted; replaced by Soundness/AIR.lean (+ GroundingInternal, ProviderBindings, BootHalt). GatedVm/Chain → Soundness/Walk.lean; BalanceMod → Model/BalanceBridge.lean
Soundness/{State,Byte,Program,Memory}Consistency.lean, InstructionTrace, Completeness, ChipAir deleted; replaced by typed bus views, provider tables in the ensemble, Proofs/Completeness/
Proofs/Chips/<X>/Bridge.lean Alignment/Chips/<X>/Bridge.lean
Faithful/<Op>.lean per-operation anchors whole-chip Faithful/<X>Chip.lean; 12 helper op anchors kept
Extracted/<X>Chip.lean, Extracted/Circuit/* Extracted/ChipOracle/<X>.lean; generated circuits deleted (Mul's became the hand-written Circuits/Gadgets/Mul)
Native/Operations/{IsZero,Lt*,U16*,Bitwise*,Mul}…, Proofs/Operations/* Semantics/Specs/* + Circuits/Gadgets/* + Circuits/Types/*
FormalModel/Trace/GuestProgram.lean Model/Semantics/GuestProgram.lean (extended; namespace unchanged)
SP1CleanTest/WitnessTests/*, TraceGenTests/*Trace{Vectors,Witness} (native_decide) deleted; replaced by export/sp1dump/ (25 SP1 trace dumps) + a fail-closed export gate + Rust comparisons
scripts/axiom_probe.lean, gen_axiom_probe.py, docs/snapshots/axiom-* deleted; scripts/check_trust.py + trust_policy.json
docs/release-audit.md, bus-model.md, snapshots/compile-profile* folded into docs/{assurance,semantics,architecture}.md, docs/audits/*, docs/agents/*
Comparison.lean, Math/Misc.lean, Math/GetElemFastPath.lean, Model/InteractionRecovery.lean deleted / ToMathlib/General.lean / ToClean/Tactic/GetElemFastPath.lean / ToClean/Circuit/InteractionRecovery.lean

Build and verify

lake exe cache get                                   # Mathlib oleans only
lake build --wfail --iofail                          # core (SP1Core + To*)
lake build --wfail --iofail SP1CoreTest              # core tests (= lake test)
lake build --wfail --iofail SP1Clean ToClean ToMathlib ToPolyFun backendGadgets   # full
lake build --wfail --iofail SP1CleanTest && lake lint -- --no-build
scripts/run_audit.sh            # pins, source gates, capstone manifest, trust scan (main + test)
python3 scripts/check_examples.py; scripts/check_ensemble_export.sh; python3 scripts/check_witgen_export.py  # needs Rust 1.95

A cold CI run on a 4-vCPU ubuntu-latest runner takes about 2 h: core ≈ 32 min, full ≈ 31 min, full tests ≈ 14 min, examples ≈ 25 min. Warm runs take 20–70 min. Use LEAN_NUM_THREADS=3 on 4 cores. Generated inputs: update_extracted.py (extraction), scripts/sail-config/generate_lean_rv64d.sh (Sail), scripts/update_sp1_dumps.sh (SP1 dumps).

Headline changes

1. Native AIR→Sail soundness (replaces GatedVm)

Phases P1, P2, P6–P9; #106, #107, #115, #120–#122.

supported_core_native_sound is the closed theorem WitnessRelation.Sound SupportedCoreNativeRelation SupportedCoreSailRelation, stated for any field with 2^25 < p. It is stated over a plain Clean Ensemble (Soundness/SP1Ensemble.lean).

The ensemble has 55 tables and 7 channels (State, Byte, Program, Memory, Exit, Syscall, PublicValues). The tables are:

  • the 25 instruction tables;
  • 30 provider/system tables:
    • 6 Byte;
    • 17 Range widths 0..16;
    • Program;
    • MemoryInit;
    • MemoryFinalize;
    • MemoryBump;
    • StateBump;
    • Halt;
    • SyscallInstrs.

Premises. The input relation has three conjuncts: what the AIR checks (public input, constraints, balance), an explicit semantic boundary, and an interim SyscallTableInactive. The boundary (ProviderBindings.lean) consists of:

  • program well-formedness and encodability, program ROM content, and initial-memory content;
  • per-location init/finalize uniqueness;
  • the shard start state (PC, ROM loaded, SailConfigured, which pins privilege, interrupts, misa.M/C, PMP off and PMA);
  • SailCodeMemoryCompatible.

Conclusion. Either a normally-retiring official-Sail run with exit code 0, or a retiring prefix to SP1Halted followed by modeled HALT (+264 ticks). Either way the run comes with a populated Memory boundary, covering canonically addressed, genesis-backed records only.

Derived inside the proof, not assumed:

  • the exhaustive, clock-ordered row order;
  • committed decode of every active row;
  • per-row specs;
  • operand currency;
  • 24-bit memory timestamp bounds (an interim premise during P2–P6);
  • canonical boundary limbs;
  • the exit dichotomy.

How it is proved.

  • Ordering: exists_exhaustiveTrail (balance + strict ℕ rank ⇒ every edge exactly once). Balance alone admits disconnected cycles (Soundness/Examples/StateBalance.lean), and Clean's VM theorem permits them. The memory argument needs exhaustiveness.
  • Memory: a timed per-location walk (TimedGrounding, TouchChains for same-row aliases such as add x1,x1,x2, RefreshElimination for MemoryBump), on top of per-chip grounding contracts for all 25 chips.
  • History: P1 briefly made State/Program "semantic channels". P2 reverted that in favour of global grounding.

Siblings, all closed: supported_core_native_sound_scheduled, supported_core_native_grounding, supported_core_native_shard_execution, and supported_core_boot_to_halt_single_shard.

2. Whole-chip faithfulness to SP1's Rust AIR, and SP1 conformance

Phases P2, P5, P6, P14, P15; #107, #114, #115, dtumad#115, dtumad#129–143, dtumad#149.

Proved. ChipFaithful replaces about 50 per-operation anchors. It states that SP1's complete extracted assertZero list holds iff the native constraints hold on the reconstructed Clean row, for every Rust row including padding. On rows where SP1's asserts hold, the complete active interaction multisets are permutations of each other. FaithfulPropFor binds each proof to its table in the kernel, so a mispaired anchor is a type error.

The exact Core AIR. Faithful/CoreAIR.lean defines SP1's 34+6-table Core AIR as a Lean relation built from the extracted lists. On top of it:

  • extracted_instructionTables_constraints is closed: the exact relation yields the 25 native instruction tables.
  • The provider-segment and Sail composition (Composition/) and sp1_air_sound_of_obligations are conditional.

Extraction. update_extracted.py was rewritten to emit whole-chip and system oracles plus a manifest, and it no longer emits circuits. Provenance is pinned to SP1 v6.4.0 (semantic f66b4bff, extractor b5616f90).

Tested against SP1 v6.9.0. rust/sp1-comparison (pinned to b8387fa6) compiles Clean's built-in Rust export and compares it with SP1's live trace generator and AIR, for all 25 instruction families and the six byte providers, in supervisor mode with open buses. It checks three things, plus column-mutation batteries:

  • witness rows;
  • constraint verdicts;
  • full (channel, mult, message) ledgers, including zero multiplicities.

Comparison testing found and fixed three native discrepancies:

The last two were found against v6.8.1, before the move to v6.9.0. A source review found no CPU-AIR change from v6.4.0 to v6.9.0 (dtumad#149), but nothing was re-extracted at v6.9.0. The docs label the extraction/ChipFaithful layer "legacy Rust alignment".

For a few operations (the Addw/Subw/LtU own-asserts and the DivRem tail), the native constraint list is a transcription of the generated one. There, ChipFaithful acts as a pin-drift tripwire rather than independent cross-validation.

Upstream's native_decide vector batteries were replaced by 25 committed SP1 generate_trace dumps (export/sp1dump/) and a fail-closed cell-for-cell generation gate.

3. Full-state execution model and the shard target

Phases P10, P12; dtumad#1, dtumad#61–99.

The state. ExecutionState (Model/Core/, 63 files) is one official Sail state, a concrete host state and a clock. The host state holds the hint queue, two eight-slot commitment banks, outputs, requests and exit.

Steps.

  • Ordinary steps require SailRetiresNormally and cost 8 ticks.
  • Host calls run the eight-call interpreter (HALT, WRITE, ENTER, COMMIT, COMMIT_DEFERRED, VERIFY, HINT_LEN, HINT_READ) and cost 264 ticks. The ECALL bytes are checked in both committed code and actual Sail memory.
  • HALT is a real transition.

Snapshots. Finite ExecutionSnapshots compare exactly (equivalent_iff).

Shard.Executes includes byte-level write permission, and comes with three closed results:

Resources. nativeProfile adds data-only ResourceLimits plus encoding conditions: phase-one clock and aligned loads/stores. This replaced a free Profile predicate (dtumad#78–82). The 2026-09-19 review had shown that the free predicate let the target statement hold vacuously.

The capstone statement. Soundness.Shard.statement_iff (ensemble.Statement header ↔ ∃ events, AdmissibleExecution …) is fixed and checked, but it is conditional: SoundnessTarget and CompilerTarget are not instantiated. statement_iff_of_realizes derives the same statement through Air.Flat.Realizes on PolyFun's sp1Machine. scripts/capstoneContract.lean pins the statement's types and definition fingerprints (1,395 entries).

Closed installed results.

  • HostHintReadCPU.source_execution_with_memory works over an 89-table assembly. From raw constraints and balance it derives a genuine ExecutionPath to some target, with WritesPermitted, the PC/clock endpoint, all native memory and register frames, and host reconstruction.
  • Separate installed ensembles prove:
    • the complete final-Memory check (HostFinalMemory.source_checkFinal, 93 tables);
    • static Sail-frame and PC/clock binding (HostSailBoundary.statement_iff);
    • endpoint resource checks (ResourceEnsemble.statement_iff);
    • ordinary State receipts.
  • No single ensemble combines all of these yet.

4. Completeness and witness construction

Phases P5–P8, P12, P13; #114–#117, #119–#121, dtumad#81, dtumad#103, dtumad#141.

Generic construction (ToClean). ToClean/Air/TableBuild.lean runs each circuit's own witness generator with committed data and hints (staging Verified-zkEVM/clean#450) and proves the built rows satisfy the constraints and guarantees (buildRow_constraintsHold, build_constraints). Realizes/CompleteEnsemble give a generic "raw acceptance ↔ admissible trace" interface.

Per chip. All 25 instruction chips have IR-only witness generators with computableWitnesses proofs (check_no_witness_native.sh gate), plus table-completeness theorems. Since dtumad#141 no instruction chip reads prover hints.

Whole machine. nativeTrace (Proofs/Completeness/) is a deterministic compiler, and supported_core_native_complete is closed. Its domain is the semantic relation restricted by NativeTraceReady (13 named premises, including syscallFree and exitZero) and channel capacity. NativeShardTraceTotal, the claim that every ordinary shard satisfies those premises, is open, so correctness and language equality are conditional on it.

Progress toward totality.

Examples.

5. Instruction layer

Phases P1, P2, P6, P9, P10, P14, P15; #106, #107, #115, #122, dtumad#116–141.

The same 25 chips. The same 25 instruction chips are registered (Soundness/ChipRegistry.lean), all with closed soundness and completeness. Each now also proves computableWitnesses (honest witness generation from the IR) and traceTable_constraints (well-formed events build a valid table). What changed for a reviewer:

Sail link. Upstream's correct_<op>_native statements are kept, but only as local helpers. Each chip now proves ChipKind.advance: from a refining Sail state, one real try_step produces exactly the row's committed PC/register/memory effect (Proofs/Sail/Advance.lean). Decoder agreement with Sail is proved in Proofs/Sail/InstructionDecode.lean. The readiness premises of advance are discharged by the grounding layer.

Native gadgets, not extracted circuits. Extracted/Circuit/* is gone. Gadgets are hand-written Lean over native column types (Circuits/Types), and native code may not import Extracted/. Contracts are split into pure Semantics/Specs and bundled Circuits/Gadgets:

  • IsZero;
  • word equality;
  • U16;
  • unsigned and signed Lt, now with semantic whole-word order contracts;
  • Bitwise;
  • Mul;
  • DivRem.

The Add/Sub/Address operations and the readers still use the older layout.

Assumptions became constraints:

  • load/store address ranges (2^16 ≤ addr < 2^48);
  • the op_a_0 routing gates;
  • ALU operand isU64, now derived from Memory-pull guarantees, so Assumptions = True for Add, Sub, Subw, Bitwise, Mul and AluX0.

The other 19 chips still assume operand/immediate ranges.

Explicit selectors. DivRem, Mul, Bitwise, Lt, ShiftLeft, ShiftRight and Branch take explicit opcode selectors, and no instruction chip reads prover hints. How the Specs handle selection varies:

  • Mul, Branch and DivRem state exactly-one selection on real rows;
  • Bitwise states pairwise exclusion;
  • for Lt and the shifts, one-hot is an advanceReady premise discharged by grounding.

New circuits:

  • StateBump/MemoryBump;
  • Halt;
  • SyscallInstrs (13 arms);
  • CoreSyscall;
  • nine host-call chips;
  • ProtectedStore;
  • LoadByteStatic, an alternative that is not registered.

Native-only additions not in SP1's AIR (to keep in mind when comparing):

  • write-permission pulls on stores;
  • the syscall profile guard;
  • Exit/PublicValues messages;
  • Program/Memory polarity flipped relative to SP1, bridged up to sign in Faithful/.

Fixes:

6. Export and backends

Phases P5, P13, P15; #114, dtumad#104, dtumad#129–150.

Upstream had no export path. The fork has two, and both are tests, not lowering proofs.

(a) Witness-IR JSON (transitional). All 25 chips serialize their witness programs through Clean's IR. rust/witgen-interp re-runs them, and the output is gated cell-for-cell against the v6.4.0-era SP1 dumps.

(b) Clean's built-in Lean→Rust export. Via the Clean fork, it covers:

  • the 25 instruction components;
  • the 6 byte providers (lookup-free ToClean.Gadgets.BitwiseByte);
  • register/RAM fixed-membership ensembles.

The instruction components and byte providers are compared with SP1 v6.9.0 as described above. The register/RAM ensembles have native Clean-backend tests only (clean_export.rs, ram_export.rs), with no SP1 comparison.

Fixed-column authentication. ToClean/Air/StaticProvider.lean replaced legacy lookups for snapshot source/target registers and RAM in the host and local-core assemblies (dtumad#144–148, dtumad#150). The provider premises of the 55-table theorem are unchanged. Five legacy lookups remain: program, syscall code, write permission, hint nodes, hint words.

Coverage. Of the 93 native components in coverage.json:

  • 31 are exported and compared with SP1;
  • 12 have native-backend tests only;
  • 50 are not exported.

R1CS/WASM. Three gadgets (IsZero, IsZeroWord, WordRangeCheck) are checked through Clean's Circom/WASM backend over BN254 with pinned snarkjs: 29 inputs and 26 mutations (dtumad#104).

Removed from git. The downstream sharing pass (WitgenShare) was replaced by Clean's Witgen.M, and 101 regenerated export files were dropped from git (dtumad#129).

Major infrastructure changes

Trust, tests and CI

The trust policy. scripts/check_trust.py scans the compiled main and test environments against scripts/trust_policy.json (dtumad#66, dtumad#67). It replaces the committed #print axioms census, which removed about 101k generated lines. The policy permits:

  • Lean's three axioms;
  • 74 named generated-Sail extern operations;
  • 17 named bv_decide proof owners, each a compiler-trusted native-evaluation axiom (12 Store bridges, 2 shift Sail lemmas, jump_to_of_mod4_eq_zero, and 2 inside pinned Clean);
  • test-only native_decide/bv_decide.

sorryAx, trustCompiler, ofReduceBool and unknown axioms are rejected.

⚠️ So theorems that reach Sail or the Store bridges are not "only [propext, Classical.choice, Quot.sound]". Upstream's stated goal was that; the fork's claim is policy compliance.

scripts/run_audit.sh requires zero sorry and zero stop. Upstream allowed one sorry and nine sorryAx carriers.

Other gates:

  • the capstone contract manifest;
  • check_release_surface.py, an inventory check of the 25-chip registry, oracles, anchors, dumps and Rust registrations;
  • layering, root index, pins/provenance, field and vocabulary singletons;
  • docs link resolution;
  • an option-escape allowlist, with 3 entries.

CI (.github/workflows/) moved from upstream's self-hosted RunsOn runners to one GitHub-hosted runner. Every build uses --wfail --iofail. The steps are:

  • guards;
  • core build and tests;
  • full build and tests;
  • lint;
  • ensemble export and Rust comparison;
  • examples;
  • witgen export;
  • WASM/R1CS;
  • trust fixtures and the audit.

It uses a lineage-selected cache (v2), a native-object cache, a PR→main build hand-off and rule-based cache GC. Additional workflows:

  • rust-comparison.yml (SP1 inventory, with and without mprotect);
  • sail-regen.yml (byte-identical Sail regeneration);
  • extraction_regen.yml (weekly);
  • cache-cleanup.yml;
  • build-experiment.yml.

Tests. SP1CoreTest/SP1CleanTest hold non-vacuity witnesses, adversarial and mutation fixtures, snapshot/host regressions, export fixtures and ensemble round-trips, about 570 native_decide sites in all. Python tooling has 12 unittest modules.

Toolchain, Sail and build performance

Four toolchain bumps. 4.30 (#106), 4.31 (#107), 4.32.2 (#110) and 4.33.1 (dtumad#31). In July the non-Mathlib dependencies were briefly local path dependencies; reproducible git pins came back in August.

The Sail model.

Elaboration budgets. Hand-written set_option maxHeartbeats went from 259 lines in 128 files to 0 (#108, #109). check_option_escapes.sh now prohibits new escapes instead of counting them.

The build-time campaign (dtumad#44–60):

  • RvfiDii 718 s → 2.5 s;
  • Register lemmas by kernel decide, −53% CPU;
  • extractor let hoisting: 62 s / 14 GB → 9 s / 3 GB;
  • narrowed Mathlib.Tactic imports;
  • kernel-cliff fixes;
  • -j2 with LEAN_NUM_THREADS=3.

Cold core builds after a toolchain bump went from 65–75 min to about 32 min.

Layout, modules and docs

Layout.

Module system. All To* files are modules, but only 77 of 1,122 SP1Clean/test files are; the rest run under allowNonModules, tracked in dtumad#33. The docs call the Semantics/Circuits/Machine reorganisation "in progress".

Lint. autoImplicit is off, Mathlib's standard linter set is enabled package-wide with 9 measured opt-outs, and nolints.json holds 3,836 entries of known debt, mostly docBlame.

Docs. Maintained guides grew from 11 to 20 and generated snapshots were removed, so docs/ went from 44 to 28 files (dtumad#114 consolidated 37 down to 28). The current set:

  • docs/{README,architecture,semantics,assurance,layering,export,examples,contributing,resource-contract,roadmap,witgen-wire-format}.md;
  • docs/agents/*;
  • 7 dated docs/audits/*;
  • docs/snapshots/capstone-contract.json.

The top-level README and AGENTS were rewritten too.

Maintained docs link to issues on the fork's tracker.

Review findings and known limitations

External and internal reviews:

Review Key findings Disposition at bd7ecf1d
External report on #110 (A. Hicks, Aug 2026; 45 pp.). The project's disposition summarises its verdict as real, high-quality and non-vacuous, but with scope materially narrower than "a verification of SP1's Core RISC-V AIR" 18 findings: bump tables missing, non-vacuity, final-State/finalize truths, provider transport, anchor pairing, SP1's RegisterAccessCols lacking #[repr(C)], KoalaBear literals in the exact relation, … The project's disposition marks most findings closed in #115; the report's author has not re-reviewed them. Open or partial: F1 (global exact refinement), F6 (#[repr(C)], not yet filed with SP1), F7 (KoalaBear literals), F15 (language alignment)
Independent semantic audit (Aug 12; agent-authored) ArkLib witness-type mismatch, loader contracts, system-table refinement gap, decode non-vacuity Fixed or tracked; decode non-vacuity now 18/18 families (restoring them for external-report F3 exposed a real missing misa.M condition)
Consolidation assessment (Sep 8) and capstone branch review (Sep 19; agent-authored) Free Profile predicate made the target vacuous; Executes admitted self-modifying code; installed theorem is existential; no mixed compiler; duplicate carriers Profile → data-only limits (fixed); self-modifying code excluded via WritesPermitted (fixed); duplicate carrier fixed; existential target and mixed compiler open

The agent-authored audits are navigation aids, not independent human sign-off.

Restrictions of the closed results (these must not be glossed over):

  • 55-table theorem:
    • provider truth and uniqueness are premises (per 8-byte cell);
    • shards with active syscalls (COMMIT, HINT, WRITE, …) are excluded;
    • halt-free shards are forced to exit code 0, which SP1 does not require;
    • HALT is modeled;
    • single shard only;
    • exact-balance idealization (LogUp/GKR/PCS out of scope);
    • non-vacuity is shown only by test-library fixtures (zero steps, plus one JAL x0,0), which use native_decide;
    • this is not SP1's deployed 34+6-table AIR.
  • Faithfulness: SyscallInstrs is factored. Its public-value/exit messages are native-only and not yet shown to be honoured, and the exact→native composition carries an empty SyscallInstrs table.
  • Full-state model:
    • full-64-bit syscall codes (SP1 dispatches on the low 32 bits);
    • mutable commitment banks;
    • misa.C = 0;
    • width-aligned memory access;
    • ENTER returns 0;
    • VERIFY records digests only;
    • host semantics cited to SP1 v6.4.0 sources and diff-reviewed against v6.9.0;
    • the installed boundary checks are computed in Lean from complete snapshots and embedded as constant assertions, so the AIR family is snapshot-indexed and there is no canonical public header;
    • ResourceLimits is a free parameter, and limits are enforced at the endpoints only.
  • Completeness:
    • restricted domain;
    • readiness is inhabited only for the zero-transition shard (a test fixture);
    • noncomputable compiler.

Known issues at this head:

  • The CI check on this PR shows red, but verification passed. Every build, test, lint, export, trust and audit step passed (run). Only the final "Drop this PR's older cache entries" step failed, most likely because a cross-repo PR token cannot delete caches. Fork CI on the same commit is green.
  • The weekly extraction-regen job has failed since Oct 5. update_extracted.py's native_structs() rejects the multiple Columns structures under Circuits/Types/. Until that is fixed, nothing re-derives SP1Clean/Extracted/ against the pin.
  • The docs point to a closed issue. They route remaining capstone obligations to Campaign A: close native full-state RISC-V soundness and completeness dtumad/sp1-lean#12. It closed one second after Bound fixed memory tables by live byte support dtumad/sp1-lean#147 merged, whose body says does not close #12; GitHub most likely matched that text as a closing keyword. Items C2–C12 are unchecked and remain open: supplied-target equality, WRITE/VERIFY, resources, the mixed compiler and SoundnessTarget.
  • Stale counts and paths survive in some comments and docs, for example:
    • "53 tables / 28 providers" (Proofs/Completeness/Assembly.lean, Model/InstructionChipId.lean, Faithful/SupportedMachine.lean);
    • pre-dtumad/sp1-lean#141 "hint-driven chip" docstrings;
    • layering.txt Bridge paths;
    • porting-recipe.md still describing the upstream four-artifact chain;
    • v6.4.0 vs v6.9.0 in resource-contract.md;
    • full-build commands that differ across README, AGENTS and CI.
  • Upcoming CI changes: ubuntu-latest moves to Ubuntu 26 on 2026-10-19, and Node 20 is deprecated across the pinned actions. Neither is addressed yet.
  • Planned direction: open Migrate to released SP1 with Clean-native Rust comparison and explicit coverage dtumad/sp1-lean#112 proposes eventually retiring the extraction/ChipFaithful/dump pipeline in favour of Rust tests. The docs say this would not be a formal lowering theorem.

Upstream contributions and external status

Upstream Item Status
Clean Verified-zkEVM/clean#446 built-in Rust export (consumed via the fork pin) open; diverged from the pin
Clean Verified-zkEVM/clean#450 AgreesBelow constrains data/hints (staged in ToClean) approved, open
Clean Verified-zkEVM/clean#453 witness-IR sharing pass closed unmerged; replaced by Witgen.M
lean-sail rems-project/lean-sail#14 open PreSail disambiguation open (one-line fork pin)
sail-riscv per-arch formal-config override, plus its split-out DEPENDS half riscv/sail-riscv#1861 open; riscv/sail-riscv#1885 merged
Lean leanprover/lean4#13858 (legacy-do workaround for RvfiDii) worked around (proposed fix leanprover/lean4#13985, open)
SP1 RegisterAccessCols lacks #[repr(C)] (external-report F6) identified, not yet filed
Chronological changelog (P1–P15)

1,148 of the 1,155 non-merge commits fall in P1–P15; the other 7 are pre-squash #104 history already in the base. ± counts hand-written lines only, measured between first-parent boundary commits.

The stacked upstream PRs #106–#110, #114–#117 and #119–#122 were superseded by this branch. Each head is an exact commit on it (#106 = 6c399dbd, #107 = c3c5cd4f, #115 = 73344965, #122 = a1efce55). #111–#113 merged into stack branches, not into main.

P1 · Jun 26–Jul 12 · #106 · 123 commits · +25.0k/−4.8k.

  • Re-based on Clean main; Byte/Range and Program-ROM providers; Memory polarity flip.
  • sp1Ensemble replaced the GatedVm data layer. A Clean VmTables migration was tried here and abandoned in P2.
  • Semantic channels; all readers became GeneralFormalCircuits.
  • try_step reduction (fetch, minstret, SailConfigured).
  • Per-chip ChipKind.advance for 25/25 chips; decode rework with image-guarded ROM decode.
  • The sailEquiv/reaches_sail path was removed.
  • Lean 4.30.

P2 · Jul 16–27 · #107 · 69 commits · +116.8k/−23.8k.

  • Lean 4.31.
  • Timed grounding engine (TimedGrounding, touch chains) and per-chip grounding contracts.
  • TypedProgram: 92 s → 4.5 s.
  • DivRem rebuilt on DivRemCompare/DivRemCore; all 25 chips sound and complete.
  • supported_core_native_sound, at that point over 36 tables.
  • Exact Faithful/CoreAIR.lean + CoreProfile; conditional *_of_obligations.
  • Whole-chip ChipFaithful 25/25 via generated ChipOracles.
  • Retired VmChannel, InstructionTrace and the per-op anchors.

P3 · Jul 27–Aug 2 · #108, #109 · 167 commits · +12.7k/−17.5k.

  • Proof-engineering waves: ChipContracts macros, 176 eval bridges replaced by one helper.
  • Hand-written maxHeartbeats → 0; check_option_escapes.sh allowlist.
  • No statement changed.

P4 · Aug 6–12 · #110–#113 · 13 commits · +6.4k/−2.0k.

P5 · Aug 12–19 · #114 (+11 commits of #115) · 66 commits · +17.1k/−3.3k (+268k generated).

  • All 25 chips on Clean's exportable witness IR, with an enforcement gate.
  • ToClean/ToMathlib created.
  • Wire format v1 + rust/witgen-interp.
  • SP1 pin → v6.4.0; committed SP1 dumps; native_decide anchors retired. The new gate caught the op_a divergence.
  • PMP-off became a Lean hypothesis.

P6 · Aug 20–23 · #115 · 55 commits · +32.7k/−2.6k.

  • External-report disposition; GatedVm/Eulerian interface deleted.
  • misa.M pinned, which fixed vacuity for M rows; decode witnesses 18/18.
  • StateBump/MemoryBump, GoodnessFilter, RefreshElimination, ensemble at 53 tables; memory-timestamp premise derived.
  • Table.build + per-chip completeness; supported_core_native_complete.
  • Prover-assumption fixes R1–R5.
  • Exact→native transport (now Composition/).

P7 · Aug 23–25 · #116, #117, #119 · 94 commits · +20.4k/−7.9k.

  • Provider closure Tiers 0–3; State/Memory ledger hand-offs.
  • Deterministic nativeTrace + functional completeness; *Consistency/ChipAir shadows retired.
  • Layering contract, and Composition/ as its own pillar.
  • NativeShardTraceTotal named as the single gap.
  • check_release_surface, check_current_docs.

P8 · Aug 28–31 · #120, #121 · 39 commits · +11.2k/−1.8k.

  • Plain-Sail headline (SailRetireChain; model-free supported_core_native_sound); boundary regrouped; Memory boundary populated; AIR.lean cut from 1,202 to ~300 lines.
  • HaltChip + Exit channel, OrdinaryRun ∨ HaltedRun; CommittedProgTruth.
  • supported_core_boot_to_halt_single_shard.
  • closingKeys fix.

P9 · Sep 1–8 · #122 · 121 commits · +13.4k/−0.8k.

  • SyscallInstrsChip: 13 arms, sound and complete; syscallInstrsChip_faithful.
  • Syscall/PublicValues channels, giving 55 tables / 7 channels.
  • Event-indexed walk generalized beyond 8 ticks.
  • Interim SyscallTableInactive.

P10 · Sep 8–19 · dtumad#1 · 192 commits · +61.6k/−3.7k.

  • Full-state model in Model/Core/: state/step/path/snapshot, eight-call host, paired replay.
  • Checked boot, sparse memory, native ROM decode against Sail.
  • Host RAM, commitment banks, persistent hint queues.
  • ROM write permissions.
  • HostHintReadCPU.source_execution_with_memory.
  • Shard.statement_iff target.
  • Branch review; CI moved to ubuntu-latest.

P11 · Sep 19–22 · dtumad#2–60 · 63 commits · +15.9k/−4.3k (+174k vendored Sail).

P12 · Sep 22–27 · dtumad#61–99 · 36 commits · +15.9k/−7.8k (−101k census).

P13 · Sep 27–29 · dtumad#100–110 · 16 commits · +6.8k/−0.2k.

P14 · Sep 29–Oct 1 · dtumad#114–128 · 17 commits · +14.9k/−15.5k.

P15 · Sep 30–Oct 15 · dtumad#129–150 · 77 commits · +35.5k/−32.1k.

Smaller changes

Correctness fixes:

Performance:

CI and tooling:

Docs:

Additions in To* libraries:

  • ToClean:
    • witness generation: WitgenBridge, WitnessGenerationData, AgreesBelowWithData, StructEvalLemmas, IteDecide, GetElemFastPath;
    • building and checking ensembles: TableBuild, EnsembleBuild, CompleteEnsemble, Realizes, EnsembleCheck, FiniteLookup;
    • verifier and accounting: PublicVerifier, Footprint, TableSlot, Receipt;
    • columns and providers: ProvableOptional, StaticTable/StaticProvider, BitwiseByte.
  • ToMathlib: BitVec, ListChronology, ListFilterMap, ListMapMOption, ExtDHashMapOfFintype.
  • ToPolyFun: Labeled, Orbit.

Removals:

Open fork trackers relevant to review:

🤖 Generated with Claude Code

@dtumad dtumad changed the title chore: sync fork feat: tracking fork development Sep 20, 2026
dtumad added 29 commits October 1, 2026 16:50
Use the actual verifier and physical tables for channel views. Separate generation inputs from evaluation data, share the generic ledger filter law in ToClean, and remove the unused five-channel footprint compatibility record.

Strict affected build (2706 jobs), 12 lint roots, selected production/test trust scopes, and repository guards pass. Full adoption remains incomplete at eight migration roots; higher completeness consumers and fresh legacy export regeneration are not yet validated.
Read Clean revision from lake-manifest.json and regenerate the backend manifest. All 44 other generated files remain byte-identical.

Strict driver build, deterministic fresh regeneration, 29 witnesses and 26 malformed mutations pass through the R1CS backend checks. Existing Rust interpreter tests (30) and all 857 migration fixture rows also pass; this does not validate the unfinished built-in ensemble export.
Decode Halt and StateBump rows at witness data and use the complete interaction ledger directly, removing the obsolete synthetic all-tables witness. Condense stale table-count documentation and distinguish assembly guarantees from arbitrary execution compilation.

Strict affected build (2415 jobs), lint, guards and selected production/test trust scopes pass with no new exceptions. The strict full adoption scan now fails at seven remaining migration roots.
Transport fixed target lookups, Byte guarantees and exact receipt ledgers across the five-table view. Preserve final-record agreement with the existing grounding projection and supply concrete unique-name evidence.

Evaluate the full physical regression through the canonical Clean ledger, share fixture work across rows, and separate finite lookup checking from the legacy exporter.

Selected strict builds, production lint, both compiled trust scopes, backend comparisons and Rust migration checks pass. This remains an unpublished adoption checkpoint: the full build and fresh exports still have known migration blockers.
dtumad and others added 30 commits November 18, 2026 07:49
`docs/audits/2026-11-build-performance.md` records the method (solo sweep
by instructions retired, proof-closure verdicts, CI job data), where the
time goes (1,185 modules, 48.6 T instructions: 70 % on the headline
closure, 15 % tests, 7 % generated model, 8 % off-path production
modules), the top 40 modules, the fixes landed in #197–#201 with their
measured effects, the mechanisms behind them, the open clusters and the
upstream candidates under review. `docs/agents/build-profiling.md` points
at the inventory and the generated-C check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`Installed`, `installed`, `SailTrace`, `Endpoint` and `sail_trace` take
the supplied target `ExecutionSnapshot` instead of an outgoing memory
snapshot and a final host bank: the target fixes both
(`target.sail.memorySnapshot`, `target.host`). The statement is equally
general, since every memory/bank pair is a target's projection, and the
target's registers are what the ordinary observation mode and endpoints
need. The trace's final state is now named `actual` throughout, as in
`Endpoint.realize_eq`, which becomes `Endpoint source target final …`.

The alignment fixtures carry the complete target snapshot
(`Context.target : ExecutionSnapshot`); the separate `finalHost` field
is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Installed, installed, SailTrace, Endpoint and sail_trace take the target
snapshot; 13,947 dependencies (registration theorems now appear as
Installed's auxiliary proofs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`Soundness/OrdinaryObservationResources` defines the two physical tables
that join the host inventory: the ordered receipt consumer and its
terminal at a static mode. The consumer's rows are demanded by receipts
and indexed by the receipt's clock; its guard checks the complete
receipt, so a misrouted private row cannot answer another receipt.
Names and channels are stated once for every retirement flag and mode
(`consumer_name`, `terminal_name`, `consumer_channels`,
`terminal_channels`), since both are static data of the supplied
snapshots.

The consumer circuit gets its table name, "sp1.native.ordinary_observation"
(it was anonymous), and `circuit_channels_subset`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rminal per mode

The observation consumer and terminal took static data (the source's
retirement flag and the target's mode), so installing them in the exact
host resource list would have required generalizing the host-grounding
chain first. They now take none:

- `State` gains `enabled`, set by the verifier's start link
  (`flagFor source`) and carried unchanged by every consumer row, which
  checks it with Clean's `assertBool`. `Spec` advances the counter by
  `BitVec.ofNat 64 previous.enabled.val`; `ordered_history` proves the
  flag is preserved and `final = initial + length * flag`, and
  `retirement_fold` takes the semantic flag with the hypothesis that the
  chain's flag denotes it.
- `Mode.sentinel` gives each mode a distinct sentinel clock at or above
  2^48; the three terminals are separate tables (`terminalName mode`) that
  push `final mode …`, and `finalFor source target` closes at the sentinel
  of `Mode.of source target`, so a wrong mode's push cannot balance.
- `OrdinaryObservationResources` is the four parameter-free tables.
- The tests keep both flag values and reject a non-Boolean flag and a
  final link whose flag differs from the chain's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The registered observation channel's State gains its retirement flag: nine
State/ProvableStruct declarations change; 13,947 dependencies (reviewed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…inventory

The four parameter-free observation tables (the consumer and one terminal
per mode) join `HostHintReadLocal.sourceResources`, now
`bankResources hints ++ OrdinaryObservation.tables`, so the host-grounding
chain keeps its statement:

- `source_interface` composes the bank proof with
  `ExtensionInterface.appendResources`; the tables' facts come from
  `tables_channels`/`tables_silent`, and Byte through
  `AuxiliaryInterface.of_channels` (the consumer requests Byte checks but
  owes requirements only on its receipt and observation links).
- Record authentication, queue silence and the registry's declaration rows
  gain the four tables; `HostFinalMemory.observation_lookupFree` proves the
  block lookup-free once.
- The host block grows 31 → 35 tables and the installed assembly 95 → 99;
  positions after the bank terminals shift by four (checks 94–97,
  commitment declaration 98) in the fixtures, the example expectations,
  `coverage.json` (the four native entries, from releaseInventory) and the
  Rust comparison tests.

With no producers or endpoint yet, an accepted witness leaves the tables
empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The host inventory reaches the four observation tables: 98 dependencies
added, sourceResources changed; 14,045 (reviewed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The exporter's HINT_READ mutations and the shared Rust assembly support
addressed the register and RAM target checks, the provider-count probes
and the commitment declaration by position. With the four observation
tables installed those move by four (checks 94–97, declaration 98), and
the assembly has 99 components. Fresh dual export, determinism check and
all Rust fixture groups (default and mprotect) pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(soundness): integrate target-indexed ordinary observation tables
feat(capstone): bind six-call execution to the installed SP1 assembly
feat(capstone): construct the private hint endpoint in the installed assembly
feat(capstone): prove observation completeness for the SP1 shard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant