Skip to content

ci: field-separation guard + per-backend standalone builds#469

Open
BornPsych wants to merge 2 commits into
mainfrom
ci/field-separation-guard
Open

ci: field-separation guard + per-backend standalone builds#469
BornPsych wants to merge 2 commits into
mainfrom
ci/field-separation-guard

Conversation

@BornPsych

Copy link
Copy Markdown
Collaborator

Summary

Adds three CI jobs that enforce two invariants the existing --all-features build
silently masks: that the 64-bit Goldilocks backend never links a bn254/256-bit
dependency, and that each backend (plus its welded tooling and fixtures) still builds
and tests in isolation. No production code changes.

Why

#458#460 made the proving spine field-generic and added a second backend
(provekit-backend-goldilocks) whose entire point is a pure 64-bit dependency graph.
Two things now need machine enforcement:

  • Field separation — a single accidental dependency on a bn254/256-bit crate (a
    curve stack, or the Noir/Mavros frontend) would defeat the separation the backend split
    was built for, and a monolithic --all-features build would never catch it.
  • Standalone buildability — a backend that only compiles with every feature enabled is
    not actually standalone. These jobs catch a backend or its tooling that stops building on
    its own.

What changed

  • scripts/check-field-separation.sh (new, fail-closed): captures each backend's
    cargo tree and (1) allowlists the workspace-local crates the Goldilocks graph may
    contain (provekit-common, -prover, -verifier, and the goldilocks backend itself),
    (2) denylists external bn254/256-bit crate families (ark-bn254, ark-ec, k256,
    acir, mavros-*, …) as defense-in-depth, and (3) aborts if cargo tree errors or
    returns an empty graph — a guard that cannot inspect the graph must not pass.
  • .github/workflows/ci.yml: three new jobs —
    • field_separation runs the guard script.
    • goldilocks_standalone builds + tests provekit-backend-goldilocks with no
      --all-features, plus its fixtures.
    • bn254_standalone builds + tests provekit-backend-bn254 and its welded tooling
      (r1cs-compiler, cli, ffi, gnark, bench, verifier-server,
      passport-input-gen), plus its fixtures.

Verification

  • ./scripts/check-field-separation.shOK: field-backend dependency separation holds.
    (exit 0) against current main.
  • ci.yml parses as valid YAML; all three jobs registered.

Commits

  • ci: per-backend standalone builds + field-separation guard

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs-provekit-org Ready Ready Preview Jul 8, 2026 11:09am

Request Review

Add three CI jobs: a field-separation guard (check-field-separation.sh
verifies the goldilocks backend never pulls a bn254/256-bit dependency,
fail-closed), and standalone build+test jobs for each backend and its
fixtures, so a field backend that stops building in isolation is caught.
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

CSP benchmarks

