Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor multi_open APIs #265

Merged
merged 6 commits into from
May 23, 2023
Merged

Refactor multi_open APIs #265

merged 6 commits into from
May 23, 2023

Conversation

alxiong
Copy link
Contributor

@alxiong alxiong commented May 22, 2023

Description

closes: #260

Each commit and commit message should be informative enough, and best reviewed per commit.
Extra note: #260 (comment)


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (main)
  • Linked to GitHub issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the GitHub PR explorer

Copy link
Contributor

@mrain mrain left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Contributor

@ggutoski ggutoski left a comment

Choose a reason for hiding this comment

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

looks good. A couple of minor notes for later. Haven't had a chance yet to test downstream use of the API but I'm happy to merge now and revisit later if needed.

@@ -234,7 +237,35 @@ pub trait UnivariatePCS:
),
PCSError,
> {
srs.borrow().trim(checked_fft_size(supported_degree)?)
let fft_degree = checked_fft_size(supported_degree)?;
srs.borrow().trim(fft_degree).map_err(|e| {
Copy link
Contributor

Choose a reason for hiding this comment

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

Technical debt for later: I think cruft such as this can be avoided with thiserror/anyhow. We should be able to automatically build a stack trace using only the ? operator.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, maybe we can revise later. (Need to improve err reporting as a whole anyway)

if self.coeffs.len() > domain.size() {
Err(PrimitivesError::ParameterError(
ark_std::format!(
"Polynomial with {} num_of_coeffs can't be evaluated on a smaller domain with size {}",
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious: Why do you no longer support domain size < degree? (I don't think it matters much anyway---most use cases will have domain size >= degree.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not disallowing num_points < degree, but to ensure domain is proper. When you instantiate multi_open_rou_eval_domain(), you should get a big enough domain. The "truncating to num_points" happen outside (of poly.rs, and in our context, inside univariateKzgPcs impl)

@alxiong alxiong merged commit 3eb332a into main May 23, 2023
3 checks passed
@alxiong alxiong deleted the multi-open-refactor branch May 23, 2023 16:39
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.

Quality-of-life improvements for multi_open_rou
3 participants