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

Compiler error when adding EmbeddedCurvePoint in brillig #4260

Closed
ggiraldez opened this issue Feb 5, 2024 · 0 comments · Fixed by #4382
Closed

Compiler error when adding EmbeddedCurvePoint in brillig #4260

ggiraldez opened this issue Feb 5, 2024 · 0 comments · Fixed by #4382
Labels
bug Something isn't working

Comments

@ggiraldez
Copy link
Contributor

Aim

Compile the following program:

use dep::std;

unconstrained fn main() -> pub Field {
    let g1_y = 17631683881184975370165255887551781615748388533673675138860;
    let g1 = std::scalar_mul::EmbeddedCurvePoint { x: 1, y: g1_y };
    let double = g1.add(g1);

    double.x
}

Expected Behavior

The program should compile correctly.

Bug

An internal compiler error is reported:

The application panicked (crashed).
Message:  internal error: entered unreachable code: ICE: EmbeddedCurveAdd expects four register arguments and one array result
Location: compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_black_box.rs:213

This is a bug. We may have already fixed this in newer versions of Nargo so try searching for similar issues at https://github.com/noir-lang/noir/issues/.
If there isn't an open issue for this bug, consider opening one at https://github.com/noir-lang/noir/issues/new?labels=bug&template=bug_report.yml

To Reproduce

Run nargo compile with the above sample

Installation Method

Compiled from source

Nargo Version

nargo version = 0.23.0 noirc version = 0.23.0+bdf64ed81d7f34d6478ed9bde5b69e45d171d5f0 (git version hash: bdf64ed, is dirty: true)

Additional Context

This is a subset of the scalar_mul execution success sample. We found that this fails when running under the debugger since we compile in Brillig mode by default for debugging.

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@ggiraldez ggiraldez added the bug Something isn't working label Feb 5, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Feb 5, 2024
@TomAFrench TomAFrench changed the title Compiler error when adding EmbeddedCurvePoint Compiler error when adding EmbeddedCurvePoint in brillig Feb 5, 2024
github-merge-queue bot pushed a commit that referenced this issue Feb 17, 2024
)

# Description

## Problem\*

Resolves  #4260

## Summary\*

The error is explained in the comment I've added to the stdlib. This is
a quick fix and we can clean it up once we're making serialisation
changes in `aztec-packages` again.

## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Feb 17, 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
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant