Skip to content

Commit

Permalink
Add comparison to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoletta committed Jan 17, 2024
1 parent 171862d commit 89fc207
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ jobs:
cairo_programs/**/*.trace
cairo_programs/**/*.air_public_input
cairo_programs/**/*.air_private_input
cairo_programs/**/*.pie.zip
key: ${{ matrix.program-target }}-reference-trace-cache-${{ hashFiles('cairo_programs/**/*.cairo', 'examples/wasm-demo/src/array_sum.cairo') }}
restore-keys: ${{ matrix.program-target }}-reference-trace-cache-

Expand Down Expand Up @@ -364,7 +365,7 @@ jobs:
extra-args: '--proof_mode --air_public_input {program}.rs.air_public_input --air_private_input {program}.rs.air_private_input '
- program-target: cairo_test_programs
programs-dir: cairo_programs
extra-args: ''
extra-args: '--cairo_pie_output {program}.rs.pie.zip'
name: Compute memory and execution traces with cairo-vm
needs: [ build-programs, build-release ]
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -401,6 +402,7 @@ jobs:
cairo_programs/**/*.trace
cairo_programs/**/*.air_public_input
cairo_programs/**/*.air_private_input
cairo_programs/**/*.pie.zip
key: ${{ matrix.program-target }}-release-trace-cache-${{ github.sha }}


Expand Down Expand Up @@ -501,6 +503,7 @@ jobs:
cairo_programs/**/*.trace
cairo_programs/**/*.air_public_input
cairo_programs/**/*.air_private_input
cairo_programs/**/*.pie.zip
key: ${{ matrix.program-target }}-reference-trace-cache-${{ hashFiles('cairo_programs/**/*.cairo', 'examples/wasm-demo/src/array_sum.cairo') }}
fail-on-cache-miss: true

Expand All @@ -512,6 +515,7 @@ jobs:
cairo_programs/**/*.trace
cairo_programs/**/*.air_public_input
cairo_programs/**/*.air_private_input
cairo_programs/**/*.pie.zip
key: ${{ matrix.program-target }}-release-trace-cache-${{ github.sha }}
fail-on-cache-miss: true

Expand All @@ -521,9 +525,10 @@ jobs:
PROOF=proof_mode
AIR_PUBLIC_INPUT=air_public_input
AIR_PRIVATE_INPUT=air_private_input
else
PIE=pie
fi
./vm/src/tests/compare_vm_state.sh trace memory $PROOF $AIR_PUBLIC_INPUT $AIR_PRIVATE_INPUT
./vm/src/tests/compare_vm_state.sh trace memory $PROOF
./vm/src/tests/compare_vm_state.sh trace memory $PROOF $AIR_PUBLIC_INPUT $AIR_PRIVATE_INPUT $PIE
wasm-demo:
name: Build the wasm demo
Expand Down
2 changes: 1 addition & 1 deletion vm/src/tests/cairo_pie_comparator.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
for file in strict_comparison_files:
# Skipping this check due to a bug in the memory holes count
# TODO: Remove it once the bug is fixed
if (filename1 == "../../../cairo_programs/_keccak_alternative_hint.pie.zip" or filename1 == "../../../cairo_programs/relocate_temporary_segment_append.pie.zip") and file == "execution_resources.json":
if (filename1 == "../../../cairo_programs/_keccak_alternative_hint.pie.zip" or filename1 == "../../../cairo_programs/relocate_temporary_segment_append.pie.zip" or filename1 == "../../../cairo_programs/_keccak_alternative_hint.pie.zip") and file == "execution_resources.json":
print(f"Comparison skipped for {filename1}/{file} vs {filename2}/{file}")
continue
with cairo_lang_pie_zip.open(file) as cairo_lang_file, cairo_vm_pie_zip.open(file) as cairo_vm_file:
Expand Down

0 comments on commit 89fc207

Please sign in to comment.