Skip to content

Update docs. #961

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

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions .github/ISSUE_TEMPLATE/daily_failure.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
---
title: "Daily Workflow Failure: Block Range {{ env.BLOCK_START }}-{{ env.BLOCK_END }}"
title: "Daily Workflow Failure"
labels: bug
---

Comparing VM execution against Native in the given block range produced diffs:
Comparing VM execution against Native produced diffs:

- Commit: {{ env.COMMIT_SHA }}
- Block Start: {{ env.BLOCK_START }}
- Block End: {{ env.BLOCK_END }}
- Workflow URL: {{ env.WORKFLOW_URL }}

## Compare Output

The transaction were not compared in order. You should rerun the whole block to find the error root
The transaction were not compared in order. You should rerun the whole failing block to find the error root

```
{{ env.OUTPUT }}
```
- State Diffs Comparison: {{ env.COMPARISON_RESULT }}
8 changes: 4 additions & 4 deletions .github/scripts/check-git-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ latest_release=$(
)

current_release=$(
rg 'cairo-lang-sierra\s*=\s*(?:\{\s*git\s*=\s*"https://github.com/starkware-libs/cairo",\s*tag = "(.*?)"\s*\}|"(.*?)")' sierra2mlir/Cargo.toml -r '$1$2'
rg 'cairo-lang-sierra\s*=\s*(?:\{\s*git\s*=\s*"https://github.com/starkware-libs/cairo",\s*tag = "(.*?)"\s*\}|"(.*?)")' Cargo.toml -r '$1$2'
)

current_release_line=$(echo $current_release | cut -d':' -f1)
current_release_str=$(echo $current_release | cut -d':' -f2)

# Strip `v` prefix.
$current_release_str=$(echo $current_release_str | tr -d v)
$latest_release=$(echo $latest_release | tr -d v)
current_release_str=$(echo $current_release_str | tr -d v)
latest_release=$(echo $latest_release | tr -d v)

if [ "$current_release_str" != "$latest_release" && "v$current_release_str" != "$latest_release" ]; then
echo "::warning file=sierra2mlir/Cargo.toml,line=$current_release_line,endLine=$current_release_line,title=Outdated cairo dependency::Current release = $current_release_str, Upstream release = $latest_release"
echo "::warning file=Cargo.toml,line=$current_release_line,endLine=$current_release_line,title=Outdated cairo dependency::Current release = $current_release_str, Upstream release = $latest_release"
fi
31 changes: 11 additions & 20 deletions .github/workflows/bench-hyperfine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
sudo rm -rf /usr/share/dotnet/
sudo rm -rf /usr/local/lib/android
df -h
- uses: dtolnay/rust-toolchain@1.82.0
- uses: dtolnay/rust-toolchain@1.84.1
with:
components: clippy
- uses: Swatinem/rust-cache@v2
Expand Down Expand Up @@ -96,19 +96,12 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Cache binary
uses: actions/cache@v3
uses: actions/cache@v4.2.0
id: cache-binary
with:
path: bin/cairo-native-run-${{ matrix.branch }}
key: binary-${{ github.event.pull_request[matrix.branch].sha }}

- name: Cache runtime-library
uses: actions/cache@v3
id: cache-library
with:
path: lib/libcairo-native-runtime-${{ matrix.branch }}.a
key: library-${{ github.event.pull_request[matrix.branch].sha }}

- name: check and free hdd space left
if: ${{ steps.cache-binary.outputs.cache-hit != 'true' }}
run: |
Expand All @@ -131,7 +124,7 @@ jobs:
df -h
- name: Install Rust
if: ${{ steps.cache-binary.outputs.cache-hit != 'true' || steps.cache-library.outputs.cache-hit != 'true' }}
uses: dtolnay/rust-toolchain@1.82.0
uses: dtolnay/rust-toolchain@1.84.1
- name: add llvm deb repository
if: ${{ steps.cache-binary.outputs.cache-hit != 'true' || steps.cache-library.outputs.cache-hit != 'true' }}
uses: myci-actions/add-deb-repo@11
Expand Down Expand Up @@ -159,7 +152,6 @@ jobs:
make build
mkdir lib bin
cp target/release/cairo-native-run bin/cairo-native-run-${{ matrix.branch }}
cp target/release/libcairo_native_runtime.a lib/libcairo-native-runtime-${{ matrix.branch }}.a

run-bench:
env:
Expand All @@ -185,17 +177,11 @@ jobs:
tool: hyperfine@1.16

- name: Fetch ${{ matrix.branch }} binary
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4.2.0
with:
path: bin/cairo-native-run-${{ matrix.branch }}
key: binary-${{ github.event.pull_request[matrix.branch].sha }}

- name: Fetch ${{ matrix.branch }} runtime-library
uses: actions/cache/restore@v3
with:
path: lib/libcairo-native-runtime-${{ matrix.branch }}.a
key: library-${{ github.event.pull_request[matrix.branch].sha }}

