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

Custom combine functions for sumcheck (ReturningValueProgram) in rust #798

Merged
merged 2 commits into from
Mar 5, 2025

Conversation

Koren-Brand
Copy link
Contributor

Fixed ReturningValueProgram creation in the rust wrapper
Added test checking Sumchek with a custom combine function

… with custom combine function

Signed-off-by: Koren-Brand <[email protected]>

// Friend function for C-api to have access to update the poly degree after generation
template <typename T>
friend void set_poly_degree(ReturningValueProgram<T>* program, int poly_degree);
Copy link
Contributor

Choose a reason for hiding this comment

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

move this function into generate_program.
implement new generate_program function at ReturningValueProgram that calls Program::generate_program and run the set poly degree code

(*program)->generate_program(parameters_vec);
set_poly_degree(*program, parameters_ptr[nof_parameters - 1]->m_operation->m_poly_degree);

ReleasePool<Symbol<scalar_t>>& pool = ReleasePool<Symbol<scalar_t>>::instance();
Copy link
Contributor

Choose a reason for hiding this comment

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

you can use ReleasePool<Symbol<scalar_t>>::instance().clear()

ProgramHandle program = *returning_program;
return CONCAT_EXPAND(FIELD, generate_program)(parameters_ptr, nof_parameters, &program);
*program = create_empty_returning_value_program<scalar_t>();
std::vector<Symbol<scalar_t>> parameters_vec;
Copy link
Contributor

Choose a reason for hiding this comment

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

all this code is replicated - use function

…api, inserting poly_degree change into returning program's generate function

Signed-off-by: Koren-Brand <[email protected]>
@Koren-Brand Koren-Brand requested a review from mickeyasa March 5, 2025 07:35
Copy link
Contributor

@mickeyasa mickeyasa left a comment

Choose a reason for hiding this comment

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

much better

@Koren-Brand Koren-Brand merged commit 0b28dfa into main Mar 5, 2025
16 checks passed
@Koren-Brand Koren-Brand deleted the koren/add-sumcheck-custom-combine-function branch March 5, 2025 12:27
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