-
Notifications
You must be signed in to change notification settings - Fork 168
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
Add Debug scripts #1839
Merged
Merged
Add Debug scripts #1839
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6f98945
Add debug scripts
JulianGCalderon 48c3438
Add debugging document
JulianGCalderon cdcefc9
Add changelog
JulianGCalderon 0bb3f07
Revert changelog
JulianGCalderon ef97fc1
Improve script usage code blocks
JulianGCalderon 6f292f3
Remove extra space
JulianGCalderon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Debugging | ||
|
||
## Comparing with Cairo-Lang | ||
|
||
If you executed a Cairo0 proof program with both Rust and Python VM, you can use the following scripts to compare their output. They all require `delta` (modern diff) to be installed. If you don't have you can locally change it. | ||
|
||
No output when running a differ script implies that there are no differences. | ||
|
||
To compare the public inputs, run: | ||
```bash | ||
scripts/air_public_inputs_differ.bash file1 file2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you be a little clearer here. Try to do the same to the other commands There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
``` | ||
|
||
To compare the private inputs, run: | ||
```bash | ||
scripts/air_private_inputs_differ.bash file1 file2 | ||
``` | ||
|
||
If you just want to visualize the memory, run: | ||
```bash | ||
scripts/memory_viewer.bash file | ||
``` | ||
It will output the memory in two columns: address and value | ||
|
||
|
||
To compare the memory, run: | ||
```bash | ||
scripts/memory_differ.bash file1 file2 | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
delta \ | ||
<(jq -S 'del(.memory_path,.trace_path)' "$1") \ | ||
<(jq -S 'del(.memory_path,.trace_path)' "$2") \ | ||
-s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
delta \ | ||
<(jq -S . "$1") \ | ||
<(jq -S . "$2") \ | ||
-s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
delta \ | ||
<(hexdump -e '1/8 "%u " 4/8 "%x " "\n"' "$1" | sort -n) \ | ||
<(hexdump -e '1/8 "%u " 4/8 "%x " "\n"' "$2" | sort -n) \ | ||
-s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# outputs memory file in "ADDR VALUE" format, on cell per line | ||
|
||
hexdump -e '1/8 "%10u " 4/8 "%x " "\n"' "$1" | sort -n |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation and this kind of scripts that don't modify the VM doesn't need a line in the changelog
Remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I added "documentation" label to ignore the changelog check.