feat: add protocol support for list decoding regime#272
Open
jonathanpwang wants to merge 15 commits intodevelop-v2from
Open
feat: add protocol support for list decoding regime#272jonathanpwang wants to merge 15 commits intodevelop-v2from
jonathanpwang wants to merge 15 commits intodevelop-v2from
Conversation
eason1981
pushed a commit
to eason1981/stark-backend
that referenced
this pull request
Feb 20, 2026
4e05324 to
e839523
Compare
jpw-axiom
pushed a commit
that referenced
this pull request
Feb 28, 2026
c800aad to
66f4b30
Compare
jonathanpwang
commented
Mar 7, 2026
| let log_degree_at_round_start = current_log_degree + k_whir; | ||
| let ood_bits = | ||
| Self::whir_ood_security(challenge_field_bits, log_degree_at_round_start); | ||
| // This is OOD sample on f_i for the *next* round `i = round + 1` after folding. So |
jonathanpwang
commented
Mar 7, 2026
| /// Security bits = |F_ext| - log_degree + 1 | ||
| fn whir_ood_security(challenge_field_bits: f64, log_degree_at_round_start: usize) -> f64 { | ||
| challenge_field_bits - log_degree_at_round_start as f64 + 1.0 | ||
| /// OOD error is 2^{m_i - 1} ℓ^2 / |F| where m_i is the log_degree at the start of WHIR round |
Contributor
Author
There was a problem hiding this comment.
make sure to check this - I had it wrong in a previous version
jonathanpwang
commented
Mar 7, 2026
| min_sumcheck_bits = min_sumcheck_bits.min(sumcheck_bits); | ||
|
|
||
| // Theorem 5.2: ε_fold = d * ℓ / |F| + err*. | ||
| let fold_rbr_bits = Self::combine_security_bits(sumcheck_bits, prox_gaps_bits); |
Contributor
Author
There was a problem hiding this comment.
the theorem states these combined, not a separate RBR errors
jonathanpwang
commented
Mar 7, 2026
| // Theorem 5.2 / Claim 5.4: ε_shift = (1 - δ)^t + ℓ * (t + 1) / |F|. The implementation | ||
| // keeps the same additive structure, with the final round batching only the query | ||
| // claims. | ||
| let shift_rbr_bits = Self::combine_security_bits(query_bits, gamma_batching_bits); |
Contributor
Author
There was a problem hiding this comment.
Theorem states them combined
dcad20b to
57e352d
Compare
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.
Closes INT-5791
PR: WHIR List Decoding Regime & Round-by-Round Soundness
Overview
Adds list decoding support to the WHIR proximity gap analysis, implements the BCHKS25/TR25-169 Theorem 1.5 bounds, restructures soundness accounting to use round-by-round (RBR) error composition, and provides documented production parameter presets in
stark-sdk.Previously, only unique decoding was supported (list size
l = 1). This PR generalizes all soundness components to account forl > 1, propagating the list size through every Schwartz-Zippel and batching bound.1.
WhirProximityStrategyandProximityRegime(stark-backend/src/config.rs)New enum:
WhirProximityStrategycontrols which proximity regime each WHIR round uses:UniqueDecodingSplitUniqueList { m, list_start_round }< list_start_round, then list decoding with multiplicitymListDecoding { m }min every roundProximityRegime(per-round) gains aListDecoding { m }variant. Thewhir_query_security_bitsmethod now uses the Johnson boundsqrt(rho * (1 + 1/m))for list decoding max agreement instead of(1 + rho) / 2(unique decoding).WhirParamsexpanded with three new fields (previously hardcoded constants):folding_pow_bits-- grinding bits per folding stepmu_pow_bits-- grinding bits for the mu batching challengeproximity: WhirProximityStrategyThese are also stored on
WhirConfigso the soundness calculator can access them.2. BCHKS25 Proximity Gap Bounds (
stark-backend/src/soundness.rs)whir_proximity_gap_securitynow returnsProximityGapSecurity { log2_err, log2_list_size }instead of a singlef64.For
ListDecoding { m }:log2(a)from BCHKS25 Lemma 3.1 / Equation (13) using degree parametersD_X, D_Y, D_Z.bchks25_reference_log2_degrees.soundness-bchks25-optimized) searches for tighter(D_X, D_Y, D_Z)that still satisfy all proof conditions (Equation 11n_vars > n_eqs,D_X >= k*D_Y,D_Z >= D_Y, Section 3.2 precondition).Brute-force module (
bchks25_brute_force_params, behind feature flag)D_Yfrommax(1, m-1)up to a scaled reference upper bound.D_Y, samples candidateD_Xvalues (basek*D_Y, near the slope crossover, and a coarse grid up to the Section 3.2 limit).D_Zvia the closed-form linear inequalityA_v*(d_z+1) - B_v > A_e*(d_z+1) - B_e.(D_X, D_Y, D_Z)minimizinglog2(a).3. Round-by-Round Soundness Restructuring (
stark-backend/src/soundness.rs)WhirSoundnessCalculatorfields restructured to reflect the WHIR paper's Theorem 5.2 / Claim 5.4 error composition:query_bitsquery_bits(detail)proximity_gaps_bitsproximity_gaps_bits(detail)sumcheck_bitssumcheck_bits(detail)ood_bitsood_rbr_bitsl^2factor: `gamma_batching_bitsgamma_batching_bits(detail)fold_rbr_bitsmin_round(combine(sumcheck, prox_gaps))-- per Theorem 5.2epsilon_foldshift_rbr_bitsmin_round(combine(query, gamma))-- per Claim 5.4epsilon_shift/epsilon_finmu_batching_bitsOverall WHIR security is now
min(mu_batching, fold_rbr, ood_rbr, shift_rbr)instead ofmin(each_component_independently).List size propagation
All non-WHIR Schwartz-Zippel bounds now add
log2_list_size(from the initial round's proximity gap) to their security:calculate_logup_soundnesscalculate_zerocheck_sumcheck_soundnesscalculate_constraint_batching_soundnesscalculate_stacked_reduction_soundnessThe
SoundnessCalculator::calculatesignature drops theproximity_regime: ProximityRegimeparameter (now read fromparams.whir.proximity).4. Production Parameter Presets (
stark-sdk/src/config/mod.rs)New public functions defining documented production configurations:
app_params_with_100_bits_security(log_stacked_height)l_skip=4, log_blowup=1, w_stack=2048, SplitUniqueList{m:2, start:1}, fold_pow=20, mu_pow=15leaf_params_with_100_bits_security()l_skip=2, n_stack=18, log_blowup=2, w_stack=1024, SplitUniqueList{m:3, start:1}, fold_pow=20, mu_pow=13internal_params_with_100_bits_security()l_skip=2, n_stack=17, log_blowup=2, w_stack=1024, SplitUniqueList{m:3, start:1}, fold_pow=20, mu_pow=13compression_params_with_100_bits_security()l_skip=2, n_stack=20, log_blowup=4, w_stack=16, ListDecoding{m:1}, fold_pow=20, mu_pow=20Each function has a doc comment listing the circuit parameter upper bounds (max AIRs, constraints, trace columns, etc.) under which 100-bit security is proven.
SystemParams::new(...)constructor added for building params from these primitives (hardcodesk_whir=4,max_constraint_degree=4,query_phase_pow_bits=20).5. Production Soundness Tests Moved to Integration Test (
stark-backend/tests/soundness.rs)The production configuration tests (
test_app_vm_security,test_leaf_aggregation_security, etc.) were moved from unit tests insoundness.rsto a new integration test file. This avoids a circular dependency: these tests now import the preset functions fromstark-sdkrather than duplicating the parameter definitions.6. Example Simplification (
stark-sdk/examples/keccakf.rs,cuda-backend/examples/keccakf.rs)Both keccakf examples replace ~20 lines of manual
SystemParams/WhirConfigconstruction with a single call toapp_params_with_100_bits_security(21).7. Bug Fixes (from earlier commits in the branch)
m_i(log degree after folding, i.e., at the start of the next round) instead ofm_i + k(log degree before folding).list_size * tinstead oft - 1to match Theorem 5.6.