chore(acir): enforce side-effects predicate scope - #13492
Draft
AztecBot wants to merge 7 commits into
Draft
Conversation
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
SideEffectsLatchnewtype and require lowering code to choose a named accessorrequires_acir_gen_predicatein debug builds and assert on every scoped predicate readThe tracking field and assertion are absent from release builds; the newtype/accessors do not change circuit generation.
Refs noir-lang/noir-claude#1654.
Refs https://gist.github.com/AztecBot/ab38996b864f2a2bbabbd456708d72c6#8-suggested-sequencing
Testing
cargo test -p noirc_evaluator predicate_rejects_an_out_of_scope_readcargo test -p noirc_evaluator index_read_under_disabled_predicatecargo test -p noirc_evaluator --lib(1,947 passed; 15 ignored)cargo check -p noirc_evaluator --releaseNOIR_AST_FUZZER_BUDGET_SECS=3 cargo test -p noir_ast_fuzzer_fuzz acir_vs_brillig -- --nocaptureCreated by claudebox · group:
slackbot· requested by Tom (@TomAFrench) · Slack thread