Conversation
Below 2^10 nodes the rayon dispatch costs more than the fold itself; use the serial chunk iterator there (Plonky3 uses the same 1024-node threshold). Output is identical; neutral on large-cache hosts and helps hosts where dispatch dominates the small fold layers.
PR SummaryLow Risk Overview The per-chunk SIMD Blake2 compress/transpose logic is unchanged but moved into a shared Reviewed by Cursor Bugbot for commit 6dd7dd2. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1459 +/- ##
=======================================
Coverage 91.76% 91.77%
=======================================
Files 127 127
Lines 15173 15177 +4
Branches 15173 15177 +4
=======================================
+ Hits 13924 13928 +4
Misses 1180 1180
Partials 69 69 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Withdrawing for the time being — the author needs to run an internal review before this is considered for submission. Will resubmit (or a maintainer can pick the idea up) after that review. Thanks for the CI run. |
What
crates/stwo/src/prover/backend/simd/blake2s_lifted.rs,build_next_layer: use the serial chunk iterator below2^10nodes instead of dispatching rayon for the small fold layers. The pristine code dispatchespar_chunks_mutdown to single-node layers; Plonky3 uses the same 1024-node serial threshold.The per-chunk work is refactored into a
workclosure shared by the parallel and serial arms; behavior is identical either way.Why
Verification
cargo +nightly-2026-01-15 test -p stwo --release --features prover,parallel --lib: 267/267 pass (and with--features prover).cargo +nightly-2026-01-15 clippy -p stwo --features prover,parallel -- -D warnings: clean (note:&closuretripsneedless_borrows_for_generic_argson this nightly — the closure is passed by value).cargo fmt --check: clean.Stacked after nothing — independent of #1458.