aiur: ground the FFT cost model in the prover's actual transforms - #539
Open
arthurpaulino wants to merge 1 commit into
Open
aiur: ground the FFT cost model in the prover's actual transforms#539arthurpaulino wants to merge 1 commit into
arthurpaulino wants to merge 1 commit into
Conversation
arthurpaulino
enabled auto-merge (squash)
August 5, 2026 22:52
The per-circuit FFT cost statistic (`Ix/Aiur/Statistics.lean`) was
`(stage1 + stage2 width) * h * log2(h)` over function and memory
circuits only. Compared against the pinned prover (multi-stark
`be1755e`, Plonky3 `e9d7561`), that misses:
- the quotient chunk columns: `q*D` committed base columns per circuit,
`q = next_pow2(max(d, 2) - 1)` — constraint-degree changes were
invisible to the statistic;
- the commit transform structure: `Radix2DitParallel::coset_lde_batch`
runs one size-h inverse DFT plus B size-h coset DFTs per column, not
one size-`B*h` DFT;
- the two quotient-rebasing transforms: the iDFT of the `(q*h) x D`
flattened quotient and the size-h DFT of the `q*D` coefficient
slices;
- the `Bytes1`/`Bytes2` gadget circuits, whose witness builders always
emit full tables (256 / 65536 rows with zero multiplicities on
unqueried rows), so they are active in every proof as a fixed cost.
The new per-circuit cost, with `F(0) = 0`, `F(x) = x*log2(max(x, 2))`,
and the raw (unpadded) height `h` so one-row changes stay visible while
structural powers of two (`B`, `q`) stay exact:
(B+1)*(m + s2 + q*D)*F(h) + D*F(q*h) + q*D*F(h)
summed over constrained functions, memories, `Bytes1`, and `Bytes2`.
Circuit shapes (main/stage-2 width, quotient degree, preprocessed
dimensions) are read off the compiled Rust `System` through a new
`AiurSystem::circuit_shapes` API and FFI — never re-derived in Lean,
since `max_constraint_degree` requires the compiled constraint graph.
`ix check` statistics use a one-shot build-extract-drop variant (that
flow never builds a system otherwise, and pays the build only when
stats are requested). The prove/verify/stats parameter triple is
deduplicated into `Aiur.defaultCommitmentParameters` /
`defaultFriParameters`.
The report now prints per-circuit costs in scientific notation
(two-decimal mantissa); the total stays in full digits with the
scientific form in parentheses.
A new `aiur-cost` primary suite covers the pure formula: exact values
at power-of-two heights, one-row monotonicity across power-of-two
boundaries (where the padded prover plateaus), per-input monotonicity
in width, lookups, quotient degree, and blowup, and the scientific
formatter (including the mantissa-carry edge). A Rust test pins
`circuit_shapes` against `System.circuits` field-for-field, including
canonical order and the fixed gadget table dimensions.
FFT pins regenerated from one `lake test -- --ignored ixvm` run (only
the FFT pin assertions moved; all execution/parity tests passed).
Small constants now sit on a ~174M fixed floor that is almost entirely
the always-active `Bytes2` commit: `5 * 32 * F(65536) ≈ 168M`.
arthurpaulino
force-pushed
the
ap/aiur-proving-cost
branch
from
August 6, 2026 10:55
c5ddc1a to
e16ae7f
Compare
Member
Author
|
!bencher-thresholds-reset aiur-check-prove aiur-check-execute aiur-recursive |
|
♻️ Baseline reset queued for: aiur-check-execute aiur-check-prove aiur-recursive — will anchor to the merge commit when this PR merges. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The per-circuit FFT cost statistic (
Ix/Aiur/Statistics.lean) was(stage1 + stage2 width) * h * log2(h)over function and memory circuits only. Compared against the pinned prover (multi-starkbe1755e, Plonky3e9d7561), that misses:q*Dcommitted base columns per circuit,q = next_pow2(max(d, 2) - 1)— constraint-degree changes were invisible to the statistic;Radix2DitParallel::coset_lde_batchruns one size-h inverse DFT plus B size-h coset DFTs per column, not one size-B*hDFT;(q*h) x Dflattened quotient and the size-h DFT of theq*Dcoefficient slices;Bytes1/Bytes2gadget circuits, whose witness builders always emit full tables (256 / 65536 rows with zero multiplicities on unqueried rows), so they are active in every proof as a fixed cost.The new per-circuit cost, with
F(0) = 0,F(x) = x*log2(max(x, 2)), and the raw (unpadded) heighthso one-row changes stay visible while structural powers of two (B,q) stay exact:summed over constrained functions, memories,
Bytes1, andBytes2.Circuit shapes (main/stage-2 width, quotient degree, preprocessed dimensions) are read off the compiled Rust
Systemthrough a newAiurSystem::circuit_shapesAPI and FFI — never re-derived in Lean, sincemax_constraint_degreerequires the compiled constraint graph.ix checkstatistics use a one-shot build-extract-drop variant (that flow never builds a system otherwise, and pays the build only when stats are requested). The prove/verify/stats parameter triple is deduplicated intoAiur.defaultCommitmentParameters/defaultFriParameters.The report now prints per-circuit costs in scientific notation (two-decimal mantissa); the total stays in full digits with the scientific form in parentheses.
A new
aiur-costprimary suite covers the pure formula: exact values at power-of-two heights, one-row monotonicity across power-of-two boundaries (where the padded prover plateaus), per-input monotonicity in width, lookups, quotient degree, and blowup, and the scientific formatter (including the mantissa-carry edge). A Rust test pinscircuit_shapesagainstSystem.circuitsfield-for-field, including canonical order and the fixed gadget table dimensions.FFT pins regenerated from one
lake test -- --ignored ixvmrun (only the FFT pin assertions moved; all execution/parity tests passed). Small constants now sit on a ~174M fixed floor that is almost entirely the always-activeBytes2commit:5 * 32 * F(65536) ≈ 168M.