Skip to content

fix: clamp logderivative inverse range to fix nightly debug build OOB#22312

Merged
iakovenkos merged 1 commit intonextfrom
claudebox/fix-bb-debug-build
Apr 6, 2026
Merged

fix: clamp logderivative inverse range to fix nightly debug build OOB#22312
iakovenkos merged 1 commit intonextfrom
claudebox/fix-bb-debug-build

Conversation

@AztecBot
Copy link
Copy Markdown
Collaborator

@AztecBot AztecBot commented Apr 4, 2026

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.

@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels Apr 4, 2026
@AztecBot AztecBot force-pushed the claudebox/fix-bb-debug-build branch from f47dc94 to 46d1d71 Compare April 5, 2026 05:45
@AztecBot AztecBot changed the title fix: guard debug pairing point validation against off-curve points fix: guard debug-only pairing point validation and logderivative span OOB Apr 5, 2026
@AztecBot AztecBot force-pushed the claudebox/fix-bb-debug-build branch from 46d1d71 to 3da2230 Compare April 5, 2026 06:22
@AztecBot AztecBot changed the title fix: guard debug-only pairing point validation and logderivative span OOB fix: use resize instead of reserve in batch_invert to fix UB Apr 5, 2026
@AztecBot AztecBot force-pushed the claudebox/fix-bb-debug-build branch from 3da2230 to e2886cd Compare April 5, 2026 06:37
@AztecBot AztecBot changed the title fix: use resize instead of reserve in batch_invert to fix UB fix: resolve UB in batch_invert and logderivative OOB in debug builds Apr 5, 2026
@AztecBot AztecBot force-pushed the claudebox/fix-bb-debug-build branch 2 times, most recently from 09f9ec4 to 8b8ea8c Compare April 6, 2026 06:02
In compute_logderivative_inverse(), the multithreaded path partitions
work by circuit_size but inverse_polynomial.coeffs() can be smaller
than circuit_size (virtual zero elements). When a thread chunk's start
exceeds the polynomial's actual data size, coeffs()[start] is out of
bounds -- caught by _GLIBCXX_DEBUG's span bounds checking in the debug
build.

Fix: clamp start/end to the polynomial's actual data range before
calling batch_invert. Virtual zero elements need no inversion.
@AztecBot AztecBot changed the title fix: resolve UB in batch_invert and logderivative OOB in debug builds fix: clamp logderivative inverse range to fix nightly debug build OOB Apr 6, 2026
@AztecBot AztecBot force-pushed the claudebox/fix-bb-debug-build branch from 8b8ea8c to fc319eb Compare April 6, 2026 06:37
@iakovenkos iakovenkos marked this pull request as ready for review April 6, 2026 15:18
@iakovenkos iakovenkos enabled auto-merge April 6, 2026 15:18
@iakovenkos iakovenkos added this pull request to the merge queue Apr 6, 2026
@AztecBot
Copy link
Copy Markdown
Collaborator Author

AztecBot commented Apr 6, 2026

Flakey Tests

🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/1464ec921e75bbdd�1464ec921e75bbdd8;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_epochs/epochs_ha_sync.test.ts (63s) (code: 0) group:e2e-p2p-epoch-flakes

Merged via the queue into next with commit 5f080e9 Apr 6, 2026
28 checks passed
@iakovenkos iakovenkos deleted the claudebox/fix-bb-debug-build branch April 6, 2026 16:09
AztecBot added a commit that referenced this pull request Apr 7, 2026
In compute_logderivative_inverse(), the multi-threaded path splits work
by circuit_size, but inverse_polynomial.coeffs() only covers 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
span bounds checking in the debug build preset.

Clamp start/end to the polynomial's actual data range before batch_invert.
Virtual zero elements need no inversion.

Same fix as PR #22312 (merged to merge-train/barretenberg but not yet on next).
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.

3 participants