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

chore(debugger): Limit printed BRILLIG opcode info while stepping in REPL debugger #4147

Merged

Conversation

mverzilli
Copy link
Contributor

Description

Reduces the amount of information printed to the console after each step, when execution pauses at an ACIR BRILLIG opcode.

Problem

Part of #3015.

Summary

Before this change:

[1327_concrete_in_generic] Starting debugger
At opcode 0: BRILLIG: inputs: [Single(Expression { mul_terms: [], linear_combinations: [], q_c: 0 }), Single(Expression { mul_terms: [], linear_combinations: [(1, Witness(0))], q_c: 0 })]
outputs: []
[Mov { destination: RegisterIndex(2), source: RegisterIndex(0) }, Mov { destination: RegisterIndex(3), source: RegisterIndex(1) }, Const { destination: RegisterIndex(0), value: Value { inner: 0 } }, Const { destination: RegisterIndex(1), value: Value { inner: 0 } }, Mov { destination: RegisterIndex(2), source: RegisterIndex(2) }, Mov { destination: RegisterIndex(3), source: RegisterIndex(3) }, Call { location: 8 }, Stop, ForeignCall { function: "__debug_var_assign", destinations: [], inputs: [RegisterIndex(RegisterIndex(2)), RegisterIndex(RegisterIndex(3))] }, Return]

At ~/noir/test_programs/execution_success/1327_concrete_in_generic/src/main.nr:56:9
 51    ...
 52    fn get_d_method_interface() -> MethodInterface<D> {
 53        MethodInterface { some_method_on_t_d: d_method }
 54    }
 55    // ---
 56 -> fn main(input: Field) -> pub Field {
 57        let b: B<C<D>> = B::new(new_concrete_c_over_d);
 58        let c: C<D> = b.get_t_c(); // Singleton<Note>
 59        let d: D = D { d: input }; // Note
 60        let output = c.call_method_of_t_d(d);

After this change:

[1327_concrete_in_generic] Starting debugger
At opcode 0: BRILLIG: ...
At ~/noir/test_programs/execution_success/1327_concrete_in_generic/src/main.nr:56:9
 51    ...
 52    fn get_d_method_interface() -> MethodInterface<D> {
 53        MethodInterface { some_method_on_t_d: d_method }
 54    }
 55    // ---
 56 -> fn main(input: Field) -> pub Field {
 57        let b: B<C<D>> = B::new(new_concrete_c_over_d);
 58        let c: C<D> = b.get_t_c(); // Singleton<Note>
 59        let d: D = D { d: input }; // Note
 60        let output = c.call_method_of_t_d(d);
 61    ...
>

Note: the user can still inspect the full contents of opcode 0 by using the opcodes command.

Documentation

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [Exceptional Case] Documentation to be submitted in a separate PR.

PR Checklist

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

@vezenovm vezenovm added this pull request to the merge queue Jan 24, 2024
Merged via the queue into noir-lang:master with commit 21f91b6 Jan 24, 2024
31 checks passed
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