Skip to content
New issue

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

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

Already on GitHub? # to your account

feat(acir-simulator): advanced debug formatting for noir + acir simulator #775

Merged
merged 8 commits into from
Jun 8, 2023

Conversation

dbanks12
Copy link
Collaborator

@dbanks12 dbanks12 commented Jun 8, 2023

Description

Can now do any of the following:

debug_log("My string of any length");
debug_log_field(my_field);
debug_log_format("My fancy string with arg0 {0}, arg1 {1}...", [arg0, arg1]);` 

Example in set.nr:

debug_log_format("get_2(slot:{0}) =>\n\t0:{1}\n\t1:{2}", [storage_slot, notes.0.value, notes.1.value]);

outputs:

aztec:simulator:secret_execution get_2(slot:0x1e2b4bcfbbe8044a065e39d016cca65765cba0c47924f9622ee1e3b261908e10) =>
  aztec:simulator:secret_execution      0:0x1e2b4bcfbbe8044a065e39d016cca65765cba0c47924f9622ee1e3b261908e10
  aztec:simulator:secret_execution      1:0x00000000000000000000000000000000000000000000000000000000000003db!+13s

Note sometimes (even without these fancy changes, just using the old debug_log() that @Maddiaa0 implemented), the ACVM errors with: thrown: "solver opcode resolution error: cannot solve opcode: expression has too many unknowns x155"

Checklist:

  • I have reviewed my diff in github, line by line.
  • Every change is related to the PR description.
  • I have linked this pull request to the issue(s) that it resolves.
  • There are no unexpected formatting changes, superfluous debug logs, or commented-out code.
  • The branch has been merged or rebased against the head of its merge target.
  • I'm happy for the PR to be merged at the reviewer's next convenience.

@dbanks12 dbanks12 changed the title Draft: feat(acir-simulator): advanced debug formatting for noir + acir simulator feat(acir-simulator): advanced debug formatting for noir + acir simulator Jun 8, 2023
@dbanks12 dbanks12 requested review from sirasistant and Maddiaa0 and removed request for sirasistant June 8, 2023 02:22
@dbanks12 dbanks12 marked this pull request as ready for review June 8, 2023 02:24
@Maddiaa0
Copy link
Member

Maddiaa0 commented Jun 8, 2023

This is hot

@Maddiaa0 Maddiaa0 merged commit 9196bdc into master Jun 8, 2023
@Maddiaa0 Maddiaa0 deleted the db/format-noir-logging branch June 8, 2023 14:58
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants