Skip to content

fix(bb): push missing q_5 in QArith3Gate test to unbreak nightly debug build#23229

Merged
federicobarbacovi merged 3 commits into
merge-train/barretenbergfrom
claudebox/fix-nightly-bb-debug-build
May 14, 2026
Merged

fix(bb): push missing q_5 in QArith3Gate test to unbreak nightly debug build#23229
federicobarbacovi merged 3 commits into
merge-train/barretenbergfrom
claudebox/fix-nightly-bb-debug-build

Conversation

@AztecBot
Copy link
Copy Markdown
Collaborator

Why

The nightly Barretenberg debug build (Nightly Debug Build workflow, run 25781836067) on next @ 2b1d9cf22d failed in circuit_checker_tests:

[ RUN      ] UltraCircuitBuilderArithmetic.QArith3Gate
C++ exception with description "Assertion failed: (block_selectors[idx].size() == nominal_size)
  Actual  : 1
  Expected: 2" thrown in the test body.
[  FAILED  ] UltraCircuitBuilderArithmetic.QArith3Gate

CI log: http://ci.aztec-labs.com/e0ba10c734d2dd7b

The assertion fires inside UltraCircuitBuilder_::check_selector_length_consistency (stdlib_circuit_builders/ultra_circuit_builder.hpp), which is gated by #if NDEBUG ... #else and so runs only in debug builds — that's why no other CI mode caught it.

QArith3Gate builds two arithmetic gates manually by pushing each selector individually. Every in-tree gate constructor (create_arithmetic_gate, fix_witness, create_add_gate, etc.) follows q_4().emplace_back(...) with q_5().emplace_back(0); this test was the only manual-construction site that omitted the q_5 push.

Pre-merge-train, the consistency check used a per-flavour curated get_selectors() for UltraTraceArithmeticBlock that did not include q_5, so the omission was invisible. PR #23137 (feat: merge-train/barretenberg) refactored ExecutionTraceBlock so get_selectors() returns non_gate_selectors (7 entries including q_5) concatenated with gate_selectors, expanding the consistency check to cover q_5. The test has been silently broken w.r.t. the new check ever since that landed last night.

What

Add the missing builder.blocks.arithmetic.q_5().emplace_back(0) to both manually-constructed gates in QArith3Gate, matching the existing convention.

Verification

cd barretenberg/cpp
rm -rf build-debug
AVM=0 AVM_TRANSPILER=0 cmake --preset debug -DAVM=OFF
cmake --build build-debug --target circuit_checker_tests
./build-debug/bin/circuit_checker_tests --gtest_filter='UltraCircuitBuilderArithmetic.QArith3Gate'
# -> [       OK ] UltraCircuitBuilderArithmetic.QArith3Gate

Full circuit_checker_tests (79 tests) and a sanity-run of polynomials_tests, common_tests, relations_tests all pass after the fix.

Full analysis: https://gist.github.com/AztecBot/74d9233cda80ad6c3108d670a019afea

ClaudeBox log: https://claudebox.work/s/3064b2e43c917621?run=1

ClaudeBox log: https://claudebox.work/s/3064b2e43c917621?run=1

@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels May 13, 2026
@iakovenkos iakovenkos changed the base branch from next to merge-train/barretenberg May 13, 2026 10:47
@iakovenkos iakovenkos marked this pull request as ready for review May 13, 2026 10:48
@federicobarbacovi federicobarbacovi merged commit 632f6ee into merge-train/barretenberg May 14, 2026
14 checks passed
@federicobarbacovi federicobarbacovi deleted the claudebox/fix-nightly-bb-debug-build branch May 14, 2026 09:33
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