Skip to content

refactor: make buffer capabilities composable#266

Open
zkfriendly wants to merge 8 commits into
mainfrom
zkfr/buffer-abstraction-refactor
Open

refactor: make buffer capabilities composable#266
zkfriendly wants to merge 8 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 Buffer can evolve independently.
  • 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 ActiveBuffer 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 while preserving verifier transcript splits.

Notes For Reviewers

The main behavioral intent is unchanged: this is an abstraction/refactor PR aimed at making future non-CPU backends cleaner. Verifier-side paths still use host values where appropriate; prover-side reductions now keep more data in ActiveBuffer.

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 (6c7d3e6) with main (10aa7d0)

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
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