Skip to content

Optimize dense q1 row dot products#208

Open
Kuhai9801 wants to merge 4 commits into
NethermindEth:mainfrom
Kuhai9801:feature/dense-q1-row-dot-products
Open

Optimize dense q1 row dot products#208
Kuhai9801 wants to merge 4 commits into
NethermindEth:mainfrom
Kuhai9801:feature/dense-q1-row-dot-products

Conversation

@Kuhai9801

@Kuhai9801 Kuhai9801 commented Jun 6, 2026

Copy link
Copy Markdown

🚀 What’s this PR do?

Refs #134.

This replaces #201. That PR only helped the Boolean/one-hot equality-table case, while the normal PCS path uses transcript-random dense q_1.

This PR optimizes the prover-side b_j = <poly_comb_r[j], q_1> computation in ZipPlus::prove_f for dense q_1. It prepares q_1 once in Montgomery form and avoids the full field conversion for every CombR coefficient, while preserving the existing field-lift result and transcript layout.


📎 Related issues

Refs #134

🧠 Context

The scope is the prover prove_f row-dot-product hotspot from #134. This does not claim to optimize the verifier TODO path.

Benchmarked in Codespace on AMD EPYC 7763, rustc 1.96.0, base 4454d6c.

Benchmark Base Head Change
RAA BPoly<63> batch 1 2^16 33.650 ms 22.667 ms -32.64%
RAA BPoly<63> batch 2 2^16 67.430 ms 45.548 ms -32.45%
RAA BPoly<63> batch 5 2^16 173.300 ms 117.600 ms -32.14%
IPRS BPoly<63> batch 1 2^13 4.5424 ms 3.4673 ms -23.67%

✅ Checklist

  • I’ve tested this locally
  • I’ve added relevant docs or comments
  • I’ve updated or created tests if needed
  • The branch with the feature is named feature/<name>

@Kuhai9801 Kuhai9801 mentioned this pull request Jun 6, 2026
4 tasks
@Kuhai9801 Kuhai9801 marked this pull request as ready for review June 9, 2026 04:00
# Conflicts:
#	protocol/src/lib.rs
#	zip-plus/benches/zip_common.rs
#	zip-plus/src/pcs/phase_prove.rs
#	zip-plus/src/pcs/test_utils.rs
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