Skip to content

Commit 632f6ee

Browse files
AztecBotiakovenkosfedericobarbacovi
authored
fix(bb): push missing q_5 in QArith3Gate test to unbreak nightly debug build (#23229)
## Why The nightly Barretenberg debug build (`Nightly Debug Build` workflow, run [25781836067](https://github.com/AztecProtocol/aztec-packages/actions/runs/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 Co-authored-by: sergei iakovenko <105737703+iakovenkos@users.noreply.github.com> Co-authored-by: federicobarbacovi <171914500+federicobarbacovi@users.noreply.github.com>
1 parent d8f7e77 commit 632f6ee

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

barretenberg/cpp/src/barretenberg/circuit_checker/ultra_circuit_builder_arithmetic.test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ TEST_F(UltraCircuitBuilderArithmetic, QArith3Gate)
549549
builder.blocks.arithmetic.q_2().emplace_back(q_2);
550550
builder.blocks.arithmetic.q_3().emplace_back(q_3);
551551
builder.blocks.arithmetic.q_4().emplace_back(q_4);
552+
builder.blocks.arithmetic.q_5().emplace_back(0);
552553
builder.blocks.arithmetic.q_c().emplace_back(q_c);
553554
builder.blocks.arithmetic.set_gate_selector(3);
554555
builder.check_selector_length_consistency();
@@ -561,6 +562,7 @@ TEST_F(UltraCircuitBuilderArithmetic, QArith3Gate)
561562
builder.blocks.arithmetic.q_2().emplace_back(0);
562563
builder.blocks.arithmetic.q_3().emplace_back(0);
563564
builder.blocks.arithmetic.q_4().emplace_back(0);
565+
builder.blocks.arithmetic.q_5().emplace_back(0);
564566
builder.blocks.arithmetic.q_c().emplace_back(0);
565567
builder.blocks.arithmetic.set_gate_selector(1);
566568
builder.check_selector_length_consistency();

0 commit comments

Comments
 (0)