Skip to content

Commit a428e00

Browse files
committed
Revive markdown reporting
1 parent ed77f4b commit a428e00

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

results.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The cell values are the bits of security for each such component.
1919
- Trace length (H): $2^{22}$
2020
- Batching: Powers
2121

22-
**Proof Size Estimate:** 1352 KiB, where 1 KiB = 1024 bytes
22+
**Proof Size Estimate:** 992 KiB, where 1 KiB = 1024 bytes
2323

2424
| regime | total | ALI | DEEP | FRI batching round | FRI commit rounds (×5) | FRI query phase |
2525
| --- | --- | --- | --- | --- | --- | --- |
@@ -37,7 +37,7 @@ The cell values are the bits of security for each such component.
3737
- Trace length (H): $2^{18}$
3838
- Batching: Powers
3939

40-
**Proof Size Estimate:** 114 KiB, where 1 KiB = 1024 bytes
40+
**Proof Size Estimate:** 175 KiB, where 1 KiB = 1024 bytes
4141

4242
| regime | total | ALI | DEEP | FRI batching round | FRI commit rounds (×7) | FRI query phase |
4343
| --- | --- | --- | --- | --- | --- | --- |
@@ -55,7 +55,7 @@ The cell values are the bits of security for each such component.
5555
- Trace length (H): $2^{21}$
5656
- Batching: Powers
5757

58-
**Proof Size Estimate:** 223 KiB, where 1 KiB = 1024 bytes
58+
**Proof Size Estimate:** 576 KiB, where 1 KiB = 1024 bytes
5959

6060
| regime | total | ALI | DEEP | FRI batching round | FRI commit rounds (×4) | FRI query phase |
6161
| --- | --- | --- | --- | --- | --- | --- |

soundcalc/main.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@
22
import json
33

44
from soundcalc.common.utils import KIB
5-
from soundcalc.regimes.best_attack import best_attack_security
6-
from soundcalc.zkvms.fri_based_vm import get_DEEP_ALI_errors
75
from soundcalc.zkvms.risc0 import Risc0Preset
86
from soundcalc.zkvms.miden import MidenPreset
97
from soundcalc.zkvms.zisk import ZiskPreset
10-
from soundcalc.regimes.johnson_bound import JohnsonBoundRegime
11-
from soundcalc.regimes.unique_decoding import UniqueDecodingRegime
128
from soundcalc.report import build_markdown_report
139
from soundcalc.zkvms.zkvm import zkVM
1410

@@ -27,7 +23,7 @@ def generate_and_save_md_report(sections) -> None:
2723
print(f"wrote :: {md_path}")
2824

2925

30-
def print_summary_for_zkvm(zkvm: zkVM) -> None:
26+
def print_summary_for_zkvm(zkvm: zkVM, security_levels: dict | None = None) -> None:
3127
"""
3228
Print a summary of security results for a single zkVM.
3329
"""
@@ -41,7 +37,9 @@ def print_summary_for_zkvm(zkvm: zkVM) -> None:
4137
print("")
4238
print(f"parameters: \n {zkvm.get_parameter_summary()}")
4339
print("")
44-
print(f"security levels (rbr): \n {json.dumps(zkvm.get_security_levels(), indent=4)}")
40+
if security_levels is None:
41+
security_levels = zkvm.get_security_levels()
42+
print(f"security levels (rbr): \n {json.dumps(security_levels, indent=4)}")
4543
print("")
4644
print("")
4745
print("")
@@ -55,6 +53,8 @@ def main() -> None:
5553
generate reports, and save results to disk.
5654
"""
5755

56+
sections: dict[str, tuple[zkVM, dict[str, dict]]] = {}
57+
5858
# We consider the following zkVMs
5959
zkvms = [
6060
ZiskPreset.default(),
@@ -64,11 +64,12 @@ def main() -> None:
6464

6565
# Analyze each zkVM
6666
for zkvm in zkvms:
67-
print_summary_for_zkvm(zkvm)
67+
security_levels = zkvm.get_security_levels()
68+
print_summary_for_zkvm(zkvm, security_levels)
69+
sections[zkvm.get_name()] = (zkvm, security_levels)
6870

6971
# Generate and save markdown report
70-
# TODO. re-integrate
71-
# generate_and_save_md_report(sections)
72+
generate_and_save_md_report(sections)
7273

7374
if __name__ == "__main__":
7475
main()

soundcalc/report.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,38 +29,38 @@ def build_markdown_report(sections) -> str:
2929
lines.append(f"## {zkevm}")
3030
lines.append("")
3131

32-
(zkevm_params, results) = sections[zkevm]
32+
(zkvm_obj, results) = sections[zkevm]
3333
display_results: dict[str, Any] = {
3434
name: data.copy() if isinstance(data, dict) else data
3535
for name, data in results.items()
3636
}
3737

3838
# Add parameter information
3939
lines.append(f"**Parameters:**")
40-
lines.append(f"- Number of queries: {zkevm_params.num_queries}")
41-
lines.append(f"- Grinding (bits): {zkevm_params.grinding_query_phase}")
40+
lines.append(f"- Number of queries: {zkvm_obj.num_queries}")
41+
lines.append(f"- Grinding (bits): {zkvm_obj.grinding_query_phase}")
4242
# Get field name from the field extension degree and base field
4343
field_name = "Unknown"
44-
if hasattr(zkevm_params, 'field_extension_degree'):
45-
if zkevm_params.field_extension_degree == 2:
44+
if hasattr(zkvm_obj, 'field_extension_degree'):
45+
if zkvm_obj.field_extension_degree == 2:
4646
field_name = "Goldilocks²"
47-
elif zkevm_params.field_extension_degree == 3:
47+
elif zkvm_obj.field_extension_degree == 3:
4848
field_name = "Goldilocks³"
49-
elif zkevm_params.field_extension_degree == 4:
49+
elif zkvm_obj.field_extension_degree == 4:
5050
field_name = "BabyBear⁴"
51-
elif zkevm_params.field_extension_degree == 5:
51+
elif zkvm_obj.field_extension_degree == 5:
5252
field_name = "BabyBear⁵"
5353
lines.append(f"- Field: {field_name}")
54-
lines.append(f"- Rate (ρ): {zkevm_params.rho}")
55-
lines.append(f"- Trace length (H): $2^{{{zkevm_params.h}}}$")
56-
if zkevm_params.power_batching:
54+
lines.append(f"- Rate (ρ): {zkvm_obj.rho}")
55+
lines.append(f"- Trace length (H): $2^{{{zkvm_obj.h}}}$")
56+
if zkvm_obj.power_batching:
5757
lines.append(f"- Batching: Powers")
5858
else:
5959
lines.append(f"- Batching: Affine")
6060
lines.append("")
6161

6262
# Proof size
63-
proof_size_kib = zkevm_params.proof_size_bits // KIB
63+
proof_size_kib = zkvm_obj.get_proof_size_bits() // KIB
6464
lines.append(f"**Proof Size Estimate:** {proof_size_kib} KiB, where 1 KiB = 1024 bytes")
6565
lines.append("")
6666

0 commit comments

Comments
 (0)