Skip to content

Use NativeSumcheck for calculating initial_sum#1249

Open
darth-cy wants to merge 47 commits intomasterfrom
feat/sum_replace
Open

Use NativeSumcheck for calculating initial_sum#1249
darth-cy wants to merge 47 commits intomasterfrom
feat/sum_replace

Conversation

@darth-cy
Copy link
Collaborator

@darth-cy darth-cy commented Jan 29, 2026

Optimization for Calculating Initial Sum in tower verify.

  • Remove dot product logic for calculating initial_sum. Use NativeSumcheck instead.
  • Flatten out evaluation arrays.
  • Remove arithmetic utilities no longer required.

Optimization for NativeSumcheck

  • Use the additional mode on NativeSumcheck chip that allows passing in hint space IDs for evaluation inputs instead of loading concrete witness arrays. This significantly reduces cycles involved in loading witnesses.

@kunxian-xia
Copy link
Collaborator

Please check scroll-tech/openvm#30 for new semantic of builder.sumcheck_layer_eval().

let op_range: RVar<C::N> = builder.eval_expr(max_num_variables - Usize::from(1));
let round: Felt<C::F> = builder.constant(C::F::ZERO);

let next_rt = PointAndEvalVariable {
Copy link
Collaborator

Choose a reason for hiding this comment

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

it seems next_rt could be replaced with curr_pt and curr_eval

@hero78119
Copy link
Collaborator

hero78119 commented Feb 13, 2026

new after benchmark result

[info]: instructions_executed=5391876
┝━ i [info]: total_trace_cells = 1_577_651_690 (excluding preprocessed)

@hero78119
Copy link
Collaborator

hero78119 commented Feb 25, 2026

Confirmed total trace cell dropped to previous level after latest change

INFO     │  │  │  ┝━ i [info]: instructions_executed=5393514
┝━ i [info]: total_trace_cells = 1_311_247_850 (excluding preprocessed)

@kunxian-xia kunxian-xia added this pull request to the merge queue Feb 26, 2026
@kunxian-xia kunxian-xia removed this pull request from the merge queue due to a manual request Feb 26, 2026
let n_v = builder.get(&num_variables, 0);
builder.set(&input_ctx, 8, n_v);
builder.set(&input_ctx, 9, Usize::from(0));
builder.set(&input_ctx, 9, Usize::from(1));
Copy link
Collaborator

Choose a reason for hiding this comment

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

read from hint space and then write it to heap.

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