Skip to content

chore(acir): enforce side-effects predicate scope - #13492

Draft
AztecBot wants to merge 7 commits into
masterfrom
cb/acir-side-effects-predicate-contract
Draft

chore(acir): enforce side-effects predicate scope#13492
AztecBot wants to merge 7 commits into
masterfrom
cb/acir-side-effects-predicate-contract

Conversation

@AztecBot

Copy link
Copy Markdown
Collaborator

Summary

  • hide the ambient ACIR side-effects latch behind a private SideEffectsLatch newtype and require lowering code to choose a named accessor
  • track whether the current instruction declares requires_acir_gen_predicate in debug builds and assert on every scoped predicate read
  • move the safe-index disabled-array guard before predicate acquisition, and stop forwarding the latch to black-box intrinsics which do not consume it
  • retain an explicit, closed escape hatch for the one fail-safe stale read used only to skip unnecessary gating

The 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_read
  • cargo test -p noirc_evaluator index_read_under_disabled_predicate
  • cargo test -p noirc_evaluator --lib (1,947 passed; 15 ignored)
  • cargo check -p noirc_evaluator --release
  • NOIR_AST_FUZZER_BUDGET_SECS=3 cargo test -p noir_ast_fuzzer_fuzz acir_vs_brillig -- --nocapture

Created by claudebox · group: slackbot · requested by Tom (@TomAFrench) · Slack thread

@AztecBot AztecBot added claude-review Adversarial ClaudeBox review pending claudebox labels Aug 10, 2026
@TomAFrench TomAFrench changed the title refactor(acir): enforce side-effects predicate scope chore(acir): enforce side-effects predicate scope Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-review Adversarial ClaudeBox review pending claudebox

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants