Skip to content

NOIR fixes - #60

Merged
raghav198 merged 4 commits into
mainfrom
raghav/noir-fixes
Aug 31, 2026
Merged

raghav198 merged 4 commits into
mainfrom
raghav/noir-fixes

Conversation

@raghav198

Copy link
Copy Markdown
Collaborator

No description provided.

@raghav198

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e7485d2078

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 540 to +544
.Default([this, &postcondition](auto op) {
auto expression = builder.getExpression(op->getResult(0));
postcondition.substitute(builder.getConstant(op->getResult(0)),
expression);
// The default case is just an expression op, but we shouldn't have to
// do anything here because any places that use the result have already
// called `builder.getExpression()` on the result so there shouldn't be
// anything to substitute.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore substitution for computed branch conditions

When an scf.if condition is produced by an expression such as bool.cmp, calculateWP(scf::IfOp) still inserts builder.getConstant(ifOp.getCondition()) into the branch antecedents. Making the default case a no-op leaves that fresh Boolean unrelated to the comparison; moreover, when the verification query gathers declarations, getDeclBounds attempts to apply _is_mod to this Boolean and aborts with cannot bound non-integral sort modulo. The existing tests/smtlib/disable-store-iszero.llzk flow has exactly this computed-condition shape, so expression-result substitution must be retained or the scf.if handler must use getExpression directly.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@codex After the new commit, is this still an issue?

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 36c602bd5c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 540 to +544
.Default([this, &postcondition](auto op) {
auto expression = builder.getExpression(op->getResult(0));
postcondition.substitute(builder.getConstant(op->getResult(0)),
expression);
// The default case is just an expression op, but we shouldn't have to
// do anything here because any places that use the result have already
// called `builder.getExpression()` on the result so there shouldn't be
// anything to substitute.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve substitution for computed subcomponent arguments

When a subcomponent call receives a computed argument, such as a felt.add result, this no-op leaves that result represented by an unrelated fresh constant: TermBuilder::initSubcmp still constructs every uninterpreted-function argument with getConstant(arg) in TermUtils.cpp, rather than getExpression(arg). Consequently, witness and constraint calls computed from equivalent expressions can use unconstrained, independent arguments and yield an incorrect equivalence result; retain the substitution here or expand arguments inside initSubcmp.

Useful? React with 👍 / 👎.

@raghav198
raghav198 marked this pull request as ready for review August 26, 2026 18:45
@raghav198
raghav198 requested a review from a team as a code owner August 26, 2026 18:45
Comment thread lib/Verification/WeakestPrecondition.cpp Outdated
Comment on lines +443 to +446
if (auto constOp = val.getDefiningOp<felt::FeltConstantOp>()) {
return constOp.getValue().getValue().isOne();
}
return false;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this one also peer through IntToFeltOp like isBool() does?

@raghav198
raghav198 requested a review from tim-hoffman August 31, 2026 15:25

@tim-hoffman tim-hoffman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@raghav198
raghav198 merged commit ab79ae8 into main Aug 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants