Repository navigation
Commit cc60215
authored
fix(bb): keep padded batch-merge test columns within their virtual size (#25687)
Fixes the [Nightly Debug Build
failure](https://github.com/AztecProtocol/aztec-packages/actions/runs/40273515013)
on `next` @ c1b606f, plus two `ci-barretenberg` CI failures that
this PR exposed. Both of those show up when the bb build misses the
cache.
## 1. Debug-only assertion in `BatchMergeTests`
The nightly debug run ([CI
log](http://ci.aztec-labs.com/1792991923783727)) ran the whole bb suite.
Exactly four tests failed, and they are the same test under each
parameterization:
- `goblin_tests
BatchMergeTests/{0,1,2,3}.PaddedSupportPreservesOriginalCommitments`
```
Assertion failed: (index < virtual_size_ + virtual_padding)
```
**Cause.** `TweakableBatchMergeProver` (test-only) pads subtable columns
with `Polynomial(col, col.size() + n)`. That copy constructor extends
the memory-backed range (`end_`) but keeps the original `virtual_size_`.
The padded rows therefore sit past the virtual size, and the next
`get()` on them trips `BB_ASSERT_DEBUG(index < virtual_size_ +
virtual_padding)`. Release builds compile that assert out, so only the
nightly debug build catches it.
**Fix.** A test helper, `pad_column`, appends the zero rows and raises
the virtual size to cover them. Both padding sites in the tweakable
prover use it: the `PADDED_SUPPORT` / `ODD_PADDED_SUPPORT` path and the
`CANCELLED_SEPARATOR*` path.
## 2. `ci-barretenberg` lints bb.js before `ipc-runtime` is built
[CI log](http://ci.aztec-labs.com/1793005339838367):
```
Unable to resolve path to module '@aztec-foundation/ipc-runtime' import-x/no-unresolved
```
bb.js resolves `@aztec-foundation/ipc-runtime` through a portal into
`ipc-runtime/ts`, whose entry point is the built `dest/`. The
`ci-barretenberg` entry point in the root `bootstrap.sh` ran the bb.js
lint before anything built that. **Fix:** run `ipc-runtime/bootstrap.sh
build` before the formatting step.
## 3. Concurrent presets race on `bb_schema_embed.hpp`
Once lint passed, both wasm builds failed
([wasm-threads](http://ci.aztec-labs.com/7c4894142e713f18),
[wasm](http://ci.aztec-labs.com/b223bf5ddc632957)):
```
CMake Error at src/barretenberg/bbapi/CMakeLists.txt:45 (configure_file): No such file or directory
bb_schema_embed.hpp:6:54: fatal error: raw string missing terminating delimiter )bbschema"
```
`bbapi/CMakeLists.txt` ran `configure_file` into the source tree
(`src/barretenberg/bbapi/generated/bb_schema_embed.hpp`). Every preset
therefore wrote the same file, and CI configures native, wasm and
wasm-threads at the same time. One configure saw the file mid-rewrite
(ENOENT), and another compiled a truncated copy. **Fix:** generate the
header into `${CMAKE_CURRENT_BINARY_DIR}`, add that directory as a
private include on `bbapi_objects`, and include it as
`"bb_schema_embed.hpp"`. The ipc-codegen outputs in `generated/` are
untouched.
## Testing (local)
- Batch merge, `debug` preset. Red: all 4
`PaddedSupportPreservesOriginalCommitments` parameterizations fail with
the CI assertion. Green: all of `goblin_tests` passes (89 passed, 7
skipped on purpose, 0 failed).
- CI ordering. Red: on a clean checkout, `CI=1
barretenberg/ts/bb.js/bootstrap.sh formatting` reproduces the 4
`no-unresolved` errors. Green: after `ipc-runtime/bootstrap.sh build`,
it exits 0.
- Schema embed: I could not trigger the race locally. With the change,
`debug` configures and builds `bbapi_objects`, and `wasm-threads`
configures and compiles `bbapi_schema.cpp.obj`. The header is generated
under each build directory and no longer in the source tree.
Everything else is left to CI.
---
*Created by
[claudebox](https://claudebox.work/v2/sessions/be2aead164432985/jobs/1)
· group: `slackbot` · requested by Sergei · [Slack
thread](https://aztecfoundation.slack.com/archives/C04ALP0UQHH/p1792992711137169?thread_ts=1792992711.137169&cid=C04ALP0UQHH)*1 parent c1b606f commit cc60215
4 files changed
Lines changed: 20 additions & 4 deletions
File tree
- barretenberg/cpp/src/barretenberg
- bbapi
- goblin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | | - | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
145 | 156 | | |
146 | 157 | | |
147 | 158 | | |
| |||
175 | 186 | | |
176 | 187 | | |
177 | 188 | | |
178 | | - | |
| 189 | + | |
179 | 190 | | |
180 | 191 | | |
181 | 192 | | |
| |||
190 | 201 | | |
191 | 202 | | |
192 | 203 | | |
193 | | - | |
| 204 | + | |
194 | 205 | | |
195 | 206 | | |
196 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1032 | 1032 | | |
1033 | 1033 | | |
1034 | 1034 | | |
| 1035 | + | |
| 1036 | + | |
1035 | 1037 | | |
1036 | 1038 | | |
1037 | 1039 | | |
| |||
0 commit comments