Skip to content

Commit

Permalink
bump toolchain and revert llvm issue patch
Browse files Browse the repository at this point in the history
  • Loading branch information
ohad-starkware committed Feb 6, 2025
1 parent a194fad commit 572d70a
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-01-02
toolchain: nightly-2025-02-05
- name: Run benchmark
run: ./scripts/bench.sh -- --output-format bencher | tee output.txt
- name: Download previous benchmark data
Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
components: rustfmt
toolchain: nightly-2025-01-02
toolchain: nightly-2025-02-05
- uses: Swatinem/rust-cache@v2
- run: scripts/rust_fmt.sh --check

Expand All @@ -36,7 +36,7 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
components: clippy
toolchain: nightly-2025-01-02
toolchain: nightly-2025-02-05
- uses: Swatinem/rust-cache@v2
- run: scripts/clippy.sh

Expand All @@ -46,17 +46,17 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-01-02
toolchain: nightly-2025-02-05
- uses: Swatinem/rust-cache@v2
- run: cargo +nightly-2025-01-02 doc
- run: cargo +nightly-2025-02-05 doc

run-wasm32-wasip1-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-01-02
toolchain: nightly-2025-02-05
targets: wasm32-wasip1
- uses: taiki-e/install-action@v2
with:
Expand All @@ -73,7 +73,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-01-02
toolchain: nightly-2025-02-05
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- uses: jetli/[email protected]
Expand All @@ -89,9 +89,9 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-01-02
toolchain: nightly-2025-02-05
- uses: Swatinem/rust-cache@v2
- run: cargo +nightly-2025-01-02 test
- run: cargo +nightly-2025-02-05 test
env:
RUSTFLAGS: -C target-feature=+neon

Expand All @@ -104,9 +104,9 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-01-02
toolchain: nightly-2025-02-05
- uses: Swatinem/rust-cache@v2
- run: cargo +nightly-2025-01-02 test
- run: cargo +nightly-2025-02-05 test
env:
RUSTFLAGS: -C target-cpu=native -C target-feature=+${{ matrix.target-feature }}

Expand All @@ -116,7 +116,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-01-02
toolchain: nightly-2025-02-05
- name: Run benchmark
run: |
cargo install cargo-criterion
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-01-02
toolchain: nightly-2025-02-05
- name: Run benchmark
run: |
cargo install cargo-criterion
Expand Down Expand Up @@ -172,29 +172,29 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-01-02
toolchain: nightly-2025-02-05
- uses: Swatinem/rust-cache@v2
- run: cargo +nightly-2025-01-02 test
- run: cargo +nightly-2025-02-05 test

run-slow-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-01-02
toolchain: nightly-2025-02-05
- uses: Swatinem/rust-cache@v2
- run: cargo +nightly-2025-01-02 test --release --features="slow-tests"
- run: cargo +nightly-2025-02-05 test --release --features="slow-tests"

run-tests-parallel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-01-02
toolchain: nightly-2025-02-05
- uses: Swatinem/rust-cache@v2
- run: cargo +nightly-2025-01-02 test --features="parallel"
- run: cargo +nightly-2025-02-05 test --features="parallel"

machete:
runs-on: ubuntu-latest
Expand All @@ -205,9 +205,9 @@ jobs:
toolchain: nightly-2024-01-04
- uses: Swatinem/rust-cache@v2
- name: Install Machete
run: cargo +nightly-2025-01-02 install --locked cargo-machete
run: cargo +nightly-2025-02-05 install --locked cargo-machete
- name: Run Machete (detect unused dependencies)
run: cargo +nightly-2025-01-02 machete
run: cargo +nightly-2025-02-05 machete

all-tests:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
components: rustfmt
toolchain: nightly-2025-01-02
toolchain: nightly-2025-02-05
- uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
# TODO: Merge coverage reports for tests on different architectures.
# <https://github.com/taiki-e/cargo-llvm-cov?tab=readme-ov-file#merge-coverages-generated-under-different-test-conditions>
- name: Generate code coverage
run: cargo +nightly-2025-01-02 llvm-cov --codecov --output-path codecov.json
run: cargo +nightly-2025-02-05 llvm-cov --codecov --output-path codecov.json
env:
RUSTFLAGS: "-C target-feature=+avx512f"
- name: Upload coverage to Codecov
Expand Down
3 changes: 0 additions & 3 deletions crates/prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ nonstandard-style = "deny"
rust-2018-idioms = "deny"
unused = "deny"

