Skip to content

fix: bounds check in GateSeparatorPolynomial for virtual sumcheck rounds#22146

Draft
AztecBot wants to merge 1 commit intomerge-train/barretenbergfrom
claudebox/nightly-debug-build-failure
Draft

fix: bounds check in GateSeparatorPolynomial for virtual sumcheck rounds#22146
AztecBot wants to merge 1 commit intomerge-train/barretenbergfrom
claudebox/nightly-debug-build-failure

Conversation

@AztecBot
Copy link
Copy Markdown
Collaborator

Summary

Ports the fix from #22130 (targeting next) to merge-train/barretenberg.

GateSeparatorPolynomial::current_element() and univariate_eval() accessed betas[current_element_idx] without bounds checking. During virtual sumcheck rounds (when current_element_idx >= betas.size()), this read out-of-bounds heap memory, causing non-deterministic debug build assertion failures:

Assertion failed: (val < twice_modulus)
Reason: field element exceeds coarse form [0, 2p)

The fix returns FF(1) when past the betas array, which is mathematically correct since virtual rounds have no additional beta challenges.

Full analysis: https://gist.github.com/AztecBot/909e3998f506b0dd6d07a211841dbeb8

ClaudeBox log: https://claudebox.work/s/39dda16ff88b644f?run=1

@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant