Skip to content
Merged
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
70 changes: 70 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Benchmarks

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: write
deployments: write

jobs:
benchmark:
name: Criterion benchmarks
# Use self-hosted for stable hardware (no noisy-neighbor variance).
# To use self-hosted: change to ["self-hosted", "linux", "x64"].
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo registry + build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: bench-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Detect CPU features
id: cpu
run: |
if grep -q avx512ifma /proc/cpuinfo 2>/dev/null; then
echo "rustflags=-C target-feature=+avx512ifma" >> "$GITHUB_OUTPUT"
echo "label=avx512" >> "$GITHUB_OUTPUT"
echo "::notice::AVX-512 IFMA detected — SIMD benchmarks enabled"
elif [ "$(uname -m)" = "aarch64" ]; then
echo "rustflags=" >> "$GITHUB_OUTPUT"
echo "label=neon" >> "$GITHUB_OUTPUT"
echo "::notice::aarch64 detected — NEON benchmarks enabled"
else
echo "rustflags=" >> "$GITHUB_OUTPUT"
echo "label=scalar" >> "$GITHUB_OUTPUT"
echo "::notice::No SIMD target features detected — scalar benchmarks"
fi

- name: Run benchmarks
env:
RUSTFLAGS: ${{ steps.cpu.outputs.rustflags }}
run: cargo bench --bench sumcheck -- --output-format bencher | tee output.txt

- name: Store benchmark results
uses: benchmark-action/github-action-benchmark@v1
with:
name: "Sumcheck Benchmarks (${{ steps.cpu.outputs.label }})"
tool: cargo
output-file-path: output.txt
# On push to main: commit results to gh-pages for trendline tracking.
# On PR: compare against main baseline and comment.
auto-push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
github-token: ${{ secrets.GITHUB_TOKEN }}
# Alert thresholds.
alert-threshold: "115%"
comment-on-alert: true
fail-on-alert: false
benchmark-data-dir-path: "dev/bench-${{ steps.cpu.outputs.label }}"
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
CARGO_TERM_COLOR: always

jobs:
check:
name: Build + Test + Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ci-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build
run: cargo build --release

- name: Clippy
run: cargo clippy --release -- -D warnings

- name: Tests
run: cargo test --release
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ jobs:
- name: Run tests
run: cargo test --verbose

test_with_no_default_features:
build_with_no_default_features:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Run tests
run: cargo test --verbose --no-default-features
- name: Build without arkworks
run: cargo build --verbose --no-default-features
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
**/lag-poly-benches/target/
.vscode
.DS_Store
.claude/
33 changes: 30 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,38 @@

All notable changes to this project will be documented in this file.

## [Unreleased]
## [Unreleased] — Canonical Rewrite

Major revision: unified API, one verifier, one proof type, 7 provers, SIMD acceleration.

### Breaking

- **Package renamed** from `efficient-sumcheck` to `effsc`.
- **Single verifier** — `sumcheck_verify()` returns `SumcheckResult { challenges, final_claim }`. The oracle check is the caller's responsibility ([Thaler Remark 4.2](https://people.cs.georgetown.edu/jthaler/ProofsArgsAndZK.pdf)). Removed `inner_product_sumcheck_verify`, `multilinear_sumcheck_verify`, and `coefficient_sumcheck::sumcheck_verify`.
- **Single proof type** — `SumcheckProof<F>` replaces `Sumcheck<F>` and `ProductSumcheck<F>`.
- **Transcript redesigned** — `send()`/`receive()`/`challenge()` replace `read()`/`write()`.
- **Legacy entry points demoted** — use `runner::sumcheck()` with a prover type.

### Added
- **Base/Extension field support**: `multilinear_sumcheck` and `inner_product_sumcheck` now take two type parameters `<BF, EF>` — base field for evaluations, extension field for challenges. Set `EF = BF` when no extension is needed.
- `pairwise::cross_field_reduce` — parallel helper for folding `BF` evaluations with an `EF` challenge.

- **`SumcheckProver<F>` trait** — single extension point for all polynomial shapes.
- **7 concrete provers** — `MultilinearProver`, `InnerProductProver`, `CoefficientProver` (each with MSB + LSB variants), `GkrProver`.
- **`SumcheckField` trait** — generic field interface; blanket impl for `ark_ff::Field` behind `feature = "arkworks"`.
- **`SimdRepr` trait** — safe SIMD opt-in with `zerocopy` layout verification.
- **`runner::sumcheck()`** — single runner with partial execution and per-round hooks.
- **Eq polynomial utilities** — `eq_poly`, `eq_poly_non_binary`, O(2^v) incremental `compute_hypercube_eq_evals`.
- **Adversarial verifier tests** — corrupted proofs, wrong sums, wrong final values across all prover types.
- **`no_std` support** — core library works without `arkworks` feature.
- **SIMD** — transparent 8-wide AVX-512 IFMA, 2-wide NEON acceleration.

### Integrations

- [WHIR](https://github.com/WizardOfMenlo/whir) ([PR #250](https://github.com/WizardOfMenlo/whir/pull/250))
- [WARP](https://github.com/compsec-epfl/warp) ([PR #24](https://github.com/compsec-epfl/warp/pull/24))

### Removed

- **~4,500 lines of legacy code** — old `Prover` trait, `TimeProver`/`SpaceProver`/`BlendyProver`, `OrderStrategy`, `messages/`, `interpolation/`, `simd_ops`.

## [0.0.2] - 2026-02-11

Expand Down
42 changes: 30 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,53 @@
[package]
name = "efficient-sumcheck"
name = "effsc"
version = "0.0.2"
authors = ["arkworks maintainers"]
description = "TODO"
repository = "https://github.com/compsec-epfl/space-efficient-sumcheck"
include = ["Cargo.toml", "src", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
edition = "2021"
rust-version = "1.81"

[dependencies]
ark-ff = "0.5.0"
ark-poly = "0.5.0"
ark-serialize = "0.5.0"
ark-std ="0.5.0"
ark-ff = { version = "0.5.0", optional = true }
ark-poly = { version = "0.5.0", optional = true }
ark-serialize = { version = "0.5.0", optional = true }
ark-std = { version = "0.5.0", optional = true }
memmap2 = "0.9.5"
nohash-hasher = "0.2.0"
rayon = { version = "1.10", optional = true }
spongefish = { git = "https://github.com/arkworks-rs/spongefish", branch = "main", features = ["ark-ff"] }
spongefish = { git = "https://github.com/z-tech/spongefish.git", branch = "smallfp-support", features = ["ark-ff"], optional = true }
zerocopy = { version = "0.8", features = ["derive"] }

[dev-dependencies]
criterion = "0.8"
p3-field = "0.5"
p3-goldilocks = "0.5"

[features]
default = ["parallel"]
default = ["arkworks", "parallel", "simd"]
arkworks = [
"dep:ark-ff",
"dep:ark-poly",
"dep:ark-serialize",
"dep:ark-std",
"dep:spongefish",
]
simd = []
parallel = [
"dep:rayon",
"ark-ff/parallel",
"ark-poly/parallel",
"ark-std/parallel",
"ark-ff?/parallel",
"ark-poly?/parallel",
"ark-std?/parallel",
]

[[bench]]
name = "provers"
path = "benches/provers.rs"
name = "sumcheck"
path = "benches/sumcheck.rs"
harness = false

[patch.crates-io]
ark-ff = { git = "https://github.com/arkworks-rs/algebra.git", branch = "master" }
ark-poly = { git = "https://github.com/arkworks-rs/algebra.git", branch = "master" }
ark-serialize = { git = "https://github.com/arkworks-rs/algebra.git", branch = "master" }
spongefish = { git = "https://github.com/z-tech/spongefish.git", branch = "smallfp-support" }
Loading
Loading