diff --git a/Makefile b/Makefile index 90fe669..08d2ae8 100644 --- a/Makefile +++ b/Makefile @@ -58,20 +58,33 @@ clean-circuits: ########################### BENCHMARKING ############################################################################### ######################################################################################################################## -RUN_ARTIFACTS := $(foreach trans,$(TRANSFORMATIONS), runs/nova_snark/$(trans).out) +RUN_NS_ARTIFACTS := $(foreach trans,$(TRANSFORMATIONS), runs/nova_snark/$(trans).out) +RUN_SN_ARTIFACTS := $(foreach trans,$(TRANSFORMATIONS), runs/sonobe/$(trans).out) NS_REPORT_FILE = runs/nova_snark_report.txt +SN_REPORT_FILE = runs/sonobe_report.txt .PHONY: run-nova-snark-benchmarks -run-nova-snark-benchmarks: generate-input-data build-circuits $(RUN_ARTIFACTS) - @echo "Nova Snark Folding Times Report" > $(NS_REPORT_FILE) - @echo "-------------------------------" >> $(NS_REPORT_FILE) - @for log in $(RUN_ARTIFACTS); do \ - func=$$(grep -m1 "Selected function:" $$log | sed -E 's/.*Selected function: (.*)/\1/'); \ - fold_time=$$(grep "Fold input" $$log | awk '{print $$NF}'); \ - echo "$$func: $$fold_time" >> $(NS_REPORT_FILE); \ - done - @echo "Report saved to $(NS_REPORT_FILE)" +run-nova-snark-benchmarks: generate-input-data build-circuits $(RUN_NS_ARTIFACTS) + @$(call generate-report,$(RUN_NS_ARTIFACTS),$(NS_REPORT_FILE)) runs/nova_snark/%.out: @mkdir -p runs/nova_snark @cd vimz/ && $(MAKE) $* BACKEND=nova-snark DEMO=yes > ../$@ + +.PHONY: run-sonobe-benchmarks +run-sonobe-benchmarks: generate-input-data build-circuits $(RUN_SN_ARTIFACTS) + @$(call generate-report,$(RUN_SN_ARTIFACTS),$(SN_REPORT_FILE)) + +runs/sonobe/%.out: + @mkdir -p runs/sonobe + @cd vimz/ && $(MAKE) $* BACKEND=sonobe DEMO=yes LIGHT_TEST=yes > ../$@ + +define generate-report + > $2 + for log in $1; do \ + func=$$(grep -m1 "Selected function:" $$log | sed -E 's/.*Selected function: (.*)/\1/'); \ + fold_time=$$(grep "Fold input" $$log | grep -v "completed" | awk '{print $$NF}' | tail -n1); \ + echo "$$func: $$fold_time" >> $2; \ + done + echo "Report saved to $2" +endef diff --git a/circuits/sonobe/hash_step.circom b/circuits/sonobe/hash_step.circom index 4358bc6..515028a 100644 --- a/circuits/sonobe/hash_step.circom +++ b/circuits/sonobe/hash_step.circom @@ -13,4 +13,4 @@ template SonobeHash(width){ ivc_output <== HeadTailHasher(width)(ivc_input, external_inputs); } -component main { public [ivc_input] } = SonobeHash(768); +component main { public [ivc_input] } = SonobeHash(128); diff --git a/circuits/sonobe/hash_step.compile_log b/circuits/sonobe/hash_step.compile_log index 6566e20..9cc26b7 100644 --- a/circuits/sonobe/hash_step.compile_log +++ b/circuits/sonobe/hash_step.compile_log @@ -1,11 +1,11 @@ -template instances: 228 -non-linear constraints: 44595 +template instances: 154 +non-linear constraints: 7716 linear constraints: 0 public inputs: 1 -private inputs: 768 +private inputs: 128 public outputs: 1 -wires: 45365 -labels: 220186 +wires: 7846 +labels: 37463 Written successfully: ./hash_step.r1cs Written successfully: ./hash_step_js/hash_step.wasm Everything went okay