()
| 1969 | (Some(dir), false) => { |
| 1970 | let mut set = std::collections::HashSet::default(); |
| 1971 | // No vk filter: this pre-flight runs before any client/ROM setup |
| 1972 | // exists. Stale entries admitted here only relax a CHECK (closure); |
| 1973 | // the fold path re-loads the store with the vk filter on. |
| 1974 | for p in load_proof_index(dir, None) { |
| 1975 | set.extend(p.subjects.iter().map(|a| *a.as_bytes())); |
| 1976 | } |
| 1977 | set |
| 1978 | }, |
| 1979 | _ => std::collections::HashSet::default(), |
| 1980 | }; |
| 1981 | check_inputs_closed(&inputs, &covered)?; |
| 1982 | } |
| 1983 | |
| 1984 | if args.plan { |
| 1985 | return Ok(()); |
| 1986 | } |
| 1987 | |
| 1988 | // Grand totals across the whole batch. |
| 1989 | let grand_total_items: u32 = plans.iter().map(|p| p.total).sum(); |
| 1990 | let grand_target_count: usize = plans.iter().map(|p| p.target_count).sum(); |
| 1991 | let total_leaves: usize = plans.iter().map(|p| p.shards.len()).sum(); |
| 1992 | |
| 1993 | let client = build_client(args.gpu, !args.emulator)?; |
| 1994 | // Dump mode never runs the VM; it needs ROM setup (and thus the proving |
| 1995 | // key) only to derive the shard vk for store filtering. Skipping setup |
| 1996 | // otherwise makes input dumping fast and key-free. |
| 1997 | if args.dump_input.is_none() || args.store_dir.is_some() { |
| 1998 | client.setup(&SHARD_PROGRAM).run()?.await?; |
| 1999 | } |
| 2000 | // Skip agg-guest setup unless we'll produce more than one leaf proof. |
| 2001 | // The shard-plan path sets up the agg program itself, after its leaves. |
| 2002 | // |
| 2003 | // Under the Assembly executor (the default) this upfront agg setup is |
| 2004 | // *harmful*: it re-initializes the ASM microservices and clobbers SHARD's |
| 2005 | // ROM histogram, so the subsequent leaf proves panic in `rom.rs`. We defer |
| 2006 | // the agg setup to after the leaf loop (see the agg-fold below). Only the |
| 2007 | // Emulator (`--emulator`) keeps the upfront setup — it has no microservice |
| 2008 | // state to clobber. |
| 2009 | let need_agg = !args.execute |
| 2010 | && !args.verify_constraints |
| 2011 | && args.shard_plan.is_none() |
| 2012 | && total_leaves > 1; |
| 2013 | if need_agg && args.emulator { |
| 2014 | client.setup(&AGG_PROGRAM).run()?.await?; |
| 2015 | } |
| 2016 | |
| 2017 | // ---- Manifest-driven sharding (the offline profiler/partitioner plan). ---- |
| 2018 | // Prove the `.ixes` partition: one closure-injected leaf per manifest shard, |
| 2019 | // folded into one aggregate. Sets up the agg program itself (lazily, only |
| 2020 | // when >1 shard). Returns when done — does not fall through to the |
| 2021 | // range-based execute/leaf paths below. |
| 2022 | if let Some(manifest_path) = &args.shard_plan { |
| 2023 | run_shard_plan(&client, &plans[0], manifest_path, &args).await?; |
| 2024 | return Ok(()); |
| 2025 | } |
| 2026 | |
| 2027 | // ---- Named constants (no manifest/range). Loops one leaf per name. ---- |
nothing calls this directly
no test coverage detected