chore(dsl): require MemOp index and value to be witnesses#23171
Merged
Conversation
Noir always emits a single unscaled witness for MemOp.index and MemOp.value (see MemOp::read_at_mem_index / write_to_mem_index in acvm-repo/acir/src/circuit/opcodes/memory_operation.rs). The WitnessOrConstant<bb::fr> representation on the bb side was carrying a dead constant path. Collapse the fields to uint32_t witness indices and assert the witness form on deserialization. Drops the constant-ops branch of the ROM/RAM/CallData tests.
federicobarbacovi
approved these changes
May 12, 2026
Contributor
federicobarbacovi
left a comment
There was a problem hiding this comment.
Thanks for doing this!
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
acir_format::MemOp.indexandMemOp.valuebecome plainuint32_twitness indices instead ofWitnessOrConstant<bb::fr>.acir_to_constraint_buf.cppnow asserts the Noir-sideAcir::Expressionis a single unscaled witness, matching what Noir actually emits (seeMemOp::read_at_mem_index/write_to_mem_indexinacvm-repo/acir/src/circuit/opcodes/memory_operation.rs— both takeWitness, notExpression).add_constant_opshelper andperform_constant_opsparameterization from ROM/RAM/CallData tests, since the path being exercised never came up in production.Test plan
ninja dsl_testspasses (note: my local build hits a pre-existing gtest cxx11-ABI link error; the affected.cpp.oobjects compile cleanly)