Skip to content

Restore multi-threaded parallelism in NeutronNova prove#123

Merged
srinathsetty merged 1 commit into
mainfrom
fix/restore-neutronnova-parallelism
Apr 28, 2026
Merged

Restore multi-threaded parallelism in NeutronNova prove#123
srinathsetty merged 1 commit into
mainfrom
fix/restore-neutronnova-parallelism

Conversation

@srinathsetty
Copy link
Copy Markdown
Collaborator

The optimizations in baac9f5 inadvertently serialized several parallel operations in the NeutronNova prover, causing a ~2x regression on multi-core machines while improving single-threaded performance.

This commit restores parallelism in four areas without affecting the single-threaded optimizations:

  1. Rerandomization: par_iter_mut() for step circuit rerandomization
  2. Instance/witness generation: rayon::join + par_iter_mut with order-preserving collect (not try_reduce, which scrambles order)
  3. Non-i64 NIFS rounds 1+: parallel fold+prove via par_chunks_mut on A/B/C layers (mirrors the existing i64 path structure)
  4. Witness fold in evaluation claims: restore par_iter for the folded_W + core_witness linear combination

Benchmark (32 circuits x 1024B SHA-256, target-cpu=native):

         Old       baac9f59     This commit

1 thread: 11003 ms 6849 ms 6738 ms
16 thread: 1752 ms 3732 ms 1318 ms

The optimizations in baac9f5 inadvertently serialized several
parallel operations in the NeutronNova prover, causing a ~2x regression
on multi-core machines while improving single-threaded performance.

This commit restores parallelism in four areas without affecting the
single-threaded optimizations:

1. Rerandomization: par_iter_mut() for step circuit rerandomization
2. Instance/witness generation: rayon::join + par_iter_mut with
   order-preserving collect (not try_reduce, which scrambles order)
3. Non-i64 NIFS rounds 1+: parallel fold+prove via par_chunks_mut
   on A/B/C layers (mirrors the existing i64 path structure)
4. Witness fold in evaluation claims: restore par_iter for the
   folded_W + core_witness linear combination

Benchmark (32 circuits x 1024B SHA-256, target-cpu=native):

             Old       baac9f5     This commit
  1 thread:  11003 ms   6849 ms      6738 ms
 16 thread:   1752 ms   3732 ms      1318 ms
@srinathsetty srinathsetty merged commit 9a90e3a into main Apr 28, 2026
10 checks passed
@srinathsetty srinathsetty deleted the fix/restore-neutronnova-parallelism branch April 28, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant