fix: clamp batch_invert range in logderivative computation to fix nightly debug build#22314
Closed
AztecBot wants to merge 1 commit into
Closed
fix: clamp batch_invert range in logderivative computation to fix nightly debug build#22314AztecBot wants to merge 1 commit into
AztecBot wants to merge 1 commit into
Conversation
…ive computation In compute_logderivative_inverse, the multi-threaded path splits work by circuit_size, but the inverse polynomial may have fewer actual elements due to virtual zero padding. The batch_invert call accessed coeffs()[start] where start could exceed the polynomial's actual size, triggering a _GLIBCXX_DEBUG span bounds assertion in the nightly debug build. Fix: clamp start/end to the polynomial's actual data range before batch_invert. Virtual zero elements need no inversion.
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Apr 6, 2026
…#22312) ## Summary Fixes nightly barretenberg debug build which crashes with SIGABRT (exit code 134) in test `AvmRecursiveTests.TwoLayerAvmRecursionFailsWithWrongPIs`. **Root cause:** In `compute_logderivative_inverse()`, the multi-threaded path splits work by `circuit_size`, but `inverse_polynomial.coeffs()` only covers the actual (non-virtual) data. When a thread chunk's `start` exceeds the polynomial's actual size, `coeffs()[start]` is out of bounds — caught by `_GLIBCXX_DEBUG`'s span bounds checking in the debug build preset. **Fix:** Clamp `start`/`end` to the polynomial's actual data range before `batch_invert`. Virtual zero elements need no inversion. Note: The `batch_invert` reserve→resize fix from the original PR #22312 is no longer needed as it was already applied on `next`. PR #22314 can be closed as duplicate.
Collaborator
Author
|
This issue was automatically closed because it was referenced in PR #22312 which has been merged to the default branch. |
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 barretenberg debug build which has been failing for 5+ consecutive nights with exit code 134 (SIGABRT).
Root cause: In
compute_logderivative_inverse(), the multi-threaded path splits work bycircuit_size, butinverse_polynomial.coeffs()only covers the actual (non-virtual) data. When a thread chunk'sstartexceeds the polynomial's actual size,coeffs()[start]is out of bounds — caught by_GLIBCXX_DEBUG's span bounds checking.Fix: Clamp
start/endto the polynomial's actual data range beforebatch_invert. Virtual zero elements need no inversion.Detailed analysis: https://gist.github.com/AztecBot/8f68f04f3d19414f42636111e9ee20b1
Verification
AvmVerifierTests.GoodPublicInputs: PASS (was SIGABRT)AvmRecursiveTests.TwoLayerAvmRecursionFailsWithWrongPIs: PASS (was SIGABRT)ultra_honk_tests(263),commitment_schemes_tests(88): no regressionClaudeBox log: https://claudebox.work/s/f5599f25d2226ffc?run=1