Aggregate-first follow-up: package single-shard roots and prune empty leaves - #599
Open
johnchandlerburnham wants to merge 7 commits into
Open
Aggregate-first follow-up: package single-shard roots and prune empty leaves#599johnchandlerburnham wants to merge 7 commits into
johnchandlerburnham wants to merge 7 commits into
Conversation
Add the deterministic lift/flat/structural activation matrix and keep dummy calls deferred. Split aggregate recursion commitment/FRI configuration from IxVM defaults, share it between proving and verification, and pin the future cache encoding without changing active protocol parameters.
Precompute versioned per-slot cache keys, persist lift and join wrappers in the content-addressed store, and reuse entries only after exact claim and native outer-proof verification. Add safe proof decoding, corruption recovery, and --no-cache.
Execute ready lift and join slots as a dependency DAG under explicit job and RAM admission. Add calibration-pending slot weights, failure draining, CLI controls, and serial/parallel scheduler and proof-equivalence gates.
Add an opt-in two-child benchmark that proves singleton CheckEnv shards, lifts both proofs, and measures a verified flat join. Wire join metrics through reporting and dashboards, and record the current pre-E2 lift-size baseline.
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.
Summary
This stacked PR implements WP-C from the aggregate-first follow-up plan. It
makes a one-nonempty-shard manifest a valid aggregate deliverable and removes
empty manifest leaves without changing the environment statement being proved.
The resulting pipeline now has a root for every nonempty manifest shape:
ix verify --aggregatealso learns how to reconstruct and verify the exactouter claim of a lift root. No self-join or padding proof is introduced.
Why
The aggregate-first implementation previously rejected both:
That made small environments and over-partitioned manifests unusable even
though the recursion schedule already represents a leaf as a lift. Padding a
single lift with a self-join would add work and manufacture a different claim
shape. The natural root of a singleton fold is the lift itself.
Empty leaves are similarly an artifact of partitioning, not part of the
CheckEnvstatement. Once raw manifest coverage proves that an empty leaf ownsno constant, removing it and contracting its parent cannot remove a checked
subject.
What changes
Validate first, then prune empty manifest leaves
IxesManifestViewnow retains the original shard id for every dense shardslot.
pruneEmpty:The aggregate and manifest-aware verifier paths deliberately call
shardsCoveron the raw manifest before this transformation. Coveragestill establishes that every environment constant is owned exactly once. The
subsequent zero count is therefore evidence that a removed leaf contributes no
subject; pruning is not allowed to hide a missing or duplicated constant.
Original shard ids are preserved separately from dense scheduling ids, so CLI
plans and proof-binding errors continue to identify the source manifest shard.
An all-empty manifest is rejected because it cannot produce a root.
For a tree node
node(left, right), pruning follows:Persist the lift for a single retained shard
ix aggregateno longer imposes a two-shard minimum. The existing fold planfor one retained leaf contains one lift slot and zero joins. That lift proof and
its
CheckEnvclaim are persisted directly as the aggregate wrapper.Consequences:
--plan-onlyreports1 lifts + 0 binary joinsfor a singleton;Reconstruct lift roots during aggregate verification
Aggregate verification now treats the root kind as one of
lift,flat, orstructural. For a bundledCheckEnvclaim, the verifier reconstructs thesingle-shard lift statement rather than trusting metadata from the wrapper:
The proof must verify against this exact outer claim under the locally rebuilt
recursion system. This binds the root to the pinned IxVM verifying key,
verify_claimindex, lift index, and bundledCheckEnvstatement.Verification modes are now:
ix verify --aggregate <proof>ix verify --aggregate --ixe E <proof>ix verify --aggregate --ixe E --ixes M <proof>The environment-only mode cannot reconstruct a manifest-relative structural
root, so it remains limited to the two roots whose statement is the canonical
environment root. Manifest-aware verification reproduces pruning and the fold
schedule, then checks exactly the resulting root kind.
Stop writing block-empty shards
The Rust
.ixeswriter now normalizes new manifests before serialization:The Lean-side pass remains necessary for legacy manifests and for the stronger
environment-relative condition: a shard may contain blocks yet own zero
constants after the environment is examined.
Audit structural-root acceptance
The small structural-root audit from §13 is folded into this change. There is
no Rust claim validator that requires a canonical
CheckEnv.root; the field isalready an opaque address. Stale comments now state that both canonical roots
and free-form
merkle_joinroots are valid protocol commitments, whileenv-derived builders continue to emit canonical roots.
A Rust round-trip test uses a genuinely noncanonical structural root and
asserts that it remains accepted by the claim codec.
CLI examples
A real one-shard manifest for
tc-parity.ixenow plans successfully:For a legacy manifest with empty leaves, aggregation reports the normalization
before printing the plan:
Soundness notes
hole or overlap.
removed.
leaves; dense remapping changes identifiers, not statements.
shortcut.
wrapper's
CheckEnvclaim and locally compiled protocol identities.selection instead of accepting a claimed proof kind.
consumer remains defensive for older or environment-empty records.
tree openings are required only by protocol paths that explicitly need them.
Tests and validation
The aggregate-first suite grows from 29 to 34 tests. New coverage includes:
CheckEnvroot.The following pass on this branch:
Code generation remains current:
The production-shaped one-shard
tc-parity.ixeCLI run above also passes rawcoverage, pruning, scheduling, and proof-count planning.
Review map
Ix/Cli/CheckCmd.leanIx/Cli/AggregateCmd.leanIx/Cli/VerifyCmd.leanTests/MultiStark.leancrates/kernel/src/shard.rscrates/kernel/src/claim.rs,crates/ixon/src/proof.rsScope and limits
should be reviewed against
jcb/aggregate-first.allowed-system encoding, FRI parameters, or generated bytecode.
terminal compression, or benchmark instrumentation; those remain separate
§13 work packages.
measurements project roughly 195 GiB peak memory for that proof. The real
manifest path was therefore exercised through
--plan-only; native liftreconstruction and proof verification are covered at smoke scale.