Skip to content

feat: Mavros main and sound Mavros public-input binding - #507

Merged
zkfriendly merged 21 commits into
mainfrom
ys/ark06-mavros-main
Nov 11, 2026
Merged

zkfriendly merged 21 commits into
mainfrom
ys/ark06-mavros-main

Conversation

@BornPsych

@BornPsych BornPsych commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator
  • Pins Mavros to main (a4f2a3d), which includes Add a versioned r1cs.bin artifact carrying a witness manifest reilabs/mavros#414. Its r1cs.bin carries a versioned header, a witness manifest and a digest over the R1CS and manifest. A legacy bincode r1cs.bin is rejected with a hint to recompile at the pinned revision.
  • Mavros writes public parameters first and computes the return at the tail of the algebraic section. A column map built from the manifest brings the return forward so public inputs occupy witness[1..=n], and the prover applies the same permutation to the witness and to the AD derivatives (skipped when the map is the identity).
  • The circuit computes its return; a return entry in Prover.toml is optional and, when present, checked against the computed value, as nargo does. The return guard Mavros used to emit is gone.
  • The Mavros digest is the Fiat-Shamir session id. Prover, scheme and verifier keys carry it, and a verifier holding a different digest, or none, rejects an honest proof. WhirR1CSVerifier gains verify_with_session; verify delegates to it with no session. Prover, scheme and verifier formats move to 3.1.
  • Build the SPARK matrix from the scheme R1CS for both frontends, so --r1cs is no longer needed for SPARK with the Mavros compiler.
  • Parity tooling. scripts/mavros_parity.sh runs circuits through both frontends and compares public inputs, prove time and proof size. A scheduled workflow (Monday and Thursday, plus dispatch) runs it over every binary example with inputs, building the Mavros CLI on stable at the pinned revision.

Mavros is still not the primary compiler. A follow-up PR will make Mavros primary and the Noir R1CS path secondary, and once Mavros has a stable release the other backend will be removed.

@vercel

vercel Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs-provekit-org Ready Ready Preview Nov 5, 2026 5:43am UTC

Request Review

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

CSP benchmarks

Metric Value
Workflow status [PASS] success
Commit 63fd6fd9fb57
Run #41975793819
Circuits benchmarked 21
Iterations averaged per circuit 3

Prover time, peak RSS, peak heap, and verifier time are arithmetic means across the iterations. Peak heap comes from the largest peak memory entry in provekit-cli prove's tracing output; peak RSS is reported by /usr/bin/time -v (max-resident-set-size).

Each metric cell shows the current value followed by the percentage delta against the latest successful main run #41786286870. (new) marks circuits absent from the baseline.

Results
Circuit Constraints Witnesses Prover time Peak RSS Peak heap Verifier time Proof size PKP size
ecdsa_p256 143,321 (±0.0%) 258,215 (±0.0%) 1.43 s (+0.5%) 265 MB (-1.2%) 232 MB (±0.0%) 110 ms (±0.0%) 451 KB (+0.8%) 831 KB (±0.0%)
keccak_1024 788,814 (±0.0%) 1,490,812 (±0.0%) 4.04 s (+1.8%) 1.05 GB (-0.1%) 1.05 GB (±0.0%) 500 ms (+4.2%) 484 KB (-1.9%) 6.01 MB (±0.0%)
keccak_128 157,522 (±0.0%) 304,529 (±0.0%) 993 ms (+2.4%) 279 MB (-0.2%) 248 MB (±0.0%) 127 ms (+5.6%) 451 KB (+0.7%) 1.24 MB (±0.0%)
keccak_2048 1,507,374 (±0.0%) 2,840,532 (±0.0%) 7.87 s (+1.9%) 1.98 GB (±0.0%) 2.07 GB (±0.0%) 937 ms (+1.8%) 545 KB (-0.7%) 12.15 MB (±0.0%)
keccak_256 247,782 (±0.0%) 474,010 (±0.0%) 1.20 s (+2.9%) 332 MB (-0.2%) 304 MB (±0.0%) 170 ms (±0.0%) 440 KB (-2.0%) 1.89 MB (±0.0%)
keccak_512 428,126 (±0.0%) 812,944 (±0.0%) 2.12 s (+2.4%) 584 MB (-0.1%) 558 MB (±0.0%) 273 ms (+2.5%) 465 KB (-0.7%) 3.25 MB (±0.0%)
poseidon2_12 479 (±0.0%) 563 (±0.0%) 50 ms (+15.5%) 13.37 MB (-2.9%) 4.17 MB (±0.0%) 10 ms (±0.0%) 227 KB (-1.6%) 437 KB (±0.0%)
poseidon2_16 556 (±0.0%) 719 (±0.0%) 50 ms (+15.5%) 14.07 MB (-2.9%) 4.32 MB (-0.1%) 10 ms (±0.0%) 226 KB (-0.7%) 530 KB (±0.0%)
poseidon2_2 231 (±0.0%) 278 (±0.0%) 40 ms (±0.0%) 12.54 MB (-4.0%) 3.44 MB (±0.0%) 10 ms (±0.0%) 226 KB (+0.3%) 108 KB (±0.0%)
poseidon2_4 529 (±0.0%) 535 (±0.0%) 40 ms (+33.3%) 12.98 MB (-3.4%) 3.63 MB (±0.0%) 10 ms (±0.0%) 227 KB (+1.1%) 31.93 KB (±0.0%)
poseidon2_8 363 (±0.0%) 423 (±0.0%) 40 ms (±0.0%) 13.15 MB (-4.1%) 4.08 MB (±0.0%) 10 ms (±0.0%) 225 KB (+2.1%) 365 KB (±0.0%)
poseidon_12 504 (±0.0%) 524 (±0.0%) 50 ms (+25.0%) 13.66 MB (-4.1%) 4.27 MB (±0.0%) 10 ms (±0.0%) 227 KB (+1.3%) 569 KB (±0.0%)
poseidon_16 609 (±0.0%) 633 (±0.0%) 50 ms (±0.0%) 14.65 MB (-2.8%) 4.93 MB (+0.1%) 20 ms (±0.0%) 223 KB (-0.7%) 717 KB (±0.0%)
poseidon_2 240 (±0.0%) 249 (±0.0%) 40 ms (+20.1%) 12.43 MB (-4.0%) 3.40 MB (±0.0%) 10 ms (±0.0%) 226 KB (+1.8%) 59.38 KB (±0.0%)
poseidon_4 297 (±0.0%) 309 (±0.0%) 40 ms (±0.0%) 13.41 MB (-3.6%) 4.02 MB (±0.0%) 10 ms (±0.0%) 226 KB (+0.6%) 333 KB (±0.0%)
poseidon_8 402 (±0.0%) 418 (±0.0%) 40 ms (±0.0%) 13.55 MB (-3.1%) 4.15 MB (±0.0%) 10 ms (±0.0%) 227 KB (+0.2%) 448 KB (±0.0%)
sha256_1024 196,913 (±0.0%) 339,721 (±0.0%) 1.10 s (+1.9%) 321 MB (+0.5%) 286 MB (±0.0%) 187 ms (+3.7%) 449 KB (+0.4%) 1.83 MB (-3.7%)
sha256_128 46,371 (±0.0%) 80,931 (±0.0%) 280 ms (+3.7%) 84.47 MB (-1.6%) 67.81 MB (±0.0%) 57 ms (+13.4%) 390 KB (+1.6%) 497 KB (-0.3%)
sha256_2048 345,372 (±0.0%) 612,681 (±0.0%) 2.13 s (+2.9%) 567 MB (-0.7%) 535 MB (±0.0%) 327 ms (+1.1%) 467 KB (-1.1%) 3.03 MB (-0.9%)
sha256_256 67,877 (±0.0%) 117,901 (±0.0%) 467 ms (+2.2%) 140 MB (-1.1%) 120 MB (±0.0%) 73 ms (+4.7%) 394 KB (-1.3%) 705 KB (+1.2%)
sha256_512 110,889 (±0.0%) 191,841 (±0.0%) 600 ms (+4.0%) 173 MB (-0.3%) 153 MB (±0.0%) 110 ms (+10.0%) 407 KB (+2.1%) 1.05 MB (-4.8%)

