Skip to content

Commit 4c7a82d

Browse files
chore: changes moby/stairway (#564)
Ended up being a big refactor of the NIST KAT + bench pipeline for baseline platform.
1 parent 46d9d37 commit 4c7a82d

44 files changed

Lines changed: 2560 additions & 656 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ split-debuginfo = "unpacked"
255255
debug = "line-tables-only"
256256

257257
[profile.bench]
258-
debug = true
258+
debug = "line-tables-only"
259259

260260
# actual release profile
261261
[profile.release]

core/experiments/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ tfhe-zk-pok = { workspace = true, features = ["experimental"] }
7676
tonic-prost-build.workspace = true
7777

7878
[lib]
79-
crate-type = ["lib", "cdylib"]
79+
crate-type = ["lib"]
8080

8181
[[bin]]
8282
name = "gen-experiment"
@@ -223,6 +223,11 @@ path = "benches/non-threshold/tfhe-zk-pok/memory.rs"
223223
required-features = ["measure_memory"]
224224
harness = false
225225

226+
[[bench]]
227+
name = "non-threshold_tfhe-zk-pok_size"
228+
path = "benches/non-threshold/tfhe-zk-pok/size.rs"
229+
harness = false
230+
226231

227232

228233
[features]

core/experiments/Makefile.toml

Lines changed: 51 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -60,56 +60,43 @@ args = ["build", "-f", "${THRESHOLD_FHE_DOCKER_FILE}", "--build-arg", "FEATURES=
6060
command = "docker"
6161
args = ["build", "-f", "${THRESHOLD_FHE_DOCKER_FILE}", "--build-arg", "FEATURES=measure_memory,extension_degree_8", "-t", "tfhe-core-degree-8-mem", "${THRESHOLD_FHE_DOCKER_ROOT}"]
6262

63+
# Build all the images for TFHE parties with memory measurement feature
64+
[tasks.tfhe-docker-images-all-degrees-mem]
65+
run_task = { name = ["tfhe-docker-image-degree-3-mem", "tfhe-docker-image-degree-4-mem", "tfhe-docker-image-degree-5-mem", "tfhe-docker-image-degree-6-mem", "tfhe-docker-image-degree-7-mem", "tfhe-docker-image-degree-8-mem"]}
66+
6367
#Build the image for BGV parties (with centralized DKG available)
6468
[tasks.bgv-docker-image]
6569
command = "docker"
6670
args = ["build", "-f", "${THRESHOLD_FHE_DOCKER_FILE}", "--build-arg", "FEATURES=extension_degree_4", "-t", "bgv-core", "${THRESHOLD_FHE_DOCKER_ROOT}"]
6771

72+
[tasks.bgv-docker-image-mem]
73+
command = "docker"
74+
args = ["build", "-f", "${THRESHOLD_FHE_DOCKER_FILE}", "--build-arg", "FEATURES=measure_memory,extension_degree_4", "-t", "bgv-core-mem", "${THRESHOLD_FHE_DOCKER_ROOT}"]
75+
6876
# Generate the certificate for TLS communication of the parties
6977
# Note: templating feature isn't required, but allows to compile the code only once since gen-experiment requires the feature
7078
[tasks.gen-test-certs]
7179
command = "cargo"
7280
args = ["run", "--bin", "threshold-gen-tls-certs","--release","--features", "templating", "--", "--ca-prefix", "p", "--ca-count", "${NUM_PARTIES}", "-n", "1", "-o", "test_certs"]
7381

74-
#Generate the toml config file for the choreographer for a cluster of parties accessible from localhost
75-
[tasks.gen-local-choreo]
76-
command = "cargo"
77-
args = ["run", "--bin", "gen-experiment", "--release", "--features", "templating", "--", "-n", "${NUM_PARTIES}", "-t", "${THRESHOLD}", "-f", "temp", "-o", "local-cluster", "choreographer"]
78-
79-
#Generate the yml config file for the dockerized parties (tfhe)
80-
[tasks.tfhe-gen-local-cluster]
81-
command = "cargo"
82-
args = ["run", "--bin", "gen-experiment", "--release", "--features", "templating", "--", "-n", "${NUM_PARTIES}", "-o", "tfhe-local-cluster", "-f", "temp", "parties", "--protocol", "tfhe"]
83-
84-
#Generate the yml config file for the dockerized parties (bgv)
85-
[tasks.bgv-gen-local-cluster]
86-
command = "cargo"
87-
args = ["run", "--bin", "gen-experiment", "--release", "--features", "templating", "--", "-n", "${NUM_PARTIES}", "-o", "bgv-local-cluster", "-f", "temp", "parties", "--protocol", "bgv"]
88-
8982
#Generate docker-compose file for the TFHE parties as well as the toml config file for the choreogrpaher for a local deployment (tfhe)
9083
[tasks.tfhe-gen-experiment]
91-
command = "cargo"
92-
args = ["run", "--bin", "gen-experiment", "--release", "--features", "templating", "--", "-n", "${NUM_PARTIES}", "-t", "${THRESHOLD}", "-s", "${MOBY_STRATEGY}", "-f", "temp", "-o", "${EXPERIMENT_NAME}", "all", "--protocol", "tfhe" ]
84+
script = '''
85+
cargo run --bin gen-experiment --release --features templating -- -n ${NUM_PARTIES} -t ${THRESHOLD} -s ${MOBY_STRATEGY} -f temp -o ${EXPERIMENT_NAME} all --protocol tfhe ${MEASURE_MEMORY}
86+
'''
9387

9488
#Generate docker-compose file for the BGV parties as well as the toml config file for the choreogrpaher for a local deployment (bgv)
9589
[tasks.bgv-gen-experiment]
96-
command = "cargo"
97-
args = ["run", "--bin", "gen-experiment", "--release", "--features", "templating", "--", "-n", "${NUM_PARTIES}", "-t", "${THRESHOLD}", "-s", "${MOBY_STRATEGY}", "-f", "temp", "-o", "${EXPERIMENT_NAME}" , "all", "--protocol", "bgv"]
98-
99-
100-
#Bring parties alive based on provided yml file
101-
[tasks.start-parties]
102-
command = "docker"
103-
args = ["compose", "--progress=quiet", "-f", "temp/${EXPERIMENT_NAME}.yml", "up", "--quiet-pull"]
104-
105-
#Stop all parties
106-
[tasks.stop-parties]
10790
script = '''
108-
docker compose -f temp/${EXPERIMENT_NAME}.yml logs > temp/${EXPERIMENT_NAME}.log
109-
docker compose --progress=quiet -f temp/${EXPERIMENT_NAME}.yml down
91+
cargo run --bin gen-experiment --release --features templating -- -n ${NUM_PARTIES} -t ${THRESHOLD} -f temp -o ${EXPERIMENT_NAME} all --protocol bgv ${MEASURE_MEMORY}
11092
'''
11193

11294

95+
#Bring parties alive based on provided yml file, waiting for health check to pass
96+
[tasks.start-parties-healthy]
97+
command = "docker"
98+
args = ["compose", "--progress=quiet", "-f", "temp/${EXPERIMENT_NAME}.yml", "up", "--quiet-pull", "--wait"]
99+
113100
###One liner for benching everything
114101
[tasks.experiment-name]
115102
script = '''
@@ -138,82 +125,57 @@ mkdir -p temp/telemetry/archived
138125
mv temp/telemetry/export.json temp/telemetry/archived/trace_${EXPERIMENT_NAME}_$(date +%Y_%m_%d-%H:%M:%S).json
139126
'''
140127

128+
# Setup the test, creating the necessary directories and files for telemetry and session stats, with appropriate permissions for the parties to write to them. Also adds a header to the session stats files to indicate the start of a new run with the experiment name and timestamp. This task is meant to be run before starting the parties in an experiment.
141129
[tasks.setup]
142130
script = '''
143131
mkdir -p temp/telemetry
144132
echo "" > temp/telemetry/export.json
145133
chmod o+w temp/telemetry/export.json
134+
mkdir -p temp/session_stats
135+
RUN_DATE="$(date -u +%Y%m%dT%H%M%SZ)-$$"
136+
for i in $(seq 1 ${NUM_PARTIES}); do
137+
touch temp/session_stats/session_stats_$i.txt
138+
printf "\nNEW_RUN: ${EXPERIMENT_NAME} ${RUN_DATE} ${MEASURE_MEMORY}" >> temp/session_stats/session_stats_$i.txt
139+
chmod o+w temp/session_stats/session_stats_$i.txt
140+
done
146141
'''
147142

148-
#Bring parties alive based on provided yml file, waiting for health check to pass
149-
[tasks.start-parties-healthy]
150-
command = "docker"
151-
args = ["compose", "--progress=quiet", "-f", "temp/${EXPERIMENT_NAME}.yml", "up", "--quiet-pull", "--wait"]
152143

153-
#Run the full test suite for tfhe with real dkg
154-
[tasks.tfhe-test-small]
155-
command = "sh"
156-
args = ["test_scripts/tfhe_test_small_session.sh", "temp/${EXPERIMENT_NAME}.toml"]
144+
# Runs a cluster of 4 parties with the tfhe protocol, with a threshold of 1, and the "secure" strategy (no malicious behavior)
145+
[tasks.tfhe-bench-run-4p]
146+
env = {"NUM_PARTIES" = "4", THRESHOLD = "1", MOBY_STRATEGY="secure", EXPERIMENT_NAME="tfhe-bench-run-4p"}
147+
run_task = { name = ["setup", "gen-test-certs", "tfhe-gen-experiment", "experiment-name", "start-parties-healthy"], fork = true}
157148

158-
#Run the full test suite for tfhe with centralized dkg
159-
[tasks.tfhe-test-large]
160-
command = "sh"
161-
args = ["test_scripts/tfhe_test_large_session.sh", "temp/${EXPERIMENT_NAME}.toml"]
149+
# Runs a cluster of 5 parties with the tfhe protocol, with a threshold of 1, and the "secure" strategy (no malicious behavior)
150+
[tasks.tfhe-bench-run-5p]
151+
env = {"NUM_PARTIES" = "5", THRESHOLD = "1", MOBY_STRATEGY="secure", EXPERIMENT_NAME="tfhe-bench-run-5p"}
152+
run_task = { name = ["setup", "gen-test-certs", "tfhe-gen-experiment", "experiment-name", "start-parties-healthy"], fork = true}
162153

163-
#Run the full test suite for tfhe with real dkg
164-
[tasks.bgv-test-real-dkg]
165-
command = "sh"
166-
args = ["test_scripts/bgv_test_script_real_dkg.sh", "temp/${EXPERIMENT_NAME}.toml"]
154+
# Runs a cluster of 4 parties with the tfhe protocol, with a threshold of 1, and the "drop_all" strategy (malicious behavior where the malicious party does nothing)
155+
[tasks.tfhe-bench-run-4p-malicious-drop]
156+
env = {"NUM_PARTIES" = "4", THRESHOLD = "1", MOBY_STRATEGY="drop_all", EXPERIMENT_NAME="tfhe-bench-run-4p-malicious-drop"}
157+
run_task = { name = ["setup", "gen-test-certs", "tfhe-gen-experiment", "experiment-name", "start-parties-healthy"], fork = true}
167158

168-
#Run the full test suite for tfhe with centralized dkg
169-
[tasks.bgv-test-fake-dkg]
170-
command = "sh"
171-
args = ["test_scripts/bgv_test_script_fake_dkg.sh", "temp/${EXPERIMENT_NAME}.toml"]
159+
# Runs a cluster of 4 parties with the tfhe protocol, with a threshold of 1, and the "secure" strategy (no malicious behavior)
160+
[tasks.tfhe-bench-run-4p-mem]
161+
env = {"NUM_PARTIES" = "4", THRESHOLD = "1", MOBY_STRATEGY="secure", EXPERIMENT_NAME="tfhe-bench-run-4p-mem", MEASURE_MEMORY="--measure-memory"}
162+
run_task = { name = ["setup", "gen-test-certs", "tfhe-gen-experiment", "experiment-name", "start-parties-healthy"], fork = true}
172163

173-
[tasks.tfhe-bench-make]
174-
env = {MOBY_STRATEGY = "secure"}
164+
# Runs a cluster of 5 parties with the tfhe protocol, with a threshold of 1, and the "secure" strategy (no malicious behavior)
165+
[tasks.tfhe-bench-run-5p-mem]
166+
env = {"NUM_PARTIES" = "5", THRESHOLD = "1", MOBY_STRATEGY="secure", EXPERIMENT_NAME="tfhe-bench-run-5p-mem", MEASURE_MEMORY="--measure-memory"}
175167
run_task = { name = ["setup", "gen-test-certs", "tfhe-gen-experiment", "experiment-name", "start-parties-healthy"], fork = true}
176168

177-
[tasks.tfhe-bench-run]
178-
env = {"NUM_PARTIES" = "4", THRESHOLD = "1", MOBY_STRATEGY="secure", EXPERIMENT_NAME="tfhe-bench-run"}
169+
# Runs a cluster of 4 parties with the tfhe protocol, with a threshold of 1, and the "malicious_broadcast" strategy (MaliciousBroadcastSenderEcho strategy)
170+
[tasks.tfhe-bench-run-4p-malicious-bcast]
171+
env = {"NUM_PARTIES" = "4", THRESHOLD = "1", MOBY_STRATEGY="malicious_broadcast", EXPERIMENT_NAME="tfhe-bench-run-4p-malicious-bcast"}
179172
run_task = { name = ["setup", "gen-test-certs", "tfhe-gen-experiment", "experiment-name", "start-parties-healthy"], fork = true}
180173

174+
# Runs a cluster of 4 parties with the bgv protocol, with a threshold of 1, and the "secure" strategy (no malicious behavior)
181175
[tasks.bgv-bench-run]
182176
env = {"NUM_PARTIES" = "4", THRESHOLD = "1", EXPERIMENT_NAME="bgv-bench-run"}
183177
run_task = { name = ["setup", "gen-test-certs", "bgv-gen-experiment", "experiment-name", "start-parties-healthy"], fork = true}
184178

185-
# For small session we run with N=4,t=1
186-
[tasks.tfhe-run-small-session]
187-
env = {"NUM_PARTIES" = "4", THRESHOLD = "1", MOBY_STRATEGY="secure", EXPERIMENT_NAME="tfhe-small-session"}
188-
run_task = { name = ["setup", "gen-test-certs", "tfhe-gen-experiment", "experiment-name", "start-parties-healthy", "tfhe-test-small"], fork = true, cleanup_task = "shutdown" }
189-
190-
[tasks.tfhe-run-small-session-drop]
191-
env = {"NUM_PARTIES" = "4", THRESHOLD = "1", MOBY_STRATEGY="drop_all", EXPERIMENT_NAME="tfhe-small-session-drop"}
192-
run_task = { name = ["setup", "gen-test-certs", "tfhe-gen-experiment", "experiment-name", "start-parties-healthy", "tfhe-test-small"], fork = true , cleanup_task = "shutdown"}
193-
194-
[tasks.tfhe-run-small-session-malicious-bcast]
195-
env = {"NUM_PARTIES" = "4", THRESHOLD = "1", MOBY_STRATEGY="malicious_broadcast", EXPERIMENT_NAME="tfhe-small-session-malicious-bcast"}
196-
run_task = { name = ["setup", "gen-test-certs", "tfhe-gen-experiment", "experiment-name", "start-parties-healthy", "tfhe-test-small"], fork = true, cleanup_task = "shutdown" }
197-
198-
# For large session we run with N=5,t=1
199-
[tasks.tfhe-run-large-session]
200-
env = {"NUM_PARTIES" = "5", THRESHOLD = "1", MOBY_STRATEGY="secure", EXPERIMENT_NAME="tfhe-large-session"}
201-
run_task = { name = ["setup", "gen-test-certs", "tfhe-gen-experiment", "experiment-name", "start-parties-healthy", "tfhe-test-large"], fork = true, cleanup_task = "shutdown" }
202-
203-
[tasks.tfhe-run-large-session-drop]
204-
env = {"NUM_PARTIES" = "5", THRESHOLD = "1", MOBY_STRATEGY="drop_all", EXPERIMENT_NAME="tfhe-large-session-drop"}
205-
run_task = { name = ["setup", "gen-test-certs", "tfhe-gen-experiment", "experiment-name", "start-parties-healthy", "tfhe-test-large"], fork = true, cleanup_task = "shutdown" }
206-
207-
208-
[tasks.tfhe-run-large-session-malicious-bcast]
209-
env = {"NUM_PARTIES" = "5", THRESHOLD = "1", MOBY_STRATEGY="malicious_broadcast", EXPERIMENT_NAME="tfhe-large-session-malicious-bcast"}
210-
run_task = { name = ["setup", "gen-test-certs", "tfhe-gen-experiment", "experiment-name", "start-parties-healthy", "tfhe-test-large"], fork = true, cleanup_task = "shutdown" }
211-
212-
##For BGV we set NUM_PARTIES to 4 as we only need small sessions
213-
[tasks.bgv-bench-fake-dkg]
214-
env = {"NUM_PARTIES" = "4", THRESHOLD = "1", EXPERIMENT_NAME="bgv"}
215-
run_task = { name = ["setup", "gen-test-certs", "bgv-gen-experiment", "experiment-name", "start-parties-healthy", "bgv-test-fake-dkg"], fork = true, cleanup_task = "shutdown" }
216-
217-
[tasks.bgv-bench-real-dkg]
218-
env = {"NUM_PARTIES" = "4", THRESHOLD = "1", EXPERIMENT_NAME="bgv"}
219-
run_task = { name = ["setup", "gen-test-certs", "bgv-gen-experiment", "experiment-name", "start-parties-healthy", "bgv-test-real-dkg"], fork = true, cleanup_task = "shutdown" }
179+
[tasks.bgv-bench-run-mem]
180+
env = {"NUM_PARTIES" = "4", THRESHOLD = "1", EXPERIMENT_NAME="bgv-bench-run-mem", MEASURE_MEMORY="--measure-memory"}
181+
run_task = { name = ["setup", "gen-test-certs", "bgv-gen-experiment", "experiment-name", "start-parties-healthy"], fork = true}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
non_threshold_bench/
22
kat/
3+
threshold/

core/experiments/NIST_scripts/build.sh

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ cargo install --force cargo-criterion
5858

5959
# Clone the repository (replace with submission's repo URL)
6060
REPO_URL="https://github.com/zama-ai/kms.git"
61-
TARGET_DIR="$HOME/kms/core/experiments/
61+
TARGET_DIR="$HOME/kms/core/experiments/"
6262

6363
if [ ! -d "$TARGET_DIR" ]; then
6464
cd $HOME

core/experiments/NIST_scripts/non-threshold-parser.py

Lines changed: 54 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ def __init__(self):
104104
self.verify_batched_load_proof_memory: float = -1
105105
self.verify_batched_load_verify_latency: float = -1
106106
self.verify_batched_load_verify_memory: float = -1
107+
# Serialized proof sizes
108+
self.proof_size_load_proof: float = -1
109+
self.proof_size_load_verify: float = -1
107110

108111
def all_missing(self):
109112
return all(v == -1 for v in [
@@ -114,6 +117,7 @@ def all_missing(self):
114117
self.verify_two_steps_load_verify_latency, self.verify_two_steps_load_verify_memory,
115118
self.verify_batched_load_proof_latency, self.verify_batched_load_proof_memory,
116119
self.verify_batched_load_verify_latency, self.verify_batched_load_verify_memory,
120+
self.proof_size_load_proof, self.proof_size_load_verify,
117121
])
118122

119123

@@ -355,6 +359,37 @@ def parse_zk_memory(line):
355359
elif load == "load_verify":
356360
entry.verify_batched_load_verify_memory = memory
357361

362+
# ---------------------------------------------------------------------------
363+
# ZK PoK size parsing
364+
# ---------------------------------------------------------------------------
365+
366+
def parse_zk_size_line(line):
367+
"""Parse a line like 'proof size (B, serialized): non-threshold_zk-pok_PARAMS=1234'."""
368+
match = re.search(r"proof size \(B, serialized\): (.+)=(\d+)", line)
369+
if match is None:
370+
return
371+
name = match.group(1)
372+
size_bytes = int(match.group(2))
373+
size_kb = size_bytes * UNIT_CONV_TO_KB["B"]
374+
for key in ZK_PARAMS_MAP:
375+
if key in name:
376+
entry = ZK_RESULT_MAP[key]
377+
if name.endswith("_verify_load"):
378+
entry.proof_size_load_verify = size_kb
379+
elif name.endswith("_proof_load"):
380+
entry.proof_size_load_proof = size_kb
381+
else:
382+
print("Unknown proof size line with name {}: {}".format(name, line))
383+
return
384+
385+
def parse_size_file():
386+
if not os.path.isfile(SIZE_FILE):
387+
return
388+
with open(SIZE_FILE, "r") as f:
389+
for line in f:
390+
if "proof size" in line:
391+
parse_zk_size_line(line)
392+
358393
# ---------------------------------------------------------------------------
359394
# Shared memory-file entry point
360395
# ---------------------------------------------------------------------------
@@ -407,45 +442,55 @@ def output_zk_csv_files():
407442
file_name = os.path.join(OUTPUT_DIRECTORY, ZK_PARAMS_MAP[params])
408443
with open(file_name, "w") as f:
409444
w = csv.writer(f, delimiter=",")
410-
w.writerow(["Operation", "avg_latency_ms", "max_memory_kBytes"])
445+
w.writerow(["Operation", "avg_latency_ms", "max_memory_kBytes",
446+
"proof_size_kBytes"])
411447
w.writerow(["CRSGen",
412448
result.crs_gen_latency,
413-
result.crs_gen_memory])
449+
result.crs_gen_memory,
450+
-1])
414451
w.writerow(["ProofGen_LoadProof",
415452
result.proof_gen_load_proof_latency,
416-
result.proof_gen_load_proof_memory])
453+
result.proof_gen_load_proof_memory,
454+
result.proof_size_load_proof])
417455
w.writerow(["ProofGen_LoadVerify",
418456
result.proof_gen_load_verify_latency,
419-
result.proof_gen_load_verify_memory])
457+
result.proof_gen_load_verify_memory,
458+
result.proof_size_load_verify])
420459
w.writerow(["VerifyTwoSteps_LoadProof",
421460
result.verify_two_steps_load_proof_latency,
422-
result.verify_two_steps_load_proof_memory])
461+
result.verify_two_steps_load_proof_memory,
462+
result.proof_size_load_proof])
423463
w.writerow(["VerifyTwoSteps_LoadVerify",
424464
result.verify_two_steps_load_verify_latency,
425-
result.verify_two_steps_load_verify_memory])
465+
result.verify_two_steps_load_verify_memory,
466+
result.proof_size_load_verify])
426467
w.writerow(["VerifyBatched_LoadProof",
427468
result.verify_batched_load_proof_latency,
428-
result.verify_batched_load_proof_memory])
469+
result.verify_batched_load_proof_memory,
470+
result.proof_size_load_proof])
429471
w.writerow(["VerifyBatched_LoadVerify",
430472
result.verify_batched_load_verify_latency,
431-
result.verify_batched_load_verify_memory])
473+
result.verify_batched_load_verify_memory,
474+
result.proof_size_load_verify])
432475

