Commit 632f6ee
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
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
549 | 549 | | |
550 | 550 | | |
551 | 551 | | |
| 552 | + | |
552 | 553 | | |
553 | 554 | | |
554 | 555 | | |
| |||
561 | 562 | | |
562 | 563 | | |
563 | 564 | | |
| 565 | + | |
564 | 566 | | |
565 | 567 | | |
566 | 568 | | |
| |||
0 commit comments