Expand description
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 theRerunSinkand its background thread. Without this flag the crate compiles with zero Rerun dependency.
§Architecture
- stwo-ml installs a
ProofSinkviaset_proof_sink()(thread-local, RAII). - The prover calls
emit_proof_event!(|| ...)at hot points; the closure is never evaluated when no sink is active. - Active sinks (e.g.
RerunSink) forward events through a bounded crossbeam channel (8 192 slots,try_send— never blocks). - A background thread drains the channel and calls the Rerun SDK.
Re-exports§
pub use events::ActivationStats;pub use events::CircuitNodeMeta;pub use events::GpuSnapshot;pub use events::LayerKind;pub use events::LayerProofKind;pub use events::LogLevel;pub use events::ProofEvent;pub use events::RoundPolyDeg3Viz;pub use events::RoundPolyViz;pub use events::SecureFieldMirror;pub use sink::ChannelSink;pub use sink::CollectingSink;pub use sink::NullSink;pub use sink::ProofEventSink;pub use sink::ProofSink;
Modules§
- blueprint
- Blueprint sender for the proof-stream visualization.
- events
ProofEvent— the central event type streamed from stwo-ml proving sessions.- rerun_
sink RerunSink— streams proof events to a Rerun viewer via a background thread.- sink
ProofEventSinktrait +ProofSinkwrapper.- viz
- Visualization helper sub-modules.