Skip to content

feat: add gkr unified circuit#305

Open
yoaveshel wants to merge 25 commits into
av_gkr_compilerfrom
ye_unified_circuit
Open

feat: add gkr unified circuit#305
yoaveshel wants to merge 25 commits into
av_gkr_compilerfrom
ye_unified_circuit

Conversation

@yoaveshel

@yoaveshel yoaveshel commented May 21, 2026

Copy link
Copy Markdown

What ❔

  • New unified circuit (113 columns = 42 memory + 61 witness + 10 setup) + decoder trait infrastructure
  • Cross-family resource sharing: a shared base-layer scratch pool (bools + vars + RC-16 register, sized max across families, aliased per-row since dispatch is one-hot) + pooled lookups, gated by family exec masks. Enabled the SINGLE_COLUMN range-check merge node. Cuts witness columns 73→61.
  • 21 constraint-level negative tests + 4 proof-level (real-verifier) rejection tests + an inits/teardowns eval-corruption test; SLT/BLT/BGE table regression tests

Is this a breaking change?

  • Yes
  • No

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted.

yoaveshel and others added 15 commits May 12, 2026 12:48
Brings in the full-statement verifier fix (#297) and BabyBear field
perf optimisations (#300, plus the BabyBear inverse chain shortening).

Pulled changes:
- f97cab1 fix: full statement verifier works again (#297)
- 4e8d5ef perf(field): shorten BabyBear inverse chain from 40 to 37 ops
- a409a0b perf(field): flat-quartic E4 mul/sqr for riscv32 verifier (#300)

Conflict resolution:
- Code conflicts (Cargo.toml, prover/src/gkr/prover/mod.rs,
  prover/src/tests/gkr/family_circuits.rs, verifier/tests/corruption.rs,
  verifier_common/src/lib.rs, verifier_generator/src/gkr/mod.rs):
  auto-merged cleanly; verified that unified-circuit additions
  (UnifiedRiscvCircuitOracle, InitsAndTeardownsProduct propagation,
  corruption-test name suffix + canonicity probe fix) all preserved.
- Build break in circuit_defs/{trace_and_split,prover_examples}: the
  new `inline_inits_and_teardowns: Option<...>` parameter wasn't
  propagated; added `None` at four call sites.
- Generated artifacts (test_proofs/, tools/gkr_verifier/*.{bin,elf,text}):
  kept ours; will regenerate via gkr_test.sh.
- Stale flamegraph SVGs in verifier/: accepted origin's deletion
  (no longer tracked).

Pre-existing workspace errors in legacy STARK crates
(circuit_defs/unrolled_circuits/unified_reduced_machine STARK legacy,
gpu_witness_eval_generator, tools/pow_config_generator) are inherited
from origin/av_gkr_compiler and not on the GKR pipeline path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…_circuit

# Conflicts:
#	prover/test_proofs/add_sub_lui_auipc_mop_sec_80_gkr_proof.json
#	prover/test_proofs/inits_and_teardowns_sec_80_gkr_proof.json
#	prover/test_proofs/jump_branch_slt_sec_80_gkr_proof.json
#	prover/test_proofs/mem_subword_only_sec_80_gkr_proof.json
#	prover/test_proofs/mem_word_only_sec_80_gkr_proof.json
#	prover/test_proofs/shift_binop_sec_80_gkr_proof.json
#	tools/gkr_verifier/add_sub_lui_auipc_mop_sec_80.elf
#	tools/gkr_verifier/bigint_with_extended_control_sec_80.elf
#	tools/gkr_verifier/blake2_g_function_sec_80.elf
#	tools/gkr_verifier/blake2_with_extended_control_sec_80.elf
#	tools/gkr_verifier/inits_and_teardowns_sec_80.elf
#	tools/gkr_verifier/jump_branch_slt_sec_80.elf
#	tools/gkr_verifier/keccak_special5_sec_80.elf
#	tools/gkr_verifier/mem_subword_only_sec_80.elf
#	tools/gkr_verifier/mem_word_only_sec_80.elf
#	tools/gkr_verifier/shift_binop_sec_80.elf
#	verifier/gkr_flamegraph_add_sub_lui_auipc_mop_sec_80.svg
#	verifier/gkr_flamegraph_inits_and_teardowns_sec_80.svg
#	verifier/gkr_flamegraph_jump_branch_slt_sec_80.svg
#	verifier/gkr_flamegraph_mem_subword_only_sec_80.svg
#	verifier/gkr_flamegraph_mem_word_only_sec_80.svg
#	verifier/gkr_flamegraph_shift_binop_sec_80.svg
@yoaveshel yoaveshel requested review from mabbamOG and shamatar May 21, 2026 13:41
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.

1 participant