Skip to content

Optimize prove_f row products#200

Closed
Kuhai9801 wants to merge 2 commits into
NethermindEth:mainfrom
Kuhai9801:optimize-prove-f-row-products
Closed

Optimize prove_f row products#200
Kuhai9801 wants to merge 2 commits into
NethermindEth:mainfrom
Kuhai9801:optimize-prove-f-row-products

Conversation

@Kuhai9801

Copy link
Copy Markdown

Summary

  • lift q_1 into Zt::CombR once when the conversion is safe
  • compute per-row products in the integer ring instead of repeated field conversion
  • fall back to the existing field inner product path when conversion is unavailable or checked accumulation overflows
  • add focused coverage for direct prove_f usage and field-element integer parsing

Verification

  • cargo fmt -p zip-plus --all
  • cargo test -p zip-plus --lib phase_prove -- --nocapture
  • cargo test -p zip-plus --lib phase_verify -- --nocapture
  • cargo check -p zinc-protocol

@Kuhai9801 Kuhai9801 marked this pull request as draft May 31, 2026 07:38
@Kuhai9801 Kuhai9801 marked this pull request as ready for review May 31, 2026 08:01
@albert-garreta

albert-garreta commented Jun 2, 2026

Copy link
Copy Markdown
Member

@Kuhai9801 thanks for the PR! Do you know how much it improves the prover time?

@Kuhai9801

Copy link
Copy Markdown
Author

Thanks @albert-garreta for asking for concrete prover-time numbers here. I opened #201 as a narrower replacement that uses the one-hot structure of Boolean equality tensors in ZipPlus::prove_f and keeps the dense fallback for non-Boolean points.

The PR body includes Criterion results from the existing Zip+ prove benchmarks. On BPoly<63>, the measured speedups are 1.28x for RAA batch 1 at 2^16, 1.36x for RAA batch 5 at 2^16, and 4.59x for IPRS batch 1 at 2^13.

frozenspider added a commit that referenced this pull request Jun 11, 2026
Adopt changed introduced in
NethermindEth/crypto-primitives#33.
This enables lifting field elements to integers - attempt to do that was
done in #200.
Instead of writing `field.inner` to transcription, write
`field.lift_to_integer`. This has no observable impact on UAIR benchmark
performance.
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.

3 participants