Skip to content

feat(circuit_params): add --registry JSON output#399

Open
ilyalesokhin-starkware wants to merge 1 commit into
mainfrom
ilya/circuit-params-format
Open

feat(circuit_params): add --registry JSON output#399
ilyalesokhin-starkware wants to merge 1 commit into
mainfrom
ilya/circuit-params-format

Conversation

@ilyalesokhin-starkware

@ilyalesokhin-starkware ilyalesokhin-starkware commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Stacked on #398.

Monday: Write a utility to generate all the circuits preprocessed roots

What

Adds a --format flag to the circuit-params binary:

  • info (default) — the existing human-readable output: per-component non-padded row count, padded log size, and usage percentage.
  • json — a JSON array with, per verified trace size, only the per-component padded log sizes.

Usage

cargo run -p circuit-params -- --min-trace-log-size 25 --max-trace-log-size 28 --format json

Example json output:

[
  {
    "trace_log_size": 25,
    "components": { "eq": 20, "qm31_ops": 23, "m31_to_u32": 20, "triple_xor": 19, "blake_g_gate": 23 }
  }
]

Tests

The CLI test now covers both formats (run_circuit_params_binary_info, run_circuit_params_binary_json).

🤖 Generated with Claude Code


This change is Reviewable

@cursor

cursor Bot commented Jul 20, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Registry output defines verifier circuit identity via preprocessed roots and shared padding targets, which downstream provers/verifiers must match; incorrect roots or sizing would break proof verification, though scope is limited to the params generation tool and schema crate.

Overview
Introduces a shared circuit-registry crate that defines the JSON schema for supported verifier circuits (configs, leaf verifiers per trace size, multiverifiers, and preprocessed Merkle roots as hex).

circuit-params gains a --registry mode that emits that registry instead of the default human-readable size report. In registry mode it computes shared pad targets (elementwise max of leaf and multiverifier component sizes at max_trace_log_size), pads each circuit with pad_to_targets, then commits preprocessed traces to produce roots for every leaf verifier in the range and one multiverifier entry.

CLI flags are aligned to explicit snake_case names (--min_trace_log_size, --output_path, etc.). Tests add a serde round-trip for the schema and split CLI coverage; the full registry CLI test is behind a slow-tests feature because it Merkle-commits a large trace.

Reviewed by Cursor Bugbot for commit 5b7057f. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.49%. Comparing base (4c777d3) to head (5b7057f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #399      +/-   ##
==========================================
+ Coverage   67.86%   68.49%   +0.62%     
==========================================
  Files          42       43       +1     
  Lines        5459     5568     +109     
==========================================
+ Hits         3705     3814     +109     
  Misses       1754     1754              
Files with missing lines Coverage Δ
crates/circuit_params/src/main.rs 99.00% <100.00%> (+0.75%) ⬆️
crates/circuit_registry/src/schema.rs 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ilyalesokhin-starkware
ilyalesokhin-starkware changed the base branch from ilya/circuit-params-sizes to graphite-base/399 July 21, 2026 07:14
@ilyalesokhin-starkware
ilyalesokhin-starkware force-pushed the ilya/circuit-params-format branch from 8ef2659 to e71f1b1 Compare July 21, 2026 07:14
@ilyalesokhin-starkware
ilyalesokhin-starkware changed the base branch from graphite-base/399 to ilya/circuit-params-multiverifier July 21, 2026 07:14
@ilyalesokhin-starkware
ilyalesokhin-starkware changed the base branch from ilya/circuit-params-multiverifier to graphite-base/399 July 21, 2026 07:52
@ilyalesokhin-starkware
ilyalesokhin-starkware force-pushed the ilya/circuit-params-format branch from e71f1b1 to 844c983 Compare July 21, 2026 08:58
@ilyalesokhin-starkware
ilyalesokhin-starkware changed the base branch from graphite-base/399 to ilya/circuit-params-multiverifier July 21, 2026 08:58
Comment thread crates/circuit_params/src/main.rs
@YairVaknin-starkware YairVaknin-starkware removed their assignment Jul 21, 2026
@YairVaknin-starkware
YairVaknin-starkware self-requested a review July 21, 2026 09:45
@ilyalesokhin-starkware
ilyalesokhin-starkware changed the base branch from ilya/circuit-params-multiverifier to graphite-base/399 July 21, 2026 11:56
@ilyalesokhin-starkware
ilyalesokhin-starkware force-pushed the ilya/circuit-params-format branch from 844c983 to feeb45f Compare July 21, 2026 13:05
@ilyalesokhin-starkware
ilyalesokhin-starkware changed the base branch from graphite-base/399 to ilya/circuit-params-multiverifier July 21, 2026 13:05
@ilyalesokhin-starkware
ilyalesokhin-starkware force-pushed the ilya/circuit-params-multiverifier branch 2 times, most recently from dcc249a to 14dc54d Compare July 21, 2026 15:16
@ilyalesokhin-starkware
ilyalesokhin-starkware force-pushed the ilya/circuit-params-format branch from feeb45f to 202c191 Compare July 21, 2026 15:16

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 202c191. Configure here.

Comment thread crates/circuit_params/src/main.rs
Comment thread crates/circuit_params/src/main.rs
@ilyalesokhin-starkware
ilyalesokhin-starkware changed the base branch from ilya/circuit-params-multiverifier to graphite-base/399 July 21, 2026 15:31
@ilyalesokhin-starkware
ilyalesokhin-starkware force-pushed the ilya/circuit-params-format branch from 202c191 to e56d901 Compare July 21, 2026 15:31

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ilyalesokhin-starkware resolved 1 discussion.
Reviewable status: 0 of 6 files reviewed, all discussions resolved (waiting on YairVaknin-starkware).

@graphite-app
graphite-app Bot changed the base branch from graphite-base/399 to main July 21, 2026 15:32
@ilyalesokhin-starkware
ilyalesokhin-starkware force-pushed the ilya/circuit-params-format branch 3 times, most recently from d307560 to 9a6569d Compare July 22, 2026 13:36
@ilyalesokhin-starkware ilyalesokhin-starkware changed the title feat(circuit_params): add --format supporting info and json feat(circuit_params): add --registry JSON output Jul 23, 2026
The JSON schema lives in a new `circuit-registry` crate so it can be shared with
the leaf prover.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants