pub struct SoundnessCalculator {
pub logup_bits: f64,
pub gkr_sumcheck_bits: f64,
pub gkr_batching_bits: f64,
pub zerocheck_sumcheck_bits: f64,
pub constraint_batching_bits: f64,
pub stacked_reduction_bits: f64,
pub whir_bits: f64,
pub whir_details: WhirSoundnessCalculator,
pub total_bits: f64,
}Fields§
§logup_bits: f64Security bits from LogUp α/β sampling and PoW.
gkr_sumcheck_bits: f64Security bits from ordinary GKR sumcheck rounds.
gkr_batching_bits: f64Security bits from GKR μ/λ batching per layer.
zerocheck_sumcheck_bits: f64Security bits from ZeroCheck sumcheck after the fused input-layer boundary.
constraint_batching_bits: f64Security bits from the fused GKR/ZeroCheck input boundary and constraint batching.
stacked_reduction_bits: f64Security bits from stacked reduction sumcheck.
whir_bits: f64Security bits from WHIR (minimum across all rounds and error sources).
whir_details: WhirSoundnessCalculatorDetailed WHIR soundness breakdown.
total_bits: f64Total security bits (minimum of all components).
Implementations§
Source§impl SoundnessCalculator
impl SoundnessCalculator
Sourcepub fn calculate(
params: &SystemParams,
base_field_order: f64,
challenge_field_bits: f64,
max_num_constraints_per_air: usize,
num_airs: usize,
max_constraint_degree: usize,
max_log_trace_height: usize,
num_trace_columns: usize,
num_stacked_columns: usize,
n_logup: usize,
) -> Self
pub fn calculate( params: &SystemParams, base_field_order: f64, challenge_field_bits: f64, max_num_constraints_per_air: usize, num_airs: usize, max_constraint_degree: usize, max_log_trace_height: usize, num_trace_columns: usize, num_stacked_columns: usize, n_logup: usize, ) -> Self
Calculates soundness for the given system parameters.
§Arguments
params- System parameters including WHIR config and LogUp parameters.base_field_order- Orderpof the base field thatsample_bitsreduces. For BabyBear:2^31 - 2^27 + 1. Used to charge thesample_bitssampling bias (query bad-set argument and proof-of-work).challenge_field_bits- Bits in the challenge field. For BabyBear4: ~124 bits.max_num_constraints_per_air- Maximum constraints in any single AIR.num_airs- Number of AIRs being batched.max_constraint_degree- Maximum degree of any constraint polynomial.max_log_trace_height- Maximum log₂(trace height) across all AIRs.num_trace_columns- Total columns batched in stacked reduction.num_stacked_columns- Total columns across all commitments (for WHIR μ batching).n_logup- GKR depth (log₂ of total interactions), or 0 if no interactions.proximity_regime- Unique decoding or other regimes (for WHIR-related calculations).
Sourcepub fn logup_soundness(
max_interaction_count: u32,
log_max_message_length: u32,
challenge_field_bits: f64,
log2_list_size: f64,
) -> f64
pub fn logup_soundness( max_interaction_count: u32, log_max_message_length: u32, challenge_field_bits: f64, log2_list_size: f64, ) -> f64
LogUp soundness from α/β sampling (before proof-of-work grinding).
- α: Random evaluation point to test whether Σ p(y)/q(y) = 0. If interactions are unbalanced, the sum is a non-zero rational function with a bounded number of roots. By Schwartz-Zippel, a random α detects this with high probability.
- β: Random challenge for compressing interaction messages into field elements. Degeneracy would allow distinct message tuples to collide.
Security = |F_ext| - log₂(2 × max_interaction_count) - log_max_message_length - log₂(L_PCS)
Proof-of-work grinding is an orthogonal amplification that callers add on top via
Self::effective_pow_bits. This is the single source of truth for the formula; SDK
parameter selection calibrates against it.
Reference: Section 4 of docs/Soundness_of_Interactions_via_LogUp.pdf
Sourcepub fn whir_proximity_gap_security(
proximity_regime: ProximityRegime,
challenge_field_bits: f64,
log_degree: usize,
log_inv_rate: usize,
batch_size: usize,
) -> ProximityGapSecurity
pub fn whir_proximity_gap_security( proximity_regime: ProximityRegime, challenge_field_bits: f64, log_degree: usize, log_inv_rate: usize, batch_size: usize, ) -> ProximityGapSecurity
Computes WHIR proximity gap security bits.
Per WHIR paper: err*(C, ℓ, δ) = (ℓ - 1) · 2^m / (ρ · |F|)
UniqueDecoding: Security bits = |F_ext| - log₂(ℓ - 1) - log₂(degree) - log₂(1/rate)ListDecoding { m }: Uses BCHKS25/TR25-169 Theorem 1.5 (contrapositive) to bound the “bad z set” size bya, with Haböck’s global extension introducing a linear factor(ℓ - 1).
Source§impl SoundnessCalculator
impl SoundnessCalculator
Sourcepub fn calculate_from_vk<SC: StarkProtocolConfig>(
vk: &MultiStarkVerifyingKey<SC>,
) -> Self
pub fn calculate_from_vk<SC: StarkProtocolConfig>( vk: &MultiStarkVerifyingKey<SC>, ) -> Self
Computes a conservative soundness estimate for the verifier defined by the given vk.
The verifying key does not fix a single proof shape: optional AIRs may be absent and trace heights can vary within verifier-enforced bounds. This function therefore uses verifier-side upper bounds derived from the key.
Trait Implementations§
Source§impl Clone for SoundnessCalculator
impl Clone for SoundnessCalculator
Source§fn clone(&self) -> SoundnessCalculator
fn clone(&self) -> SoundnessCalculator
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SoundnessCalculator
impl RefUnwindSafe for SoundnessCalculator
impl Send for SoundnessCalculator
impl Sync for SoundnessCalculator
impl Unpin for SoundnessCalculator
impl UnsafeUnpin for SoundnessCalculator
impl UnwindSafe for SoundnessCalculator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more