Skip to content

fix: track MakeArray elements as Brillig call arguments in underconstrained check#11816

Open
TomAFrench wants to merge 6 commits intomasterfrom
tf/fix-underconstrained-make-array
Open

fix: track MakeArray elements as Brillig call arguments in underconstrained check#11816
TomAFrench wants to merge 6 commits intomasterfrom
tf/fix-underconstrained-make-array

Conversation

@TomAFrench
Copy link
Copy Markdown
Member

@TomAFrench TomAFrench commented Mar 9, 2026

Description

Problem

Resolves #11807

Summary

We currently don't link the inputs to a MakeArray instruction to the result itself, this PR traces back all of the MakeArrays making up the brillig call argument and adds them to the set of arguments

Additional Context

User Documentation

Check one:

  • No user documentation needed.
  • Changes in docs/ included in this PR.
  • [For Experimental Features] Changes in docs/ to be submitted in a separate PR.

PR Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 04e02c7 Previous: 1aacfa9 Ratio
test_report_zkpassport_noir-ecdsa_ 4 s 3 s 1.33

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 4ef8d73 Previous: 667dd9b Ratio
rollup-block-root-single-tx 0.003 s 0.002 s 1.50

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Brillig Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 9dd1365 Previous: 331250b Ratio
rollup-tx-merge 0.002 s 0.001 s 2

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

@TomAFrench TomAFrench requested a review from a team March 12, 2026 17:04
Comment thread compiler/noirc_evaluator/src/ssa/checks/check_for_underconstrained_values.rs Outdated
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'ACVM Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 04e02c7 Previous: 1aacfa9 Ratio
perfectly_parallel_batch_inversion_opcodes 3135472 ns/iter (± 6503) 2207346 ns/iter (± 2826) 1.42

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

Comment thread compiler/noirc_evaluator/src/ssa/checks/check_for_underconstrained_values.rs Outdated
Instruction::Cast(..)
| Instruction::Truncate { .. }
| Instruction::MakeArray { .. }
| Instruction::ArraySet { .. }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it should be enough to do add MakeArray here, and not do the extended_args further up.

It's not a very general mechanism, but what this seems to achieve is that if we know that the output of the MakeArray is an input to a call which we want to cover by constraints, then it adds the arguments of the MakeArray to the arguments of the call itself. Only the direct arguments, but the effect should be the same.

I reckon it would be potentially easier to understand the whole thing if we tracked the ancestry of everything, and this would not be behind the enable_lookback flag, but that's what its purpose is: to establish the connection between not just the arguments of the call, but anything that descends from the args before the call is made, and in this limited set to the 1 level ancestors as well.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Although I see the extended_args is going back to collect more ancestors, which is nice.

@aakoshh aakoshh force-pushed the tf/fix-underconstrained-make-array branch from 4ef8d73 to f500834 Compare March 26, 2026 12:09
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.

False positive in underconstrainedness checker when passing arrays as inputs to brillig call

3 participants