mirror of
https://github.com/arnaucube/sonobe-playground.git
synced 2026-01-14 01:51:29 +01:00
Insights into input trans
This commit is contained in:
21
analysis.py
21
analysis.py
@@ -46,12 +46,15 @@ def process_logline(log):
|
|||||||
"Prepare folding": 0,
|
"Prepare folding": 0,
|
||||||
"Transform input": 0,
|
"Transform input": 0,
|
||||||
"Folding verification": 0,
|
"Folding verification": 0,
|
||||||
"Folding steps": []
|
"Proving": [],
|
||||||
|
"Input prep": [],
|
||||||
}
|
}
|
||||||
|
|
||||||
span_name = span.get("name")
|
span_name = span.get("name")
|
||||||
if span_name == "Folding step":
|
if span_name == "Proving":
|
||||||
scenarios[scenario_name]["Folding steps"].append(time_seconds)
|
scenarios[scenario_name]["Proving"].append(time_seconds)
|
||||||
|
elif span_name == "Input prep":
|
||||||
|
scenarios[scenario_name]["Input prep"].append(time_seconds)
|
||||||
else:
|
else:
|
||||||
scenarios[scenario_name][span_name] = time_seconds
|
scenarios[scenario_name][span_name] = time_seconds
|
||||||
|
|
||||||
@@ -74,11 +77,15 @@ def print_results():
|
|||||||
print(report(" Transform input", data["Transform input"]))
|
print(report(" Transform input", data["Transform input"]))
|
||||||
print(report(" Folding verification", data["Folding verification"]))
|
print(report(" Folding verification", data["Folding verification"]))
|
||||||
|
|
||||||
folding_steps = data["Folding steps"]
|
|
||||||
print(f" Folding Steps:")
|
print(f" Folding Steps:")
|
||||||
print(report(" Average", sum(folding_steps) / len(folding_steps)))
|
input_trans = data["Input prep"]
|
||||||
print(report(" Min", min(folding_steps)))
|
print(report(" Input prep: Average", sum(input_trans) / len(input_trans)))
|
||||||
print(report(" Max", max(folding_steps)))
|
print(report(" Input prep: Min", min(input_trans)))
|
||||||
|
print(report(" Input prep: Max", max(input_trans)))
|
||||||
|
proving_steps = data["Proving"]
|
||||||
|
print(report(" Proving: Average", sum(proving_steps) / len(proving_steps)))
|
||||||
|
print(report(" Proving: Min", min(proving_steps)))
|
||||||
|
print(report(" Proving: Max", max(proving_steps)))
|
||||||
|
|
||||||
|
|
||||||
process_logs('out.log')
|
process_logs('out.log')
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use sonobe::{
|
|||||||
transcript::poseidon::poseidon_canonical_config,
|
transcript::poseidon::poseidon_canonical_config,
|
||||||
Error, FoldingScheme, MultiFolding,
|
Error, FoldingScheme, MultiFolding,
|
||||||
};
|
};
|
||||||
|
use tracing::info_span;
|
||||||
|
|
||||||
pub type NovaFolding =
|
pub type NovaFolding =
|
||||||
Nova<G1, GVar, G2, GVar2, CircomFCircuit<Fr>, KZG<'static, Bn254>, Pedersen<G2>, false>;
|
Nova<G1, GVar, G2, GVar2, CircomFCircuit<Fr>, KZG<'static, Bn254>, Pedersen<G2>, false>;
|
||||||
@@ -55,8 +56,12 @@ pub trait FoldingSchemeExt: FoldingScheme<G1, G2, CircomFCircuit<Fr>> {
|
|||||||
initial_state: Vec<Fr>,
|
initial_state: Vec<Fr>,
|
||||||
rng: &mut impl rand::RngCore,
|
rng: &mut impl rand::RngCore,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let step_input = self.transform_multi_input(multi_input, initial_state, rng);
|
let step_input = info_span!("Input prep")
|
||||||
self.prove_step(rng, step_input.external_inputs, step_input.other_instances)
|
.in_scope(|| self.transform_multi_input(multi_input, initial_state, rng));
|
||||||
|
|
||||||
|
info_span!("Proving").in_scope(|| {
|
||||||
|
self.prove_step(rng, step_input.external_inputs, step_input.other_instances)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ pub struct ScenarioConfig {
|
|||||||
impl ScenarioConfig {
|
impl ScenarioConfig {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
num_inputs: 30,
|
num_inputs: 6,
|
||||||
start_ivc_state: vec![Fr::zero(); 2],
|
start_ivc_state: vec![Fr::zero(); 2],
|
||||||
circuit: info_span!("Prepare circuit").in_scope(create_circuit),
|
circuit: info_span!("Prepare circuit").in_scope(create_circuit),
|
||||||
input: info_span!("Prepare input").in_scope(prepare_input),
|
input: info_span!("Prepare input").in_scope(prepare_input),
|
||||||
|
|||||||
Reference in New Issue
Block a user