Skip to content

fix: clamp logderivative inverse range to prevent OOB in debug builds#22346

Closed
AztecBot wants to merge 1 commit into
nextfrom
claudebox/fix-bb-debug-build
Closed

fix: clamp logderivative inverse range to prevent OOB in debug builds#22346
AztecBot wants to merge 1 commit into
nextfrom
claudebox/fix-bb-debug-build

Conversation

@AztecBot

@AztecBot AztecBot commented Apr 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes nightly barretenberg debug build which has been failing for 5+ consecutive nights with SIGABRT (exit code 134).

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.

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

This is the same fix as #22312 (merged to merge-train/barretenberg but not yet promoted to next), applied directly to next so the nightly build stops failing.

Detailed analysis: https://gist.github.com/AztecBot/0e19941f5ef42d43f6f9bda3cb270aac

ClaudeBox log: https://claudebox.work/s/96869bdf3aa3b332?run=1

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).
@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels Apr 7, 2026
federicobarbacovi pushed a commit that referenced this pull request Apr 7, 2026
…22347)

## Summary
Fixes nightly barretenberg debug build failure (CI run
https://github.com/AztecProtocol/aztec-packages/actions/runs/24066248159).

**Root cause:**
`HonkRecursionConstraintTestWithoutPredicate/2.GenerateVKFromConstraints`
(root rollup circuit, the heaviest test variant) timed out at 601s
against the 600s default timeout. Exit code 124.

**Fix:**
- Bump timeout from 600s to 900s for `HonkRecursionConstraintTest` and
`ChonkRecursionConstraintTest` suites
- Add `ChonkRecursionConstraintTest` to the CPUS=4:MEM=8g resource group

Several other tests in these suites are also close to the 600s limit
(503s, 519s), so this prevents future timeouts as debug build overhead
grows.

**Note:** PR #22346 (from earlier session) is a no-op — the
logderivative fix it applies already exists on `next` via
merge-train/barretenberg (#22324). The actual failure was this timeout.

ClaudeBox log: https://claudebox.work/s/5f7d3bb56d7d756f?run=1
critesjosh pushed a commit that referenced this pull request Apr 14, 2026
…22347)

## Summary
Fixes nightly barretenberg debug build failure (CI run
https://github.com/AztecProtocol/aztec-packages/actions/runs/24066248159).

**Root cause:**
`HonkRecursionConstraintTestWithoutPredicate/2.GenerateVKFromConstraints`
(root rollup circuit, the heaviest test variant) timed out at 601s
against the 600s default timeout. Exit code 124.

**Fix:**
- Bump timeout from 600s to 900s for `HonkRecursionConstraintTest` and
`ChonkRecursionConstraintTest` suites
- Add `ChonkRecursionConstraintTest` to the CPUS=4:MEM=8g resource group

Several other tests in these suites are also close to the 600s limit
(503s, 519s), so this prevents future timeouts as debug build overhead
grows.

**Note:** PR #22346 (from earlier session) is a no-op — the
logderivative fix it applies already exists on `next` via
merge-train/barretenberg (#22324). The actual failure was this timeout.

ClaudeBox log: https://claudebox.work/s/5f7d3bb56d7d756f?run=1
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.

2 participants