[lints.clippy]
missing_const_for_fn = "warn"

[[bench]]
harness = false
name = "bit_rev"
Expand Down
5 changes: 3 additions & 2 deletions crates/prover/src/core/backend/simd/circle.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::iter::zip;
use std::mem::transmute;
use std::ops::Div;
use std::simd::Simd;

use bytemuck::Zeroable;
Expand Down Expand Up @@ -76,7 +77,7 @@ impl SimdBackend {
mappings.reverse();
let n = mappings.len();
let n0 = (n - LOG_N_LANES as usize) / 2;
let n1 = (n - LOG_N_LANES as usize + 1) / 2;
let n1 = (n - LOG_N_LANES as usize).div_ceil(2);
let (ab, c) = mappings.split_at_mut(n1);
let (a, _b) = ab.split_at_mut(n0);
// Swap content of a,c.
Expand Down Expand Up @@ -391,7 +392,7 @@ fn slow_eval_at_point(
if poly.log_size() > CACHED_FFT_LOG_SIZE {
let n = mappings.len();
let n0 = (n - LOG_N_LANES as usize) / 2;
let n1 = (n - LOG_N_LANES as usize + 1) / 2;
let n1 = (n - LOG_N_LANES as usize).div(2);
let (ab, c) = mappings.split_at_mut(n1);
let (a, _b) = ab.split_at_mut(n0);
// Swap content of a,c.
Expand Down
3 changes: 1 addition & 2 deletions crates/prover/src/core/circle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ impl<F: Zero + Add<Output = F> + FieldExpOps + Sub<Output = F> + Neg<Output = F>
type Output = Self;

fn add(self, rhs: Self) -> Self::Output {
// TODO(ShaharS): Revert once Rust solves compiler [issue](https://github.com/rust-lang/rust/issues/134457).
let x = self.x.clone() * rhs.x.clone() + (-self.y.clone() * rhs.y.clone());
let x = self.x.clone() * rhs.x.clone() - self.y.clone() * rhs.y.clone();
let y = self.x * rhs.y + self.y * rhs.x;
Self { x, y }
}
Expand Down
2 changes: 1 addition & 1 deletion crates/prover/src/core/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ mod tests {
let folded_queries = queries.fold(n_folds);
let repeated_folded_queries = folded_queries
.iter()
.flat_map(|q| std::iter::repeat(q).take(ratio));
.flat_map(|q| std::iter::repeat_n(q, ratio));
for (query, folded_query) in queries.iter().zip(repeated_folded_queries) {
// Check only the x coordinate since folding might give you the conjugate point.
assert_eq!(
Expand Down
2 changes: 1 addition & 1 deletion crates/prover/src/core/vcs/blake2_merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl MerkleHasher for Blake2sMerkleHasher {
let padded_values = column_values
.iter()
.copied()
.chain(std::iter::repeat(BaseField::zero()).take(rem));
.chain(std::iter::repeat_n(BaseField::zero(), rem));
for chunk in padded_values.array_chunks::<16>() {
state = compress(
state,
Expand Down
2 changes: 1 addition & 1 deletion crates/prover/src/core/vcs/poseidon252_merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl MerkleHasher for Poseidon252MerkleHasher {
let padded_values = column_values
.iter()
.copied()
.chain(std::iter::repeat(BaseField::zero()).take(padding_length));
.chain(std::iter::repeat_n(BaseField::zero(), padding_length));
for chunk in padded_values.array_chunks::<ELEMENTS_IN_BLOCK>() {
let mut word = FieldElement252::default();
for x in chunk {
Expand Down
4 changes: 2 additions & 2 deletions crates/prover/src/examples/xor/gkr_lookups/accumulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl DynMle<SimdBackend> {

#[cfg(test)]
mod tests {
use std::iter::repeat;
use std::iter::repeat_n;

use num_traits::Zero;

Expand Down Expand Up @@ -183,6 +183,6 @@ mod tests {
B: MleOps<F>,
F: Field,
{
Mle::new(repeat(v).take(1 << n_variables).collect())
Mle::new(repeat_n(v, 1 << n_variables).collect())
}
}
8 changes: 4 additions & 4 deletions crates/prover/src/examples/xor/gkr_lookups/mle_eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ fn hadamard_product(
#[cfg(test)]
mod tests {
use std::array;
use std::iter::{repeat, zip};
use std::iter::{repeat_n, zip};

use itertools::{chain, Itertools};
use mle_coeff_column::{MleCoeffColumnComponent, MleCoeffColumnEval};
Expand Down Expand Up @@ -988,7 +988,7 @@ mod tests {
const EQ_EVAL_TRACE: usize = 0;
const AUX_TRACE: usize = 1;
let mut rng = SmallRng::seed_from_u64(0);
let mle = Mle::new(repeat(SecureField::one()).take(1 << N_VARIABLES).collect());
let mle = Mle::new(repeat_n(SecureField::one(), 1 << N_VARIABLES).collect());
let eval_point: [SecureField; N_VARIABLES] = array::from_fn(|_| rng.gen());
let mle_eval_point = MleEvalPoint::new(&eval_point);
let trace = build_trace(&mle, &eval_point, mle.eval_at_point(&eval_point));
Expand Down Expand Up @@ -1025,7 +1025,7 @@ mod tests {
const EQ_EVAL_TRACE: usize = 0;
const AUX_TRACE: usize = 1;
let mut rng = SmallRng::seed_from_u64(0);
let mle = Mle::new(repeat(SecureField::one()).take(1 << N_VARIABLES).collect());
let mle = Mle::new(repeat_n(SecureField::one(), 1 << N_VARIABLES).collect());
let eval_point: [SecureField; N_VARIABLES] = array::from_fn(|_| rng.gen());
let mle_eval_point = MleEvalPoint::new(&eval_point);
let trace = build_trace(&mle, &eval_point, mle.eval_at_point(&eval_point));
Expand Down Expand Up @@ -1062,7 +1062,7 @@ mod tests {
const EQ_EVAL_TRACE: usize = 0;
const AUX_TRACE: usize = 1;
let mut rng = SmallRng::seed_from_u64(0);
let mle = Mle::new(repeat(SecureField::one()).take(1 << N_VARIABLES).collect());
let mle = Mle::new(repeat_n(SecureField::one(), 1 << N_VARIABLES).collect());
let eval_point: [SecureField; N_VARIABLES] = array::from_fn(|_| rng.gen());
let mle_eval_point = MleEvalPoint::new(&eval_point);
let trace = build_trace(&mle, &eval_point, mle.eval_at_point(&eval_point));
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "nightly-2025-01-02"
channel = "nightly-2025-02-05"
2 changes: 1 addition & 1 deletion scripts/clippy.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
cargo +nightly-2025-01-02 clippy "$@" --all-targets --all-features -- -D warnings -D future-incompatible \
cargo +nightly-2025-02-05 clippy "$@" --all-targets --all-features -- -D warnings -D future-incompatible \
-D nonstandard-style -D rust-2018-idioms -D unused
2 changes: 1 addition & 1 deletion scripts/rust_fmt.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

cargo +nightly-2025-01-02 fmt --all -- "$@"
cargo +nightly-2025-02-05 fmt --all -- "$@"
2 changes: 1 addition & 1 deletion scripts/test_avx.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
# Can be used as a drop in replacement for `cargo test` with avx512f flag on.
# For example, `./scripts/test_avx.sh` will run all tests(not only avx).
RUSTFLAGS="-Awarnings -C target-cpu=native -C target-feature=+avx512f -C opt-level=2" cargo +nightly-2025-01-02 test "$@"
RUSTFLAGS="-Awarnings -C target-cpu=native -C target-feature=+avx512f -C opt-level=2" cargo +nightly-2025-02-05 test "$@"

0 comments on commit 572d70a

Please sign in to comment.