Skip to content

Make buffer capabilities composable#266

Merged
zkfriendly merged 10 commits into
mainfrom
zkfr/buffer-abstraction-refactor
Jul 20, 2026
Merged

Make buffer capabilities composable#266
zkfriendly merged 10 commits into
mainfrom
zkfr/buffer-abstraction-refactor

Conversation

@zkfriendly

@zkfriendly zkfriendly commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Refactors the buffer abstraction so backend capabilities are more composable and more protocol work can stay buffer-native.

  • Replace custom from_vec / from_slice constructors with standard From<Vec<T>> and From<&[T]> implementations.
  • Split host-transfer operations from field arithmetic so BufferOps and BufferMath are composable rather than hierarchical.
  • Move Merkle tree construction out of BufferOps into a dedicated Merklize trait.
  • Add buffer-native field helpers for common prover-side reductions: ones, bilinear_form, tensor_product, mat_vec, concat, eq_weights, and geometric challenge generation.
  • Store IRS evaluation matrices in Buffer and add values_buffer to avoid unnecessary readbacks in prover paths.
  • Update WHIR and CodeSwitch provers to use buffer-native random linear combinations and challenge groups.

Notes For Reviewers

geometric_challenge_groups is intended to match drawing one host geometric challenge and slicing it into contiguous groups, but without reading the sequence back from the backend.

@codspeed-hq

codspeed-hq Bot commented Jul 13, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 10 untouched benchmarks
⏩ 22 skipped benchmarks1


Comparing zkfr/buffer-abstraction-refactor (09c426f) with main (e5350eb)

Open in CodSpeed

Footnotes

  1. 22 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@zkfriendly
zkfriendly requested a review from recmo July 15, 2026 07:53

@shreyas-londhe shreyas-londhe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zkfriendly zkfriendly changed the title refactor: make buffer capabilities composable Make buffer capabilities composable Jul 20, 2026
@zkfriendly
zkfriendly merged commit 6251d42 into main Jul 20, 2026
7 checks passed
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