fix: avoid debug checker crash on failed circuits#24797
Closed
AztecBot wants to merge 1 commit into
Closed
Conversation
Collaborator
Author
|
Automatically closing this stale claudebox draft PR (no updates for 5+ days). Re-open if still needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CircuitChecker::checkin Chonk debug logging when the incoming circuit has already recorded a builder failure, so the originalcircuit.err()is reported instead of running a secondary structural check on invalid state.real_variable_indexis shorter than the variables vector, while preserving the original builder for witness classification so missing witnesses still reportUNCONSTRAINED.Root Cause
The nightly debug build runs with libstdc++ debug checks enabled. The ACIR components checker can inspect intentionally failed or corrupted builders, including the existing
DetectsUnconstrainedWitnessesregression path wherereal_variable_indexis truncated.cdg::StaticAnalyzer_indexesreal_variable_indexwhile walking all builder variables, so debug-mode vector bounds checks abort before the checker can classify the witness as unconstrained.Chonk's debug-only logging made the same class of issue easier to hit by calling
CircuitChecker::check(circuit)before checkingcircuit.failed(). For a circuit that had already failed during construction, the debug logging could run a second checker over invalid builder state and mask the useful builder error.Original failed CI run: https://github.com/AztecProtocol/barretenberg-claude/actions/runs/29675727468
Testing
clang-format-20 -i barretenberg/cpp/src/barretenberg/acir_components_check/components_check.cpp barretenberg/cpp/src/barretenberg/chonk/chonk.cppcmake --build --preset debug --target acir_components_check_tests chonk_testsfrombarretenberg/cppNATIVE_PRESET=debug barretenberg/cpp/scripts/run_test.sh acir_components_check_tests AcirComponentsCheckTest.DetectsUnconstrainedWitnessesNATIVE_PRESET=debug barretenberg/cpp/scripts/run_test.sh acir_components_check_tests AcirComponentsCheckTest.*NATIVE_PRESET=debug barretenberg/cpp/scripts/run_test.sh chonk_tests ChonkTests.BasicCreated by claudebox · group:
slackbot