433476
# ---------------------------------------------------------------------------
434477
# Entry point
435478
# ---------------------------------------------------------------------------
436479

437480
def main():
438-
global LATENCY_FILE, MEMORY_FILE, OUTPUT_DIRECTORY
481+
global LATENCY_FILE, MEMORY_FILE, SIZE_FILE, OUTPUT_DIRECTORY
439482
if len(sys.argv) != 2:
440483
print("Usage: {} <folder>".format(sys.argv[0]))
441484
sys.exit(1)
442485
folder = sys.argv[1]
443486
LATENCY_FILE = os.path.join(folder, "bench_results.json")
444487
MEMORY_FILE = os.path.join(folder, "memory_bench_results.txt")
488+
SIZE_FILE = os.path.join(folder, "size_bench_results.txt")
445489
OUTPUT_DIRECTORY = os.path.join(folder, "output")
446490

447491
parse_latency_file()
448492
parse_memory_file()
493+
parse_size_file()
449494
output_result_csv_files()
450495
output_zk_csv_files()
451496

core/experiments/NIST_scripts/non-threshold-tfhe-bench.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,22 @@ mkdir -p $TARGET_DIR
3131
: > "$MEMORY_OUTPUT_FILE"
3232

3333
# Run the latency benchmarks
34+
echo "Running TFHE speed benchmarks → $OUTPUT_FILE"
3435
for bench in "${SPEED_BENCH_LIST[@]}"; do
3536
cargo-criterion --bench $bench --message-format json >> $OUTPUT_FILE
3637
done
3738

3839
## Run the memory benchmarks
40+
echo ""
41+
echo "Running TFHE memory benchmarks → $MEMORY_OUTPUT_FILE"
3942
for bench in "${MEMORY_BENCH_LIST[@]}"; do
4043
cargo bench --bench $bench --features=measure_memory >> $MEMORY_OUTPUT_FILE
4144
done
4245

4346

47+
echo ""
48+
echo "Parsing results into CSV → $TARGET_DIR/output/"
4449
python3 non-threshold-parser.py $TARGET_DIR
50+
51+
echo ""
52+
echo "Done. Results saved to $TARGET_DIR"

0 commit comments

Comments
 (0)