Skip to content

Commit

Permalink
Update toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmilson authored and alon-dotan-starkware committed Nov 24, 2024
1 parent 8c8b744 commit ef2e190
Show file tree
Hide file tree
Showing 59 changed files with 521 additions and 500 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/benchmarks-pages.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name:
name:

on:
push:
Expand All @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-04
toolchain: nightly-2024-11-06
- name: Run benchmark
run: ./scripts/bench.sh -- --output-format bencher | tee output.txt
- name: Download previous benchmark data
Expand All @@ -29,7 +29,7 @@ jobs:
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'cargo'
tool: "cargo"
output-file-path: output.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
39 changes: 21 additions & 18 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-2024-01-04
toolchain: nightly-2024-11-06
- 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-2024-01-04
toolchain: nightly-2024-11-06
- 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-2024-01-04
toolchain: nightly-2024-11-06
- uses: Swatinem/rust-cache@v2
- run: cargo +nightly-2024-01-04 doc
- run: cargo +nightly-2024-11-06 doc

run-wasm32-wasi-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-04
toolchain: nightly-2024-11-06
targets: wasm32-wasi
- 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-2024-01-04
toolchain: nightly-2024-11-06
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-2024-01-04
toolchain: nightly-2024-11-06
- uses: Swatinem/rust-cache@v2
- run: cargo +nightly-2024-01-04 test
- run: cargo +nightly-2024-11-06 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-2024-01-04
toolchain: nightly-2024-11-06
- uses: Swatinem/rust-cache@v2
- run: cargo +nightly-2024-01-04 test
- run: cargo +nightly-2024-11-06 test
env:
RUSTFLAGS: -C target-cpu=native -C target-feature=+${{ matrix.target-feature }}

Expand All @@ -116,9 +116,12 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-04
toolchain: nightly-2024-11-06
- name: Run benchmark
run: ./scripts/bench.sh -- --output-format bencher | tee output.txt
env:
RUST_MIN_STACK: 16777216
A: 2
- name: Download previous benchmark data
uses: actions/cache@v4
with:
Expand All @@ -142,7 +145,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-04
toolchain: nightly-2024-11-06
- name: Run benchmark
run: ./scripts/bench.sh --features="parallel" -- --output-format bencher | tee output.txt
- name: Download previous benchmark data
Expand All @@ -168,29 +171,29 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-04
toolchain: nightly-2024-11-06
- uses: Swatinem/rust-cache@v2
- run: cargo +nightly-2024-01-04 test
- run: cargo +nightly-2024-11-06 test

run-slow-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-04
toolchain: nightly-2024-11-06
- uses: Swatinem/rust-cache@v2
- run: cargo +nightly-2024-01-04 test --release --features="slow-tests"
- run: cargo +nightly-2024-11-06 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-2024-01-04
toolchain: nightly-2024-11-06
- uses: Swatinem/rust-cache@v2
- run: cargo +nightly-2024-01-04 test --features="parallel"
- run: cargo +nightly-2024-11-06 test --features="parallel"

machete:
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-2024-01-04
toolchain: nightly-2024-11-06
- 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-2024-01-04 llvm-cov --codecov --output-path codecov.json
run: cargo +nightly-2024-11-06 llvm-cov --codecov --output-path codecov.json
env:
RUSTFLAGS: "-C target-feature=+avx512f"
- name: Upload coverage to Codecov
Expand Down
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions crates/prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ blake2.workspace = true
blake3.workspace = true
bytemuck = { workspace = true, features = ["derive", "extern_crate_alloc"] }
cfg-if = "1.0.0"
downcast-rs = "1.2"
educe.workspace = true
hex.workspace = true
itertools.workspace = true
Expand Down Expand Up @@ -56,9 +55,6 @@ nonstandard-style = "deny"
rust-2018-idioms = "deny"
unused = "deny"

[package.metadata.cargo-machete]
ignored = ["downcast-rs"]

[[bench]]
harness = false
name = "bit_rev"
Expand Down
14 changes: 8 additions & 6 deletions crates/prover/benches/fft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub fn simd_ifft(c: &mut Criterion) {
|| values.clone().data,
|mut data| unsafe {
ifft(
transmute(data.as_mut_ptr()),
transmute::<*mut PackedBaseField, *mut u32>(data.as_mut_ptr()),
black_box(&twiddle_dbls_refs),
black_box(log_size as usize),
);
Expand Down Expand Up @@ -58,7 +58,7 @@ pub fn simd_ifft_parts(c: &mut Criterion) {
|| values.clone().data,
|mut values| unsafe {
ifft_vecwise_loop(
transmute(values.as_mut_ptr()),
transmute::<*mut PackedBaseField, *mut u32>(values.as_mut_ptr()),
black_box(&twiddle_dbls_refs),
black_box(9),
black_box(0),
Expand All @@ -72,7 +72,7 @@ pub fn simd_ifft_parts(c: &mut Criterion) {
|| values.clone().data,
|mut values| unsafe {
ifft3_loop(
transmute(values.as_mut_ptr()),
transmute::<*mut PackedBaseField, *mut u32>(values.as_mut_ptr()),
black_box(&twiddle_dbls_refs[3..]),
black_box(7),
black_box(4),
Expand All @@ -91,7 +91,7 @@ pub fn simd_ifft_parts(c: &mut Criterion) {
|| transpose_values.clone().data,
|mut values| unsafe {
transpose_vecs(
transmute(values.as_mut_ptr()),
transmute::<*mut PackedBaseField, *mut u32>(values.as_mut_ptr()),
black_box(TRANSPOSE_LOG_SIZE as usize - 4),
)
},
Expand All @@ -115,8 +115,10 @@ pub fn simd_rfft(c: &mut Criterion) {
target.set_len(values.data.len());

fft(
black_box(transmute(values.data.as_ptr())),
transmute(target.as_mut_ptr()),
black_box(transmute::<*const PackedBaseField, *const u32>(
values.data.as_ptr(),
)),
transmute::<*mut PackedBaseField, *mut u32>(target.as_mut_ptr()),
black_box(&twiddle_dbls_refs),
black_box(LOG_SIZE as usize),
)
Expand Down
2 changes: 1 addition & 1 deletion crates/prover/benches/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn bench_blake2s_merkle<B: MerkleOps<Blake2sMerkleHasher>>(c: &mut Criterion, id
let n_elements = 1 << (LOG_N_COLS + LOG_N_ROWS);
group.throughput(Throughput::Elements(n_elements));
group.throughput(Throughput::Bytes(N_BYTES_FELT as u64 * n_elements));
group.bench_function(&format!("{id} merkle"), |b| {
group.bench_function(format!("{id} merkle"), |b| {
b.iter_with_large_drop(|| B::commit_on_layer(LOG_N_ROWS, None, &col_refs))
});
}
Expand Down
2 changes: 1 addition & 1 deletion crates/prover/src/constraint_framework/assert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl<'a> AssertEvaluator<'a> {
}
}
}
impl<'a> EvalAtRow for AssertEvaluator<'a> {
impl EvalAtRow for AssertEvaluator<'_> {
type F = BaseField;
type EF = SecureField;

Expand Down
5 changes: 3 additions & 2 deletions crates/prover/src/constraint_framework/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ impl TraceLocationAllocator {
}

/// A component defined solely in means of the constraints framework.
///
/// Implementing this trait introduces implementations for [`Component`] and [`ComponentProver`] for
/// the SIMD backend.
/// Note that the constraint framework only support components with columns of the same size.
/// the SIMD backend. Note that the constraint framework only supports components with columns of
/// the same size.
pub trait FrameworkEval {
fn log_size(&self) -> u32;

Expand Down
2 changes: 1 addition & 1 deletion crates/prover/src/constraint_framework/cpu_domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl<'a> CpuDomainEvaluator<'a> {
}
}

impl<'a> EvalAtRow for CpuDomainEvaluator<'a> {
impl EvalAtRow for CpuDomainEvaluator<'_> {
type F = BaseField;
type EF = SecureField;

Expand Down
2 changes: 1 addition & 1 deletion crates/prover/src/constraint_framework/logup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ pub struct LogupColGenerator<'a> {
/// Numerator expressions (i.e. multiplicities) being generated for the current lookup.
numerator: SecureColumnByCoords<SimdBackend>,
}
impl<'a> LogupColGenerator<'a> {
impl LogupColGenerator<'_> {
/// Write a fraction to the column at a row.
pub fn write_frac(
&mut self,
Expand Down
2 changes: 1 addition & 1 deletion crates/prover/src/constraint_framework/point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl<'a> PointEvaluator<'a> {
}
}
}
impl<'a> EvalAtRow for PointEvaluator<'a> {
impl EvalAtRow for PointEvaluator<'_> {
type F = SecureField;
type EF = SecureField;

Expand Down
2 changes: 1 addition & 1 deletion crates/prover/src/constraint_framework/simd_domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl<'a> SimdDomainEvaluator<'a> {
}
}
}
impl<'a> EvalAtRow for SimdDomainEvaluator<'a> {
impl EvalAtRow for SimdDomainEvaluator<'_> {
type F = VeryPackedBaseField;
type EF = VeryPackedSecureField;

Expand Down
3 changes: 2 additions & 1 deletion crates/prover/src/core/air/accumulation.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Accumulators for a random linear combination of circle polynomials.
//!
//! Given N polynomials, u_0(P), ... u_{N-1}(P), and a random alpha, the combined polynomial is
//! defined as
//! f(p) = sum_i alpha^{N-1-i} u_i(P).
Expand Down Expand Up @@ -162,7 +163,7 @@ pub struct ColumnAccumulator<'a, B: Backend> {
pub random_coeff_powers: Vec<SecureField>,
pub col: &'a mut SecureColumnByCoords<B>,
}
impl<'a> ColumnAccumulator<'a, CpuBackend> {
impl ColumnAccumulator<'_, CpuBackend> {
pub fn accumulate(&mut self, index: usize, evaluation: SecureField) {
let val = self.col.at(index) + evaluation;
self.col.set(index, val);
Expand Down
4 changes: 2 additions & 2 deletions crates/prover/src/core/air/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::core::ColumnVec;

pub struct Components<'a>(pub Vec<&'a dyn Component>);

impl<'a> Components<'a> {
impl Components<'_> {
pub fn composition_log_degree_bound(&self) -> u32 {
self.0
.iter()
Expand Down Expand Up @@ -55,7 +55,7 @@ impl<'a> Components<'a> {

pub struct ComponentProvers<'a, B: Backend>(pub Vec<&'a dyn ComponentProver<B>>);

impl<'a, B: Backend> ComponentProvers<'a, B> {
impl<B: Backend> ComponentProvers<'_, B> {
pub fn components(&self) -> Components<'_> {
Components(self.0.iter().map(|c| *c as &dyn Component).collect_vec())
}
Expand Down
8 changes: 4 additions & 4 deletions crates/prover/src/core/air/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ mod components;
pub mod mask;

/// Arithmetic Intermediate Representation (AIR).
/// An Air instance is assumed to already contain all the information needed to
/// evaluate the constraints.
/// For instance, all interaction elements are assumed to be present in it.
/// Therefore, an AIR is generated only after the initial trace commitment phase.
///
/// An Air instance is assumed to already contain all the information needed to evaluate the
/// constraints. For instance, all interaction elements are assumed to be present in it. Therefore,
/// an AIR is generated only after the initial trace commitment phase.
pub trait Air {
fn components(&self) -> Vec<&dyn Component>;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/prover/src/core/backend/cpu/lookups/gkr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ enum MleExpr<'a, F: Field> {
Mle(&'a Mle<CpuBackend, F>),
}

impl<'a, F: Field> Index<usize> for MleExpr<'a, F> {
impl<F: Field> Index<usize> for MleExpr<'_, F> {
type Output = F;

fn index(&self, index: usize) -> &F {
Expand Down
Loading

0 comments on commit ef2e190

Please sign in to comment.