fix(bb): pad gemini_masking_poly size to even to avoid sumcheck OOB#22914
Closed
AztecBot wants to merge 1 commit into
Closed
fix(bb): pad gemini_masking_poly size to even to avoid sumcheck OOB#22914AztecBot wants to merge 1 commit into
AztecBot wants to merge 1 commit into
Conversation
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.
Problem
Nightly debug build (
./.github/workflows/barretenberg-nightly-debug-build.yml) has been failing every night since 2026-04-22 — 12+ consecutive failures. Today's run: https://github.com/AztecProtocol/aztec-packages/actions/runs/25271523932.OinkProver<Flavor>::commit_to_masking_polyallocates the Gemini masking polynomial at exactlymax_end_index(), which can be odd:Sumcheck's
compute_effective_round_sizerounds up to the next even number:extend_edgesthen iterates pairwise(edge_idx, edge_idx + 1)over[0, effective). Whenmax_end_indexis odd, the final pair touches index== max_end_index, which is one past the masking poly'svirtual_size.SharedShiftedVirtualZeroesArray::getreturns the static zero in release (well-defined), but tripsBB_ASSERT_DEBUGin the nightly debug build — the assertion that fails today isHonkRecursionConstraintTestWithoutPredicate.GenerateVKFromConstraints(called out by name in #22811's workaround).Fix
Match the rounding
compute_effective_round_sizealready does: pad the masking poly size up to the next even number before allocation.Now sumcheck's pairwise iteration stays inside the polynomial's virtual size and the debug assertion no longer trips.
Note: this is a duplicate of #22892
This change is byte-identical to PR #22892, which has been open for two days without review. Re-opening to keep the fix on reviewers' radar — every additional day this sits unmerged is another red nightly. If #22892 is merged first, please close this PR.
Related open fix attempts for the same root cause (please pick one and merge):
BB_DISABLE_ASSERTS()workaround in the failing testPolynomial<FF>::random(size, dyadic_size, /*start_index=*/0)Full analysis: https://gist.github.com/AztecBot/9eefc859e8d7596f8edb92251fd286d5
ClaudeBox log: https://claudebox.work/s/9ac1beea695c0227?run=1
ClaudeBox log: https://claudebox.work/s/9ac1beea695c0227?run=1