Skip to content

Migrate to lifted STARK backend#2798

Merged
adr1anh merged 26 commits intotracking-migration-workfrom
adr1anh/lifted-stark-v2-fixes
Mar 11, 2026
Merged

Migrate to lifted STARK backend#2798
adr1anh merged 26 commits intotracking-migration-workfrom
adr1anh/lifted-stark-v2-fixes

Conversation

@adr1anh
Copy link
Contributor

@adr1anh adr1anh commented Mar 6, 2026

Describe your changes

Checklist before requesting a review

  • Repo forked and branch created from next according to naming convention.
  • Commit messages and codestyle follow conventions.
  • Commits are signed.
  • Relevant issues are linked in the PR description.
  • Tests added for new functionality.
  • Documentation/comments updated according to changes.
  • Updated `CHANGELOG.md'

@adr1anh adr1anh changed the base branch from next to al-constraints-staging March 6, 2026 16:48
@Al-Kindi-0 Al-Kindi-0 marked this pull request as ready for review March 7, 2026 12:10
@Al-Kindi-0 Al-Kindi-0 changed the title Adr1anh/lifted stark v2 fixes Migrate to lifted STARK backend Mar 7, 2026
Copy link
Contributor Author

@adr1anh adr1anh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are mostly notes to myself to be stored either into small patches or issues to be addressed later.

@adr1anh adr1anh force-pushed the al-constraints-staging branch from 2fb2285 to 838a11c Compare March 9, 2026 14:18
@adr1anh adr1anh force-pushed the adr1anh/lifted-stark-v2-fixes branch from d01099e to c6909bb Compare March 9, 2026 14:18
Copy link
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may have misunderstood something re: public inputs.

adr1anh and others added 15 commits March 11, 2026 16:37
- Migrate ProcessorAir from LiftedAir to MidenAir trait with split impls
- Fix program_hash_message and kernel_proc_message to use alpha+beta
  encoding (was using old multi-alpha pattern causing index out of bounds)
- Fix periodic_columns to return actual hasher + bitwise columns
- Update ace-codegen builder and tests for new trait signatures
- Clean up unused imports across constraint files
- Update prove_verify integration tests for new prover API

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These tests fail with ProgramVerificationError due to a pre-existing
issue in the lifted STARK migration, not related to the trait refactor.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Verifier: replace `ProgramVerificationError(Word)` with
  `StarkVerificationError(Word, Box<config::VerificationError>)` to
  preserve the inner error instead of discarding it.
- Prover: replace `ProofSerializationError(String)` with
  `ProvingError(Box<config::ProvingError>)` for structured errors.
- Move `.map_err()` after the hash function match in both prover and
  verifier to reduce duplication.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move enforce_bus_balance after get_responses_at in the trait definition
to reflect its role as a debug-only assertion rather than a core method.

Add explicit implementations returning true for the 3 bus builders that
balance to identity (AuxTraceBuilder, BlockStackColumnBuilder,
OpGroupTableColumnBuilder), and reorder the method consistently across
all 6 implementors to appear after get_responses_at.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a public_inputs() method that returns PublicInputs directly,
and simplify to_public_values() to delegate to it. Update the prover
and integration tests to use trace.public_inputs() instead of manually
constructing PublicInputs::new(...).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add TODO comments in prove() and verify() noting that var_len_public_inputs
and the ACE commitment should be observed in the Fiat-Shamir transcript.
The var-len change also requires updating the recursive verifier.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace ace-codegen's custom RecordingAirBuilder and SymExpr/SymVar types
with plonky3's upstream SymbolicAirBuilder and SymbolicExpression types.
This aligns constraint capture with the canonical representation and
removes ~430 lines of duplicated symbolic algebra. Also updates
miden-crypto imports for the reorganized module layout (AirBuilder trait
changes, hasher/symmetric paths, prover/verifier submodules).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
adr1anh and others added 10 commits March 11, 2026 16:39
Adapt prove/verify to new API where transcript management is
internal to prove_single/verify_single.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the trace height validation into `config::verify` (the shared STARK
verification entry point) instead of the VM-specific verifier. Reject
proofs where `log_trace_height` exceeds the two-adic order of the
Goldilocks field (32). Also narrow the parameter type from `usize` to
`u32` to match `ExecutionProof::log_trace_height`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…2550

Replace `debug_assert_eq!` in `kernel_reduced_from_var_len` with a proper
runtime check that returns `ReductionError`, preventing panics on malformed
input in release builds. Add issue #2550 reference comments near bincode
serialize/deserialize calls in `config::prove` and `config::verify`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove the intermediary `row_major_adapter` module from the processor
crate. `AuxTraceBuilders` now implements the upstream `AuxBuilder` trait
directly, with row-major/column-major conversion inlined using p3's
cache-blocked transpose. Add `MainTrace::to_row_major()` for converting
back to row-major format.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Move `prove()` and error types from `air::config` into `prover` as
  `prove_stark()`, de-generified to use concrete `ProcessorAir` and
  `AuxTraceBuilders`
- Move `verify()` and error types from `air::config` into `verifier` as
  `verify_stark_proof()`
- Remove `log_trace_height` from `ExecutionProof`; instead serialize it
  alongside the STARK proof as a `(u8, StarkProof)` tuple via bincode
- Simplify `ExecutionError::ProvingError` to wrap a `String` instead of
  depending on `miden_air` error types
- Remove `bincode` and `serde` dependencies from `air` crate

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ProcessorAir previously stored periodic columns and the kernel
procedure count, requiring callers to pass it through prove/verify
functions. Since the AIR definition is fully determined at compile
time, these fields are unnecessary:

- Periodic columns are now generated inline in `periodic_columns()`
  instead of being cached.
- Kernel digests are flattened into a single `Vec<Felt>` slice
  (via `Word::words_as_elements`) rather than N separate `Word`
  slices, so `num_var_len_public_inputs()` always returns 1.
- `prove_stark` and `verify_stark_proof` no longer take an `air`
  parameter; they construct `ProcessorAir::default()` internally.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merge per-hash config modules into a single `air/src/config.rs` with
shared type aliases and parameterized factory functions. Update
miden-crypto to rev 87e63e6a9 and upgrade Plonky3 to 0.5.0 (crates.io).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@adr1anh adr1anh force-pushed the adr1anh/lifted-stark-v2-fixes branch from 2393234 to 5507b88 Compare March 11, 2026 16:09
Copy link
Contributor

@Al-Kindi-0 Al-Kindi-0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adr1anh adr1anh merged commit fc8ffbf into tracking-migration-work Mar 11, 2026
13 checks passed
@adr1anh adr1anh deleted the adr1anh/lifted-stark-v2-fixes branch March 11, 2026 17:10
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.

3 participants