Skip to content

fix: add clear error for unsatisfiable ACIR AssertZero opcode#22417

Merged
TomAFrench merged 2 commits into
merge-train/barretenbergfrom
claudebox/assertzero-unsatisfiable-error
Apr 10, 2026
Merged

fix: add clear error for unsatisfiable ACIR AssertZero opcode#22417
TomAFrench merged 2 commits into
merge-train/barretenbergfrom
claudebox/assertzero-unsatisfiable-error

Conversation

@AztecBot

@AztecBot AztecBot commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator

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=1

@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels Apr 8, 2026
@TomAFrench TomAFrench requested a review from a team April 9, 2026 18:02
@TomAFrench TomAFrench marked this pull request as ready for review April 9, 2026 18:02
@TomAFrench TomAFrench removed the request for review from a team April 9, 2026 18:02

@federicobarbacovi federicobarbacovi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for adding this! Just a small suggestion

Comment thread barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_to_constraint_buf.cpp Outdated
@TomAFrench TomAFrench merged commit 993d369 into merge-train/barretenberg Apr 10, 2026
12 checks passed
@TomAFrench TomAFrench deleted the claudebox/assertzero-unsatisfiable-error branch April 10, 2026 12:29
github-merge-queue Bot pushed a commit that referenced this pull request Apr 13, 2026
BEGIN_COMMIT_OVERRIDE
fix: skip heavy recursion tests in debug builds (#22446)
fix: add clear error for unsatisfiable ACIR AssertZero opcode (#22417)
feat: enforce accumulator_not_empty = 0 at ECCVM lagrange_first row
(#22461)
fix: skip heavy recursion tests in debug builds, keep one for assertion
coverage (#22389)
fix: external audit fixes for Pedersen (#22434)
chore!: fix BASE off-by-one in create_small_range_constraint in theta
step of keccak (#22404)
fix: external audit fixes for Keccak (#22436)
fix: external audit fixes for BLAKE (#22443)
chore: misc hash gadget updates  (#22452)
END_COMMIT_OVERRIDE
critesjosh pushed a commit that referenced this pull request Apr 14, 2026
## 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=1
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