You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Artifact size and compile time should not explode.
Bug
In this project ram usage goes to 100gigs, postprocessing after ACIR generation can take 10 minutes and the compressed debug metadata in the artifact weights 1 gigabyte.
The problem is that we always associate debug metadata with acir callsites. We've succesfully deduplicated the brillig code by the separation unconstrained fn / brillig call in the Program struct, but brillig-related debug metadata still gets added over and over again on every callsite, just changing the ACIR index.
# Description
## Problem\*
Resolves#5521
## Summary\*
This PR adds a new `brillig_locations` map to our generated ACIR that
maps a brillig function id to an opcode locations map
`BTreeMap<OpcodeLocation, CallStack>`. If we have called that Brillig
function id before we do not add its debug locations.
For the same test as in the issue I ran `du -sh ./target` and got a size
of 2.3M. This is a >400x reduction in size of the artifact. Compilation
also takes a matter of a couple seconds now rather than 10 minutes.
## Additional Context
The call stacks are the same as expected. For example, under
`execution_failure/fold_nested_brillig_assert_fail` we have the
following call stack:
<img width="871" alt="Screenshot 2024-08-08 at 10 33 28 AM"
src="https://github.com/user-attachments/assets/716d5e53-dc7b-4873-950f-2e1b8fd6c5b9">
## Documentation\*
Check one:
- [X] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[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.
---------
Co-authored-by: jfecher <[email protected]>
Aim
Have a program that uses brillig hints in a loop
Expected Behavior
Artifact size and compile time should not explode.
Bug
In this project ram usage goes to 100gigs, postprocessing after ACIR generation can take 10 minutes and the compressed debug metadata in the artifact weights 1 gigabyte.
The problem is that we always associate debug metadata with acir callsites. We've succesfully deduplicated the brillig code by the separation unconstrained fn / brillig call in the Program struct, but brillig-related debug metadata still gets added over and over again on every callsite, just changing the ACIR index.
To Reproduce
Minimal repro:
some_unconstrained_fn
has 1558 locations. It gets called 100k times, and the final Program struct debug metadatalocations
has 155M entries.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
The text was updated successfully, but these errors were encountered: