fix(ssa): Add MAX_INTERPRETER_CALL_STACK_SIZE to SSA interpreter#11264
Merged
TomAFrench merged 4 commits intomasterfrom Jan 20, 2026
Merged
fix(ssa): Add MAX_INTERPRETER_CALL_STACK_SIZE to SSA interpreter#11264TomAFrench merged 4 commits intomasterfrom
MAX_INTERPRETER_CALL_STACK_SIZE to SSA interpreter#11264TomAFrench merged 4 commits intomasterfrom
Conversation
Contributor
There was a problem hiding this comment.
⚠️ 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: 72ea03c | Previous: 67478b2 | Ratio |
|---|---|---|---|
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_blob |
248 s |
203 s |
1.22 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
TomAFrench
approved these changes
Jan 20, 2026
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.
Description
Problem
Resolves #8081
Summary
Adds a
MAX_INTERPRETER_CALL_STACK_SIZEconstant with a value of 1000 to the SSA interpreter. If this is reached duringInterpreter::call_functionthen we return a newInterpreterError::StackOverflowwith the IDs and names of the functions on the call stack.Additional Context
Unlike the comptime interpreter, we can go 1000 deep here, matching ACIR.
The issue originally was created when the Inlining pass overflowed the stack on the example program, because it was trying to inline an infinitely recursive ACIR lambda into a Brillig function. This was before the lambdas were changed to be represented by a pair of (constrained, unconstrained) functions. Now it's inlining a Brillig lambda into a Brillig function, which has handling to prevent recursion.
The problem was now with the constant folding: since the arguments were constant, we tried to interpret the call using the SSA interpreter, and while #10481 limited the number of steps taken during constant folding to prevent infinite loops, it didn't limit the stack size, which was easier to exhaust.
User Documentation
Check one:
PR Checklist
cargo fmton default settings.