Skip to content

Conversation

vezenovm
Copy link
Contributor

@vezenovm vezenovm commented Sep 9, 2025

Description

Problem*

Resolves #9787

Summary*

Reference the issue for the monomorphized AST (MAST) output we see on master.

This is the new MAST output for regression_9206:

global G_A$g0: [[u128; 0]; 2] = [[], []];
global G_S$g1: [[u128; 0]] = &[[], []];
unconstrained fn main$f0(i$l0: u32) -> pub u32 {
    let _a$l1 = {
        func_3$f1(G_A$g0[i$l0].clone())[1]
    };
    let _s$l2 = {
        func_3$f1(G_S$g1[i$l0].clone())[1]
    };
    i$l0
}
unconstrained fn func_3$f1(_a$l3: [u128; 0]) -> [[u128; 0]; 2] {
    G_A$g0.clone()
}

When combined with #9789 we will now have no clones in main.

Additional Context

I don't expect many bytecode changes as we still have the RC tracker during DIE which should be catching that we never mutate any arrays in this program and remove the IncrementRc instructions.

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation 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
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: d8f2114 Previous: af9c9f8 Ratio
test_report_zkpassport_noir-ecdsa_ 2 s 1 s 2

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

CC: @TomAFrench

@vezenovm vezenovm requested a review from jfecher September 9, 2025 20:12
Copy link
Contributor

@jfecher jfecher left a comment

Choose a reason for hiding this comment

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

👍

@TomAFrench TomAFrench added this pull request to the merge queue Sep 9, 2025
Merged via the queue into master with commit 1b5e1de Sep 9, 2025
123 checks passed
@TomAFrench TomAFrench deleted the mv/do-not-clone-index-call-results branch September 9, 2025 22:32
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.

Ownership: Can avoid cloning the array result of a function call
3 participants