proof-stream 0.1.0

Real-time 3D streaming visualization of ZK proof sessions via Rerun
Documentation

proof-stream — real-time 3D streaming visualization of stwo-ml ZK proof sessions.

Overview

This crate intercepts events emitted during stwo-ml proving (GKR walk, sumcheck rounds, GPU utilization, layer activations) and streams them to a Rerun viewer in real time via a background thread.

Quick start

# With the `rerun` feature enabled:
cargo run --bin prove-model --features proof-stream-rerun -- \
  --model-dir ./tiny-model --rerun spawn

Feature flags

  • rerun — enables the RerunSink and its background thread. Without this flag the crate compiles with zero Rerun dependency.

Architecture

  1. stwo-ml installs a ProofSink via set_proof_sink() (thread-local, RAII).
  2. The prover calls emit_proof_event!(|| ...) at hot points; the closure is never evaluated when no sink is active.
  3. Active sinks (e.g. RerunSink) forward events through a bounded crossbeam channel (8 192 slots, try_send — never blocks).
  4. A background thread drains the channel and calls the Rerun SDK.