-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dynamic-layout
- Loading branch information
Showing
6 changed files
with
53 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# 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 <AIR-PUBLIC-INPUTS-1> <AIR-PUBLIC-INPUTS-2> | ||
``` | ||
|
||
To compare the private inputs, run: | ||
```bash | ||
scripts/air_private_inputs_differ.bash <AIR-PRIVATE-INPUTS-1> <AIR-PRIVATE-INPUTS-2> | ||
``` | ||
|
||
If you just want to visualize the memory, run: | ||
```bash | ||
scripts/memory_viewer.bash <MEMORY-FILE> | ||
``` | ||
It will output the memory in two columns: address and value | ||
|
||
|
||
To compare the memory, run: | ||
```bash | ||
scripts/memory_differ.bash <TRACE-1> <TRACE-2> | ||
``` |
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 |