lssa/tools/cycle_bench
Moudy 28db42315b chore(cycle_bench): tighten lint discipline (allow → expect, fix issues in code)
- Switch crate-level #![allow] to #![expect] in main.rs and prune
  17 entries the compiler reports as unfulfilled or workspace-allowed.
- Fix the underlying issues rather than allow: source ordering
  (mods/uses regrouped), doc_markdown (identifiers backticked),
  redundant_type_annotations, map_unwrap_or, unnecessary_wraps.
- Extract feature-gated mod ppe_impl into its own file
  tools/cycle_bench/src/ppe/ppe_impl.rs so the mod declaration can
  precede the public structs per arbitrary_source_item_ordering.

Net: 35 → 12 expects in main.rs, all load-bearing.
2026-05-18 15:49:24 +02:00
..
2026-05-15 00:24:56 +02:00

cycle_bench

Per-program Risc0 cycle counts, prover wall time, PPE composition cost, and verifier wall time for the built-in LEZ programs. Feeds the fee model (G_executor, G_prove, G_verify, S_agg).

Run

# Executor cycles only (fast, ~seconds)
cargo run --release -p cycle_bench

# + real proving per program (slow, ~minutes)
cargo run --release -p cycle_bench --features prove -- --prove

# + PPE composition cases (very slow, ~hour)
cargo run --release -p cycle_bench --features ppe -- --prove --ppe

# + verifier microbench (G_verify): generates one PPE receipt, times verify x1000
cargo run --release -p cycle_bench --features ppe -- --verify --verify-iters 1000

RISC0_DEV_MODE=1 skips proving entirely and is only useful for the executor path. Combine flags freely; output is printed to stdout and written to target/cycle_bench.json for regression diffs.

What you'll see

  • Per-program executor cycles and segments, plus exec wall time as best / mean ± stdev (n=N).
  • With --prove: prover total cycles, paging cycles, segments, and wall time.
  • With --ppe: end-to-end execute_and_prove wall time and S_agg (the borsh-serialized InnerReceipt length) for one auth-transfer-in-PPE case and a chain-caller depth sweep.
  • With --verify: verify wall time best / mean ± stdev, plus proof_bytes and journal_bytes.