Skip to main content

Crate miden_ace_codegen

Crate miden_ace_codegen 

Source
Expand description

ACE circuit codegen for Plonky3-based Miden AIRs.

The pipeline is:

  1. Capture AIR constraints via the SymbolicAirBuilder.
  2. Lower symbolic expressions into a DAG that mirrors verifier constraints evaluation.
  3. Emit an ACE circuit plus an InputLayout describing the MASM ACE-READ section order.

The resulting circuit is intended to run inside the recursive verifier. All input layout decisions (point-major OOD ordering, aux/quotient coords, and alpha/beta randomness expansion) are centralized in this crate so tests can validate both layout and evaluation.

Quick start:

use miden_ace_codegen::{AceConfig, LayoutKind, build_ace_circuit_for_air};
use miden_air::ProcessorAir;
use miden_core::{Felt, field::QuadFelt};

let config = AceConfig { num_quotient_chunks: 8, num_vlpi_groups: 1, layout: LayoutKind::Masm };
let circuit = build_ace_circuit_for_air::<_, Felt, QuadFelt>(&ProcessorAir, config)?;

Module map (data flow):

  • pipeline: public entry points that orchestrate layout + DAG + circuit emission.
  • dag: verifier-style DAG IR and lowering helpers.
  • circuit: off-VM circuit representation (inputs/constants/ops/root).
  • layout: READ-section layout and index mapping.
  • encode: ACE stream encoding + padding rules.
  • randomness: challenge input planning for layouts + DAG lowering.
  • quotient: barycentric quotient recomposition helpers (used by DAG + tests).

Modules§

testing
Test helpers for ACE codegen, available under the testing feature or #[cfg(test)].

Structs§

AceArtifacts
Output of the ACE codegen pipeline (layout + DAG).
AceCircuit
Emitted ACE circuit with layout and operation list.
AceConfig
Configuration for building an ACE DAG and its input layout.
AceDag
A built DAG with a designated root.
DagBuilder
A hash-consed DAG builder.
DagSnapshot
Exported DAG data that preserves the source DAG id across imports.
EncodedCircuit
Encoded ACE circuit ready for chiplet consumption.
InputCounts
Counts needed to build the ACE input layout.
InputLayout
ACE input layout for Plonky3-based verifier logic.
NodeId
Identifier for a node in the DAG.

Enums§

AceError
Errors returned by ACE codegen.
InputKey
Logical inputs required by the ACE circuit.
LayoutKind
Layout strategy for arranging ACE inputs.
NodeKind
Node kinds in the DAG.

Constants§

EXT_DEGREE
Extension field degree (quadratic extension for Miden VM).

Functions§

build_ace_circuit_for_air
Build a verifier-equivalent ACE circuit for the provided AIR.
build_ace_dag_for_air
Build a verifier-equivalent DAG and layout for the provided AIR.
emit_circuit
Emit an ACE circuit from the DAG and input layout.