@BornPsych BornPsych changed the title feat: arkworks 0.6, Mavros main and sound Mavros public-input binding feat: Mavros main and sound Mavros public-input binding Oct 14, 2026
@BornPsych
BornPsych force-pushed the ys/ark06-mavros-main branch from 1dc088c to 27ba3c6 Compare October 19, 2026 10:45
@BornPsych
BornPsych marked this pull request as ready for review October 19, 2026 12:47
@BornPsych
BornPsych added this pull request to stack #516 October 21, 2026 07:15
@BornPsych
BornPsych force-pushed the ys/ark06-mavros-main branch from 1fc2b56 to 137cf91 Compare October 22, 2026 17:18
Comment thread provekit/backend/bn254/src/verify.rs Resolved
…ey layout

MavrosProver now serializes the column map and WitnessLayout gained the
guard and return fields, so keys written before this branch no longer
parse. Bump the minor so a stale .pkp or .nps is rejected with a version
error instead of a deserialization failure, as #457 did for the previous
MavrosSchemeData change. Verifier files are unchanged.

diff --git a/provekit/common/src/file/binary_format.rs b/provekit/common/src/file/binary_format.rs
index 3e36b19..68589d9 100644
--- a/provekit/common/src/file/binary_format.rs
+++ b/provekit/common/src/file/binary_format.rs
@@ -18,13 +18,13 @@ pub const XZ_MAGIC: [u8; 6] = [0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00];
 // ---------------------------------------------------------------------------

 pub const PROVER_FORMAT: [u8; 8] = *b"PrvKitPr";
-pub const PROVER_VERSION: (u16, u16) = (2, 0);
+pub const PROVER_VERSION: (u16, u16) = (2, 1);

 pub const VERIFIER_FORMAT: [u8; 8] = *b"PrvKitVr";
 pub const VERIFIER_VERSION: (u16, u16) = (2, 1);

 pub const NOIR_PROOF_SCHEME_FORMAT: [u8; 8] = *b"NrProScm";
-pub const NOIR_PROOF_SCHEME_VERSION: (u16, u16) = (2, 0);
+pub const NOIR_PROOF_SCHEME_VERSION: (u16, u16) = (2, 1);

 pub const NOIR_PROOF_FORMAT: [u8; 8] = *b"NPSProof";
 pub const NOIR_PROOF_VERSION: (u16, u16) = (2, 0);
@zkfriendly
zkfriendly merged commit a1354df into main Nov 11, 2026
14 checks passed
@BornPsych
BornPsych deleted the ys/ark06-mavros-main branch November 11, 2026 13:01

This branch was successfully deployed

1 active deployment
Preview — 08cfe547 Deployed Nov 5, 2026 by vercel[bot]
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.

3 participants