Commit 7d1833d
fix: add clear error for unsatisfiable ACIR AssertZero opcode (#22417)
## Summary
When an ACIR `AssertZero` opcode has no variables but a non-zero
constant, the circuit is fundamentally unsatisfiable (`nonzero == 0` can
never hold). Previously this hit a generic assertion about empty gates
with no indication of the real problem.
Added an early check in `assert_zero_to_quad_constraints` that detects
this case and produces a clear error: "circuit is unsatisfiable. An
AssertZero opcode contains no variables but has a non-zero constant,
which can never equal zero."
## Test plan
- All 60 existing quad/big-quad constraint tests pass
- Built and ran `dsl_tests` successfully
ClaudeBox log: https://claudebox.work/s/bcd66a8253a37704?run=11 parent ac5707a commit 7d1833d
File tree
3 files changed
+35
-2
lines changed- barretenberg/cpp/src/barretenberg/dsl/acir_format
3 files changed
+35
-2
lines changedLines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
574 | 585 | | |
575 | 586 | | |
576 | 587 | | |
| |||
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
0 commit comments