Skip to main content

Crate openvm_backend_tests

Crate openvm_backend_tests 

Source
Expand description

Shared test suite for STARK backend implementations.

This crate provides generic test functions that can be used to verify any StarkEngine implementation against the BabyBearPoseidon2 configuration.

§Usage

The easiest way to use this crate is via the backend_test_suite! macro, which generates the complete shared test suite with a single invocation:

openvm_backend_tests::backend_test_suite!(MyEngine);

Individual test functions can also be called directly for custom wrappers:

#[test]
fn test_proof_shape_verifier() {
    openvm_backend_tests::proof_shape_verifier::<MyEngine>().unwrap();
}

§Adding New Tests

  1. Add a pub fn here (with E: StarkEngine<SC = SC> bound for engine-generic tests).
  2. Add the test to the backend_test_suite! macro.
  3. Each backend automatically picks it up on next build.

Macros§

backend_test_suite
Generate the complete shared backend test suite for the given engine type.

Functions§

batch_constraints_with_interactions
batch_sumcheck_zero_interactions
batch_sumcheck_zero_interactions_malleable_q0
Negative test: with zero interactions, a gkr_proof.q0_claim != EF::ONE must cause verify_zerocheck_and_logup to reject with InvalidZeroRoundValue.
cached_trace_roundtrip
dummy_interactions_roundtrip
fib_air_roundtrip
fold_double
Test binary k-fold operation with k=2.
fold_single
Test binary k-fold operation with k=1.
generate_random_z
Generate random evaluation points for WHIR tests.
gkr_verify_zero_interactions
interaction_all_zero_sender
interaction_cached_trace_neg
interaction_multi_rows_neg
interaction_multi_sender_receiver
interaction_multi_senders
interaction_multi_senders_neg
interaction_trace_height_constraints
interactions_single_sender_receiver_happy
matrix_stacking_overflow
mixture_traces_stark
multi_interaction_traces_stark
optional_air
preprocessed_and_cached_trace_roundtrip
preprocessed_trace_roundtrip
proof_shape_verifier
proof_shape_verifier_rng_system_params
run_test_on_cpu_ctx
Generic version of StarkEngine::run_test that accepts CPU-side contexts and handles device transport automatically.
single_cached_trace_stark
single_fib_and_dummy_trace_stark
single_preprocessed_trace_stark
stacking_openings_for_matrix
Compute stacking openings for a single matrix at the given evaluation point.
trace_height_constraints_implied_removal
vkey_methods
whir_multiple_commitments
Test CPU WHIR prover + verifier with 5 randomly generated commitments.
whir_multiple_commitments_negative
Soundness test: verify that WHIR correctly rejects tampered openings.
whir_single_fib
Test CPU WHIR prover + verifier with a single Fibonacci commitment under varying stacking and folding parameters.
whir_test_config
Build a WhirConfig with 2 rounds for multi-commitment WHIR tests.

Type Aliases§

SC