Metric Value
Workflow status [PASS] success
Commit a9234baa2def
Run #28938068671
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 #28917281870. (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%) 2.61 s (-0.6%) 256 MB (±0.0%) 226 MB (+0.3%) 340 ms (-1.0%) 2.79 MB (-0.1%) 811 KB (±0.0%)
keccak_1024 788,814 (±0.0%) 1,490,812 (±0.0%) 6.31 s (-0.2%) 973 MB (±0.0%) 938 MB (±0.0%) 820 ms (-0.8%) 3.16 MB (+0.7%) 5.88 MB (±0.0%)
keccak_128 157,522 (±0.0%) 304,529 (±0.0%) 2.11 s (-0.3%) 273 MB (-0.1%) 239 MB (-0.1%) 360 ms (±0.0%) 2.79 MB (+0.3%) 1.26 MB (±0.0%)
keccak_2048 1,507,374 (±0.0%) 2,840,532 (±0.0%) 11.69 s (+0.1%) 1.78 GB (±0.0%) 1.77 GB (±0.0%) 1.40 s (-1.2%) 3.24 MB (-0.5%) 11.97 MB (±0.0%)
keccak_256 247,782 (±0.0%) 474,010 (±0.0%) 2.29 s (-0.9%) 326 MB (-0.1%) 286 MB (±0.0%) 400 ms (-0.8%) 2.83 MB (+0.2%) 1.88 MB (±0.0%)
keccak_512 428,126 (±0.0%) 812,944 (±0.0%) 3.60 s (-0.2%) 581 MB (±0.0%) 502 MB (-0.1%) 543 ms (+1.2%) 2.96 MB (-0.7%) 3.32 MB (±0.0%)
poseidon2_12 479 (±0.0%) 563 (±0.0%) 350 ms (-0.9%) 24.39 MB (-0.4%) 14.69 MB (±0.0%) 100 ms (-3.2%) 1.04 MB (-0.1%) 437 KB (±0.0%)
poseidon2_16 556 (±0.0%) 719 (±0.0%) 350 ms (±0.0%) 24.79 MB (±0.0%) 14.88 MB (±0.0%) 100 ms (±0.0%) 1.03 MB (-1.9%) 530 KB (±0.0%)
poseidon2_2 231 (±0.0%) 278 (±0.0%) 343 ms (±0.0%) 23.64 MB (-0.2%) 14.11 MB (±0.0%) 100 ms (±0.0%) 1.03 MB (-3.6%) 108 KB (±0.0%)
poseidon2_4 529 (±0.0%) 535 (±0.0%) 343 ms (+1.0%) 23.86 MB (±0.0%) 14.31 MB (±0.0%) 100 ms (±0.0%) 1.02 MB (-2.5%) 31.67 KB (±0.0%)
poseidon2_8 363 (±0.0%) 423 (±0.0%) 347 ms (-1.9%) 24.66 MB (-0.2%) 14.50 MB (±0.0%) 100 ms (±0.0%) 1.03 MB (+0.1%) 365 KB (±0.0%)
poseidon_12 504 (±0.0%) 524 (±0.0%) 350 ms (-1.9%) 24.90 MB (+0.4%) 14.88 MB (±0.0%) 100 ms (±0.0%) 1.05 MB (-0.4%) 569 KB (±0.0%)
poseidon_16 609 (±0.0%) 633 (±0.0%) 350 ms (-2.8%) 25.02 MB (+0.4%) 15.16 MB (±0.0%) 100 ms (±0.0%) 1.04 MB (+2.8%) 717 KB (±0.0%)
poseidon_2 240 (±0.0%) 249 (±0.0%) 340 ms (-1.9%) 23.55 MB (+0.2%) 14.02 MB (±0.0%) 100 ms (±0.0%) 1.01 MB (-1.8%) 59.19 KB (±0.0%)
poseidon_4 297 (±0.0%) 309 (±0.0%) 350 ms (-0.9%) 24.20 MB (±0.0%) 14.50 MB (±0.0%) 100 ms (±0.0%) 1.04 MB (+0.3%) 332 KB (±0.0%)
poseidon_8 402 (±0.0%) 418 (±0.0%) 350 ms (±0.0%) 24.38 MB (-0.2%) 14.69 MB (±0.0%) 100 ms (±0.0%) 1.03 MB (+0.3%) 448 KB (±0.0%)
sha256_1024 196,940 (±0.0%) 339,764 (±0.0%) 2.20 s (-0.6%) 305 MB (-1.2%) 273 MB (±0.0%) 410 ms (-1.6%) 2.80 MB (-1.1%) 1.90 MB (+2.3%)
sha256_128 46,398 (±0.0%) 80,974 (±0.0%) 1.10 s (+0.9%) 101 MB (-0.5%) 83.41 MB (-0.2%) 260 ms (±0.0%) 2.54 MB (-0.2%) 514 KB (+1.8%)
sha256_2048 345,399 (±0.0%) 612,724 (±0.0%) 3.59 s (-0.4%) 548 MB (±0.0%) 484 MB (±0.0%) 593 ms (-1.7%) 3.01 MB (+2.8%) 3.01 MB (-0.9%)
sha256_256 67,904 (±0.0%) 117,944 (±0.0%) 1.39 s (-0.2%) 153 MB (+1.9%) 130 MB (-0.2%) 290 ms (±0.0%) 2.62 MB (-0.8%) 717 KB (+0.8%)
sha256_512 110,916 (±0.0%) 191,884 (±0.0%) 1.50 s (-1.1%) 181 MB (+1.1%) 158 MB (+0.4%) 320 ms (-2.1%) 2.70 MB (+1.1%) 1.12 MB (+0.3%)

Comment thread .github/workflows/ci.yml
The goldilocks_standalone job's fixtures step pulled provekit-fixtures,
whose dev-dependencies include both backends, so it compiled the entire
bn254 stack — defeating the 'standalone, no --all-features' intent and
slowing the job. Move both fixtures test steps into one shared job so the
standalone jobs stay pure backend build+test; field separation is still
enforced by the cargo-tree guard.
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