Skip to content

feat: Add SP1 and Zisk kernel proving backends#411

Draft
samuelburnham wants to merge 5 commits into
mainfrom
kernel-riscv
Draft

feat: Add SP1 and Zisk kernel proving backends#411
samuelburnham wants to merge 5 commits into
mainfrom
kernel-riscv

Conversation

@samuelburnham

@samuelburnham samuelburnham commented May 15, 2026

Copy link
Copy Markdown
Member

This pull request adds RISC-V zkVM proving backends for the Rust kernel — Zisk as the primary target (single process, single GPU), SP1 as an experimental alternative — together with the host pipeline that makes whole-environment Ix proving practical: RAM-aware sharding, tree aggregation with in-circuit assumption discharge, and cross-run proof reuse. Guest runs are validated by the shard's committed failures publics word; cycle counts are deterministic ziskemu step counts.

Key Results

  • Whole-environment proving works end to end on a single GPU: profile → shard plan (.ixes manifest) → leaf proofs → tree-aligned aggregation to a single proof with no dangling assumptions
  • Shard count is auto-sized from machine RAM and profiled heartbeats — no manual budget tuning
  • Cross-run reuse: store-aware planning re-proves only novel shards; a shard whose certified targets are already covered by stored proofs is skipped entirely
  • Guest checks an explicit check-list against a closure-injected sub-env (never the whole env); 112-byte shard publics bind the env hash, range/count, failures word, and assumption roots
  • ByteArray.utf8DecodeChar?_utf8EncodeChar_append — the most expensive proof in Init — provable via the NatSuccMode::Stuck cache
  • Init is provable in principle in 288 shards on a 256GB RAM machine, ~0.35 constants per second out of ~52k total constants = ~37-45 hours on a single GPU.

Convert the crate to a Cargo workspace with subcrates and add the SP1
and Zisk kernel proving backends.

Make aiur::vk_codec::aiur_system_to_bytes public so the FFI layer
(crates/ffi/src/aiur/protocol.rs) can serialize the verifying key.
Port the kernel-sharding profiler and partitioner into the workspace and
build the proving pipeline on top of it:

- manifest-driven sharding for the Zisk host (drops --topo/stats scaffolding)
- budget-driven shard count from a per-shard cycle cap, recalibrated
  cycles-per-heartbeat (208k->215k), and auto-sizing from machine RAM
- emit the bisection tree and carry it in the .ixes manifest
- tree-aligned aggregation with in-circuit assumption discharge
- cross-run proof reuse on the shard-plan path (drops the legacy reuse path)
- store-aware planning: partition only novel work, resolve the rest by reuse
- add NatSuccMode::Stuck cache to prove
  ByteArray.utf8DecodeChar?_utf8EncodeChar_append
- cargo fmt and clippy fixes in the shard examples
- publish the blake3 precompile fork, fix the SP1 guest build, and
  document proving
- add CI
- vk_codec: drop the always-Ok `Result` wrapper from `to_bytes`
  (clippy `unnecessary_wraps`); callers updated.
- README: document the Zisk shard-proving path — profile → shard →
  prove via `--shard-plan`, and the resumable proof store
  (`--store-dir`/`--no-reuse`/`--require-closed`).
- ci: scope the riscv-zkvm-execute job to `--only-const myReflEq` so
  it certifies one constant (Init deps become Claim assumptions)
  instead of typechecking all of Init, which never finished.
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