Add the factored precompile VM ACE registry - #3465
Open
Al-Kindi-0 wants to merge 1 commit into
Open
Conversation
Al-Kindi-0
force-pushed
the
al/pvm-ace-registry-pr2
branch
from
August 5, 2026 22:29
b97b1cf to
9cc7966
Compare
- factor multi-AIR ACE circuits into per-order and shared sections - add reusable order tagging, packed leaf hashing, and path authentication - mint the 10-chiplet PVM registry over all 10! proof orders - bind the registry root into the PVM relation digest - serve one authenticated subtree path per proof
Al-Kindi-0
force-pushed
the
al/pvm-ace-registry-pr2
branch
from
August 6, 2026 06:14
9cc7966 to
8b8c952
Compare
Al-Kindi-0
marked this pull request as ready for review
August 6, 2026 12:08
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 recursive verifier must use the ACE circuit matching the proof's height-sorted AIR order. With ten AIRs there are
10! = 3,628,800valid orders, so checking in every circuit commitment or rebuilding the complete registry for each proof is impractical.This PR makes the registry compact to store and cheap to serve while retaining exhaustive checks over every proof order.
How it works
Each ACE circuit is split into a short order-dependent prefix and a larger common section:
The factory builds the common circuit once, caches its commitment and the sponge state after the constants, and then emits only the shuffle section for each order. When a protocol change requires minting a new registry from scratch, this reduces the offline leaf-and-root construction phase from 169 seconds with per-order assembly to 58 seconds with the factored encoder (2.9x). Packed hashing and the final two-tier layout reduce that phase further to 37.6 seconds on M4 NEON. None of this full-registry work is performed at process startup or while serving a proof.
The complete tree has
2^22slots. Instead of checking in its 3.6 million active leaves, the repository stores 4,096 authenticated subtree roots. The complete registry is rebuilt only by the maintenance tool; normal proof serving never performs that work. A serving process authenticates the checked-in row and builds the circuit factory once, then reconstructs only the selected 1,024-leaf subtree for each proof.The regeneration tool has two roles:
--checkrecomputes the complete registry, checks the fast shuffle encoding against full circuit assembly for every order, and compares the result with the checked-in artifacts.--writeis the rarer minting path. Before replacing protocol constants, it compares every packed leaf with the scalar commitment obtained from fully assembling that order's circuit.The Miden VM registry moves to the same factored commitment format. Registry roots and relation digests change, so recursive-proof artifacts created with the previous format are incompatible.
Factoring adds an order-dependent shuffle section. This PR also applies a conservative DAG normalization pass that retains only circuit-shrinking rewrites while preserving evaluation. The net size change at this branch tip is:
Unlike full-registry minting, this extra work is paid when a recursive verifier loads and evaluates the circuit. If end-to-end profiling shows that cost is material, a follow-up can retain the two-tier registry while investigating unfactored per-order circuits and a different strategy for constructing or serving their authenticated subtrees.
Performance
All figures below use release mode on M4 NEON. The full-registry figures are offline maintenance costs, not per-proof costs:
concurrent. The default single-threadedstdpath takes 106.0 ms warm.Circuit generation and validation dominate these measurements. Building the Merkle subtrees is less than 1% of the full construction cost.