Skip to content

perf(cache): prepare pairing points in parallel - #26

Closed
0xAndoroid wants to merge 1 commit into
mainfrom
perf/prepared-cache-parallel
Closed

0xAndoroid wants to merge 1 commit into
mainfrom
perf/prepared-cache-parallel

Conversation

@0xAndoroid

@0xAndoroid 0xAndoroid commented Aug 5, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

  • Build the G1/G2 prepared-point vectors concurrently with rayon::join; each vector uses par_iter.
  • Do all preparation outside the global cache write lock, then double-check before replacing the cache.
  • Keep the existing init_cache API and first-initializer-wins semantics.

No init_cache_prefix API is needed: Dory's prover setup already contains exactly 2^ceil(max_num_vars / 2) generators per group, the square-grid prefix consumed by the protocol.

Benchmarks

Apple M4, 10 cores, log_n = 34 (131,072 G1 + 131,072 G2 generators), release build:

main this PR change
init_cache 6.449 s 1.071 s median −83%, 6.0×

In the originating Jolt CPU campaign at 2^26, the same preparation tail fell from 16.2 s to 502 ms.

Verification

  • cargo nextest run --cargo-quiet --features backends,cache: 73/73
  • cargo nextest run --cargo-quiet --features backends,cache,zk: 130/130
  • clippy -D warnings (backends,cache,zk)
  • rustfmt

Companion to a16z/jolt#1737; Jolt will pin this commit until a crates.io release is available.

Authored with Claude Code.

@markosg04

Copy link
Copy Markdown
Collaborator

see #27

@markosg04 markosg04 closed this Aug 5, 2026
0xAndoroid added a commit to a16z/jolt that referenced this pull request Aug 14, 2026
Conflict resolutions:
- Cargo.toml: keep the a16z/dory#26 git pin (parallel prepared-point cache
  init); dory-pcs 0.4.1 on main does not contain that change (dory#26 is
  closed, 0.4.1 ships dory#27's routine ops only).
- Cargo.lock: main's lock + minimal re-resolve for the dory git source.
- tracer/src/execution_backend.rs: both sides are additive — keep the
  parallel Cycle->TraceRow conversion (this PR) alongside the chunked
  execution seam and its tests (#1728). mod tests keeps the unconditional
  expect(clippy::unwrap_used) for parallel_cycle_conversion_matches_serial.
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.

2 participants