Skip to content

Commit

Permalink
Update channel and change group_by to chunk_by
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmilson committed Mar 14, 2024
1 parent 6e9da20 commit f111623
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 30 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
components: rustfmt
toolchain: nightly-2024-01-04
toolchain: nightly-2024-03-10
- uses: Swatinem/rust-cache@v2
- run: scripts/rust_fmt.sh --check

Expand All @@ -38,7 +38,7 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
components: clippy
toolchain: nightly-2024-01-04
toolchain: nightly-2024-03-10
- uses: Swatinem/rust-cache@v2
- run: scripts/clippy.sh

Expand All @@ -48,7 +48,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-04
toolchain: nightly-2024-03-10
- uses: Swatinem/rust-cache@v2
- run: ./scripts/test_avx.sh

Expand All @@ -58,9 +58,9 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-04
toolchain: nightly-2024-03-10
- uses: Swatinem/rust-cache@v2
- run: cargo +nightly-2024-01-04 test
- run: cargo +nightly-2024-03-10 test

udeps:
runs-on: ubuntu-latest
Expand All @@ -69,7 +69,7 @@ jobs:
- uses: dtolnay/rust-toolchain@master
name: "Rust Toolchain Setup"
with:
toolchain: nightly-2024-01-04
toolchain: nightly-2024-03-10
- uses: Swatinem/rust-cache@v2
id: "cache-cargo"
- if: ${{ steps.cache-cargo.outputs.cache-hit != 'true' }}
Expand All @@ -78,19 +78,18 @@ jobs:
wget -O - -c https://github.com/est31/cargo-udeps/releases/download/v0.1.35/cargo-udeps-v0.1.35-x86_64-unknown-linux-gnu.tar.gz | tar -xz
cargo-udeps-*/cargo-udeps udeps
env:
RUSTUP_TOOLCHAIN: nightly-2024-01-04

RUSTUP_TOOLCHAIN: nightly-2024-03-10

all-tests:
runs-on: ubuntu-latest
needs:
- clippy
- format
- run-tests
- run-avx-tests
- udeps
- clippy
- format
- run-tests
- run-avx-tests
- udeps
steps:
- name: Decide whether all the needed jobs succeeded or failed
uses: re-actors/[email protected]
with:
jobs: ${{ toJSON(needs) }}
- name: Decide whether all the needed jobs succeeded or failed
uses: re-actors/[email protected]
with:
jobs: ${{ toJSON(needs) }}
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
components: rustfmt
toolchain: nightly-2024-01-04
toolchain: nightly-2024-03-10
- uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo +nightly-2024-01-04 llvm-cov --codecov --output-path codecov.json
run: cargo +nightly-2024-03-10 llvm-cov --codecov --output-path codecov.json
env:
RUSTFLAGS: "-C target-feature=+avx512f"
- name: Upload coverage to Codecov
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-2024-01-04"
channel = "nightly-2024-03-10"
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-2024-01-04 clippy "$@" --all-targets --all-features -- -D warnings -D future-incompatible \
cargo +nightly-2024-03-10 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-2024-01-04 fmt --all -- "$@"
cargo +nightly-2024-03-10 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-2024-01-04 test "$@"
RUSTFLAGS="-Awarnings -C target-cpu=native -C target-feature=+avx512f -C opt-level=2" cargo +nightly-2024-03-10 test "$@"
4 changes: 2 additions & 2 deletions src/core/fri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ impl<H: Hasher<NativeType = u8>> FriLayerVerifier<H> {
let mut all_subline_evals = Vec::new();

// Group queries by the subline they reside in.
for subline_queries in queries.group_by(|a, b| a >> FOLD_STEP == b >> FOLD_STEP) {
for subline_queries in queries.chunk_by(|a, b| a >> FOLD_STEP == b >> FOLD_STEP) {
let subline_start = (subline_queries[0] >> FOLD_STEP) << FOLD_STEP;
let subline_end = subline_start + (1 << FOLD_STEP);

Expand Down Expand Up @@ -816,7 +816,7 @@ impl<B: FriOps, H: Hasher<NativeType = u8>> FriLayerProver<B, H> {

// Group queries by the subline they reside in.
// TODO(andrew): Explain what a "subline" is at the top of the module.
for query_group in queries.group_by(|a, b| a >> FOLD_STEP == b >> FOLD_STEP) {
for query_group in queries.chunk_by(|a, b| a >> FOLD_STEP == b >> FOLD_STEP) {
let subline_start = (query_group[0] >> FOLD_STEP) << FOLD_STEP;
let subline_end = subline_start + (1 << FOLD_STEP);

Expand Down
9 changes: 4 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#![feature(
array_chunks,
iter_array_chunks,
exact_size_is_empty,
get_many_mut,
int_roundings,
is_sorted,
iter_array_chunks,
new_uninit,
slice_group_by,
stdsimd,
get_many_mut,
int_roundings
stdarch_x86_avx512
)]
pub mod commitment_scheme;
pub mod core;
Expand Down

0 comments on commit f111623

Please sign in to comment.