//! Plan a chain of wrap levels by shape alone (no key words committed, no
//! proof): every level's circuit rows, size, census and weakest ledger
//! row (the final level's bytes: `wrap_plan`).
//!
//! `wrap_chain <spec>โ€ฆ`, each spec as `wrap_bench`'s `ZHENG_WRAP`
//! (`<log inv rate><i|f>[:<pow>[:<fold>]]`, innermost first). IVC
//! parameters as `wrap_bench` (`ZHENG_RATE`, `ZHENG_POW`, `ZHENG_STEP`).

use std::time::Instant;
use zheng::recursion::ivc;
use zheng::recursion::wrap::{self, Mode, WrapParams};

fn env<T: std::str::FromStr>(k: &str, d: T) -> T {
    std::env::var(k)
        .ok()
        .and_then(|v| v.parse().ok())
        .unwrap_or(d)
}

fn main() {
    let mut whir = zheng::execution::succinct::params_for(20);
    whir.log_inv_rate = env("ZHENG_RATE", ivc::SHIPPED_RATE);
    whir.pow_bits = env("ZHENG_POW", ivc::SHIPPED_POW);
    let n: usize = env("ZHENG_STEP", 15);
    let ikey = ivc::key(&whir, n).expect("ivc key");
    for spec in std::env::args().skip(1) {
        let t = Instant::now();
        let mut keys: Vec<wrap::WrapKey> = Vec::new();
        let mut line = Vec::new();
        for l in spec.split(',') {
            let mut parts = l.split(':');
            let head = parts.next().expect("level");
            let (rate, mode) = head.split_at(head.len() - 1);
            let mut w = whir;
            w.pow_bits = 24;
            w.log_inv_rate = rate.parse().expect("rate");
            if let Some(p) = parts.next() {
                w.pow_bits = p.parse().expect("pow");
            }
            if let Some(k) = parts.next() {
                w.folding_factor = k.parse().expect("fold");
            }
            let params = WrapParams {
                whir: w,
                n: 0,
                mode: if mode == "f" {
                    Mode::Final
                } else {
                    Mode::Inner
                },
            };
            let k = match keys.last() {
                None => wrap::derive_shape_ivc(params, &ikey),
                Some(prev) => wrap::derive_shape(params, prev),
            };
            let k = match k {
                Ok(k) => k,
                Err(e) => {
                    line.push(format!("{l}: {e}"));
                    break;
                }
            };
            let reads = k.wiring.as_ref().map_or(0, |w| w.reads);
            let rows = wrap::ledger(&k.params, &k.cfg, k.constraints, reads);
            let weak = rows.iter().map(|r| r.1).fold(f64::INFINITY, f64::min);
            let q: Vec<usize> = k.cfg.wc.rounds.iter().map(|r| r.queries).collect();
            let ext_cols: Vec<usize> = k
                .pre
                .cols
                .iter()
                .enumerate()
                .filter(|(_, c)| {
                    c.iter()
                        .any(|v| v.c1 != nebu::Goldilocks::ZERO || v.c2 != nebu::Goldilocks::ZERO)
                })
                .map(|(i, _)| i)
                .collect();
            line.push(format!("{l}: {} rows (perm blocks {}) โ†’ 2^{} ยท q {q:?} ยท {weak:.2} bits ยท key columns with Fp3 entries {ext_cols:?}", k.rows, k.census[2], k.params.n));
            if !k.inner() {
                line.push(format!(
                    "final proof โ‰ค {} B over every transcript",
                    wrap::FinalProof::max_bytes(&k)
                ));
            }
            keys.push(k);
        }
        println!(
            "{spec} ({:.1} s)\n  {}",
            t.elapsed().as_secs_f64(),
            line.join("\n  ")
        );
    }
}

Homonyms

