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

Improve error reporting in BlockMachineProcessor #2279

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

georgwiese
Copy link
Collaborator

@georgwiese georgwiese commented Dec 21, 2024

Extracted from #2275.

This PR makes it easier to debug failing code generation in BlockMachineProcessor by printing the code generated so far.

Example:

$ RUST_LOG=debug cargo run pil test_data/std/binary_large_test.asm -o output -f
...
Code generation failed for connection:
  main::instr_and $ [0, main::X0, main::X1, main::X2] is main_binary::latch * main_binary::sel[0] $ [main_binary::operation_id, main_binary::A, main_binary::B, main_binary::C]
Known arguments:
  main_binary::operation_id
  main_binary::A
  main_binary::B
Error:
  Unable to derive algorithm to compute output value "main_binary::C"
The following code was generated so far:
main_binary::sel[0][3] = 1;
main_binary::operation_id[3] = params[0];
main_binary::A[3] = params[1];
main_binary::B[3] = params[2];
main_binary::operation_id[2] = main_binary::operation_id[3];
main_binary::operation_id_next[2] = main_binary::operation_id[3];
main_binary::operation_id[1] = main_binary::operation_id[2];
main_binary::operation_id_next[1] = main_binary::operation_id[2];
main_binary::operation_id[0] = main_binary::operation_id[1];
main_binary::operation_id_next[0] = main_binary::operation_id[1];
...

@georgwiese georgwiese marked this pull request as ready for review December 21, 2024 14:57
@@ -1,42 +1 @@
use itertools::Itertools;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this module is empty now. But #2276 adds to it, so if that gets merge first, it won't be empty on main.

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.

1 participant