Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test missing_closure_env fails with inliner <=0 and brillig #6442

Closed
aakoshh opened this issue Nov 4, 2024 · 2 comments
Closed

Test missing_closure_env fails with inliner <=0 and brillig #6442

aakoshh opened this issue Nov 4, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@aakoshh
Copy link
Contributor

aakoshh commented Nov 4, 2024

Aim

Trying to run test_programs with different --inliner-aggressiveness in #6429

Expected Behavior

Tests under execution_success should work.

Bug

nargo execute --force --inliner-aggressiveness 0 --force-brillig
error: Failed to solve program: 'Failed to solve brillig function'
  ┌─ /Users/aakoshh/Work/aztec/noir/test_programs/execution_success/missing_closure_env/src/main.nr:7:12

7 │     assert(*x1 == 44);
  │            ---------

  = Call stack:
    1. /Users/aakoshh/Work/aztec/noir/test_programs/execution_success/missing_closure_env/src/main.nr:7:12

Failed to solve program: 'Failed to solve brillig function'

To Reproduce

  1. cd test_programs/execution_success/missing_closure_env
  2. nargo execute --force --inliner-aggressiveness 0 --force-brillig

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Nargo Version

nargo version = 0.36.0 noirc version = 0.36.0+2f0cb3e80f3d93a1dee77fffacc397811e300257 (git version hash: 2f0cb3e, is dirty: false)

NoirJS Version

No response

Proving Backend Tooling & Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@aakoshh aakoshh added the bug Something isn't working label Nov 4, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Nov 4, 2024
@aakoshh aakoshh changed the title Test missing_closure_env fails with inliner <=0 and brillig Test missing_closure_env fails with inliner <=0 and brillig Nov 4, 2024
@aakoshh
Copy link
Contributor Author

aakoshh commented Nov 6, 2024

Same problem as #6443

cargo run -q -p nargo_cli --  --program-dir . execute --force --force-brillig --inliner-aggressiveness -9223372036854775808 --show-ssa
Initial SSA:
brillig(inline) fn main f0 {
  b0(v0: Field):
    v1 = allocate
    store Field 42 at v1
    v3 = load v1
    v4 = eq v3, Field 42
    constrain v3 == Field 42
    call f1(v1, Field 44)
    v7 = load v1
    v8 = eq v7, Field 44
    constrain v7 == Field 44
    v9 = load v1
    call f1(v1, v9)
    v11 = load v1
    v12 = eq v11, Field 44
    constrain v11 == Field 44
    v13 = eq v0, Field 42
    constrain v0 == Field 42
    return 
}
acir(inline) fn lambda f1 {
  b0(v0: &mut Field, v1: Field):
    v2 = allocate
    store v0 at v2
    v3 = load v2
    store v1 at v3
    return 
}

...

After Array Set Optimizations:
brillig(inline) fn main f0 {
  b0(v0: Field):
    v1 = allocate
    store Field 42 at v1
    call f1(v1, Field 44)
    v5 = load v1
    constrain v5 == Field 44
    v6 = load v1
    call f1(v1, v6)
    v8 = load v1
    constrain v8 == Field 44
    constrain v0 == Field 42
    return 
}
brillig(inline) fn lambda f1 {
  b0(v0: &mut Field, v1: Field):
    return 
}

f1 representing the lambda shows its entire body eliminated.

@aakoshh
Copy link
Contributor Author

aakoshh commented Nov 6, 2024

Fixed by #6452

@aakoshh aakoshh closed this as completed Nov 6, 2024
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ✅ Done
Development

No branches or pull requests

1 participant