cyber/src/main.rs
cyb/cli/src/main.rs
soft3/nox/cli/main.rs
neural/trident/src/main.rs
cyb/optica/src/main.rs
soft3/glia/import/main.rs
cyberia/cyberia-my/src/main.rs
cyb/apps/src/main.rs
soft3/tru/cli/main.rs
neural/rune/cli/main.rs
warriors/trisha/cli/main.rs
warriors/joy/cli/main.rs
cyb/shell/src/main.rs
soft3/conformance/rs/src/main.rs
neural/eidos/cli/src/main.rs
soft3/radio/iroh-dns-server/src/main.rs
soft3/radio/iroh-relay/src/main.rs
soft3/radio/particle/src/main.rs
soft3/strata/cli/src/main.rs
soft3/zheng/cli/src/main.rs
neural/rs/pure-rust-check/src/main.rs
soft3/hemera/cli/src/main.rs
soft3/neuron/cli/src/main.rs
soft3/glia/run/cli/main.rs
neural/rs/link/src/main.rs
soft3/radio/radio-cli/src/main.rs
soft3/foculus/src/bin/main.rs
neural/rs/macho-linker/src/main.rs
soft3/bbg/cli/src/main.rs
neural/rs/rsc/src/main.rs
neural/rs/cli/src/main.rs
soft3/lens/cli/src/main.rs
soft3/cybergraph/cli/src/main.rs
warriors/erga/cli/src/main.rs
soft3/zheng/rs/examples/ivc_bench/main.rs
soft3/zheng/rs/examples/wrap_plan/main.rs
cyb/honeycrisp/acpu/src/probe/main.rs
soft3/strata/jali/cli/src/main.rs
soft3/zheng/rs/examples/wrap_keys/main.rs
soft3/mudra/audit/quantus-mldsa-crosscheck/src/main.rs
soft3/zheng/rs/examples/envelope_profiles/main.rs
soft3/zheng/specs/proto/zheng_spartan/main.rs
warriors/erga/rs/rtable-bench/src/main.rs
soft3/strata/kuro/cli/src/main.rs
soft3/strata/trop/cli/src/main.rs
soft3/zheng/rs/examples/wrap_flip/main.rs
soft3/zheng/rs/examples/wrap_bench/main.rs
warriors/trisha/tools/neptune-policy-oracle/src/main.rs
soft3/zheng/specs/proto/zheng_bug/main.rs
soft3/zheng/specs/proto/zheng_inner/main.rs
soft3/zheng/rs/examples/fast_path/main.rs
soft3/zheng/specs/proto/zheng_spartan_fixed/main.rs
warriors/erga/rs/mine-bench/src/main.rs
soft3/zheng/rs/examples/wrapped_sizes/main.rs
soft3/zheng/rs/examples/wrap_verify/main.rs
soft3/zheng/rs/examples/ivc_plan/main.rs
soft3/zheng/rs/examples/ivc_flip/main.rs
soft3/zheng/rs/examples/machine_bench/main.rs
soft3/zheng/rs/examples/succinct_bakeoff/main.rs
soft3/zheng/specs/proto/zheng_outer/main.rs
neural/inf/rs/cli/src/main.rs
cyb/wysm/crates/cli/src/main.rs
warriors/erga/rs/blake-bench/src/main.rs
soft3/strata/nebu/cli/src/main.rs
soft3/lytics/rs/agent/src/main.rs
cyb/honeycrisp/rane/src/probe/main.rs
neural/trident/silicon/src/bin/main.rs
soft3/strata/genies/cli/src/main.rs
soft3/lytics/rs/ingest/src/main.rs
soft3/radio/audit/2026-10-12-bao-bounded-proof/nostd/src/main.rs
soft3/radio/audit/2026-10-12-bao-proof-research/probe/src/main.rs
soft3/mudra/audit/signature-optimality/xnt-predicate-check/src/main.rs
cyb/honeycrisp/unimem/experiments/hyp_probe/src/main.rs
soft3/radio/audit/2026-10-12-bao-bounded-proof/fixture-probe/src/main.rs
soft3/radio/audit/2026-10-12-bao-bounded-proof/nostd-parent/src/main.rs
soft3/radio/audit/2026-10-12-bao-proof-research/primary-probe/src/main.rs
cyb/honeycrisp/unimem/experiments/iosurface_probe/src/main.rs
cyb/honeycrisp/unimem/experiments/dext_contiguous_alloc/client/src/main.rs
cyb/honeycrisp/unimem/experiments/dext_iosurface_pa/client/src/main.rs

Graph