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

Nargo: Expand info cmd to support multiple circuits #4697

Closed
Tracked by #4426
vezenovm opened this issue Apr 2, 2024 · 0 comments · Fixed by #4719
Closed
Tracked by #4426

Nargo: Expand info cmd to support multiple circuits #4697

vezenovm opened this issue Apr 2, 2024 · 0 comments · Fixed by #4719
Assignees
Labels
bug Something isn't working

Comments

@vezenovm
Copy link
Contributor

vezenovm commented Apr 2, 2024

Aim

After #4428 we can expect circuits with calls to functions marked with #[fold] to have multiple circuits. We should be able to get info on each individual circuit in a program as they will all be processed in execution and proving.

Expected Behavior

We should at a minimum be able to see the circuit sizes of each individual circuit. Not only this, but we should we be able to see each circuit function's count, but ideally we should see the total program circuit count given the call's to ACIR functions specified by the program.

Bug

nargo info currently just returns the info for the main entry point circuit.

To Reproduce

  1. Run nargo info on any circuit with calls to a function marked with #[fold]

You will see only a single info report gets printed which is for the main function.

Project Impact

None

Impact Context

No response

Workaround

None

Workaround Description

No response

Additional Context

No response

Installation Method

None

Nargo Version

No response

NoirJS Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@vezenovm vezenovm added the bug Something isn't working label Apr 2, 2024
@vezenovm vezenovm mentioned this issue Apr 2, 2024
@vezenovm vezenovm changed the title Nargo: Expand nargo info to support multiple circuits Nargo: Expand info cmd to support multiple circuits Apr 2, 2024
@vezenovm vezenovm self-assigned this Apr 2, 2024
github-merge-queue bot pushed a commit that referenced this issue Apr 8, 2024
# Description

## Problem\*

Resolves  #4697 

## Summary\*

The `nargo info` command previously assumed that we only had a single
circuit. In order to display accurate circuits sizes we should display
the circuit size of each individual circuit entry part which is part of
an entire `Program`.

For improved debugging I also had to exposed names in the
`GeneratedAcir`. This prompted also refactoring the context that we pass
around in `ssa.rs` when creating a circuit and a program. Two new
structs,`SsaProgramArtifact` and `SsaCircuitArtifact`, have been created
to clean this up.

Example output from `nargo info` on `fold_basic_nested_call`:
<img width="847" alt="Screenshot 2024-04-04 at 3 54 46 PM"
src="https://github.com/noir-lang/noir/assets/43554004/95a827c4-766c-4d7d-b03e-fb9428cfdb2a">


## Additional Context

It isn't necessarily obvious how we should display foldable circuits for
contracts which already have multiple entry points. I have left this for
follow-up work: #4720

## Documentation\*

Check one:
- [ ] No documentation needed.
- [ ] Documentation included in this PR.
- [X] **[For Experimental Features]** 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.
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