fix(bb): pad gemini_masking_poly size to even to avoid sumcheck OOB#22892
Draft
fix(bb): pad gemini_masking_poly size to even to avoid sumcheck OOB#22892
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.
Summary
Fixes the nightly debug-build failure of
HonkRecursionConstraintTestWithoutPredicate/1.GenerateVKFromConstraints, which has been failing every night since 2026-04-22.Root cause
Introduced by #22334 (top-of-trace masking),
OinkProver::commit_to_masking_polyallocatesgemini_masking_polyatmax_end_index()instead of the dyadic size. For this test,max_end_index() = 4135(odd).Sumcheck's
compute_effective_round_sizeroundsmax_end_indexup to the next even number (4136) so its pairwise(edge_idx, edge_idx+1)iteration is well-formed. This causes a read ofgemini_masking_poly[4135], one past its allocation. In release buildsSharedShiftedVirtualZeroesArray::getreturns 0 for OOB and the spurious read is harmless. With-D_GLIBCXX_DEBUGand activeBB_ASSERTs, the nightly debug preset tripsBB_ASSERT(index < virtual_size_ + virtual_padding).ECCVM and Translator allocate their masking polynomials at
circuit_size(a power of two), so they were unaffected.Fix
Match sumcheck's even rounding when allocating the masking polynomial:
This is the same change proposed in #22789 (auto-closed for staleness).
Verification
Failing nightly run: https://github.com/AztecProtocol/aztec-claude/actions/runs/25204419411
Detailed analysis: https://gist.github.com/AztecBot/539dcf1fe5bf600319f08d19c883285d
ClaudeBox log: https://claudebox.work/s/22d70e3e00df70b6?run=1