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

feat(brillig_gen): Return slices from foreign calls #1909

Merged
merged 10 commits into from
Jul 11, 2023

Conversation

vezenovm
Copy link
Contributor

Description

Problem*

Partial works towards #1556

Summary*

Now that slices are implemented on the frontend and in the SSA refactor we need to enable code gen for both Brillig and ACIR. This some partial work towards the Brillig gen for slices that enables us to return a slice from an external call like below:

#[oracle(get_number_sequence)]
unconstrained fn get_number_sequence(_size: Field) -> [Field] {}

I have also included a test that makes two different foreign calls to verify that memory has not been overwritten and we can iterate over the dynamic slices returned from the foreign call inside Brillig.

Other work is being done in parallel to enable these dynamic slices to be returned from Brillig into ACIR and handled inside of ACIR.

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

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

crates/nargo/src/ops/execute.rs Outdated Show resolved Hide resolved
crates/nargo/src/ops/execute.rs Outdated Show resolved Hide resolved
crates/nargo/src/ops/execute.rs Outdated Show resolved Hide resolved
crates/nargo/src/ops/execute.rs Show resolved Hide resolved
vezenovm and others added 5 commits July 11, 2023 15:33
Co-authored-by: jfecher <jake@aztecprotocol.com>
Co-authored-by: jfecher <jake@aztecprotocol.com>
Co-authored-by: jfecher <jake@aztecprotocol.com>
@vezenovm vezenovm requested a review from jfecher July 11, 2023 15:54
jfecher
jfecher previously approved these changes Jul 11, 2023
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.

Looks good. Can you create an issue for the two remaining comments? Then we can merge this

@vezenovm
Copy link
Contributor Author

Looks good. Can you create an issue for the two remaining comments? Then we can merge this

Made issues #1910 and #1911. I am working on a logging refactor right now which will resolve #1910 fully and #1911 partially.

@vezenovm vezenovm enabled auto-merge July 11, 2023 19:21
@vezenovm vezenovm added this pull request to the merge queue Jul 11, 2023
Merged via the queue into master with commit 6fa3144 Jul 11, 2023
@vezenovm vezenovm deleted the mv/foreign-call-slices branch July 11, 2023 19:33
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.

2 participants