- name: Run Program
run: |
make deps
Expand All @@ -208,7 +194,7 @@ jobs:
--export-json "${f%.*}.json" \
--warmup 3 \
-n "${{matrix.branch}} $(basename $f) (JIT)" "./bin/cairo-native-run-${{ matrix.branch }} --run-mode=jit -s $f --opt-level 3 --available-gas 18446744073709551615" \
-n "${{matrix.branch}} $(basename $f) (AOT)" "CAIRO_NATIVE_RUNTIME_LIBRARY=lib/libcairo-native-runtime-${{ matrix.branch }}.a ./bin/cairo-native-run-${{ matrix.branch }} --run-mode=aot -s $f --opt-level 3 --available-gas 18446744073709551615" \
-n "${{matrix.branch}} $(basename $f) (AOT)" "./bin/cairo-native-run-${{ matrix.branch }} --run-mode=aot -s $f --opt-level 3 --available-gas 18446744073709551615" \
>> /dev/stderr
done

Expand Down Expand Up @@ -238,11 +224,16 @@ jobs:
- name: Print tables
run: |
{
echo "${bold}Benchmark results Main vs HEAD.${normal}"
echo "## **Benchmark results Main vs HEAD.**"
for f in bench-results-base/*.md; do
echo "### Base"
echo
cat $f
echo
echo "### Head"
echo
cat bench-results-head/$(basename $f)
echo
done
} | tee -a comment_body.md

Expand Down
60 changes: 49 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.82.0
- uses: dtolnay/rust-toolchain@1.84.1
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
Expand All @@ -41,7 +41,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.82.0
- uses: dtolnay/rust-toolchain@1.84.1
with:
components: rustfmt
- run: cargo fmt --all -- --check
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
sudo rm -rf /usr/local/lib/android
df -h
- name: Setup rust env
uses: dtolnay/rust-toolchain@1.82.0
uses: dtolnay/rust-toolchain@1.84.1
- name: Retreive cached dependecies
uses: Swatinem/rust-cache@v2
- name: add llvm deb repository
Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Rustup toolchain install
uses: dtolnay/rust-toolchain@1.82.0
uses: dtolnay/rust-toolchain@1.84.1
with:
components: clippy
- name: Rust `$PATH` workaround.
Expand All @@ -175,7 +175,7 @@ jobs:
- name: Install scarb
uses: software-mansion/setup-scarb@v1
with:
scarb-version: "2.8.4"
scarb-version: "2.11.2"
- name: Install deps
run: make deps
- name: Run tests
Expand Down Expand Up @@ -225,7 +225,7 @@ jobs:
sudo rm -rf /usr/local/lib/android
df -h
- name: Setup rust env
uses: dtolnay/rust-toolchain@1.82.0
uses: dtolnay/rust-toolchain@1.84.1
- name: Retreive cached dependecies
uses: Swatinem/rust-cache@v2
- name: add llvm deb repository
Expand All @@ -243,14 +243,14 @@ jobs:
- name: Install scarb
uses: software-mansion/setup-scarb@v1
with:
scarb-version: "2.8.4"
scarb-version: "2.11.2"
- name: Install deps
run: make deps
- name: Build runtime and alexandria
run: make runtime-ci && make check-llvm && make needs-cairo2 && make build-alexandria
- name: Build alexandria
run: make check-llvm && make needs-cairo2 && make build-alexandria

- name: Run tests and generate coverage partition ${{ matrix.partition }}
run: cargo llvm-cov nextest --verbose --features=scarb --workspace --lcov --output-path ${{ matrix.output }} --partition count:${{ matrix.partition }}/4
run: cargo llvm-cov nextest --verbose --features=scarb --lcov --output-path ${{ matrix.output }} --partition count:${{ matrix.partition }}/4

- name: test and generate coverage corelib
if: ${{ matrix.partition == '1' }}
Expand Down Expand Up @@ -278,7 +278,7 @@ jobs:
needs: [coverage]
steps:
- name: Setup rust env
uses: dtolnay/rust-toolchain@1.80.0
uses: dtolnay/rust-toolchain@1.84.1
- name: Retreive cached dependencies
uses: Swatinem/rust-cache@v2
- name: Install testing tools
Expand Down Expand Up @@ -341,3 +341,41 @@ jobs:
df -h
- name: build image
run: docker build .

build-sierra-emu:
name: Build sierra-emu
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Retreive cached dependecies
uses: Swatinem/rust-cache@v2
- name: Install dependencies
run: |
make build-cairo-2-compiler
cd ./debug_utils/sierra-emu
make corelib
- name: Build
working-directory: ./debug_utils/sierra-emu
run: cargo build --all-features --verbose
- name: Run tests
working-directory: ./debug_utils/sierra-emu
run: make test-no-corelib
- name: Run corelib's tests
working-directory: ./debug_utils/sierra-emu
run: cargo test test_corelib -- --nocapture

build-sierra2casm-dbg:
name: Build sierra2casm-dbg
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Retreive cached dependecies
uses: Swatinem/rust-cache@v2
- name: Build
working-directory: ./debug_utils/casm-data-flow
run: cargo build --all-features --verbose
- name: Run tests
working-directory: ./debug_utils/casm-data-flow
run: cargo test
Loading