Skip to content

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().

@kunxian-xia
Copy link
Collaborator

Previously, the "cuda" feature of openvm NativeSumcheck chip is broken. This is fixed in scroll-tech/openvm#33.

@kunxian-xia
Copy link
Collaborator

@darth-cy The total_trace_cells is larger than our current master which is not desirable. You can grep total_trace_cells in the raw log.

@kunxian-xia
Copy link
Collaborator

kunxian-xia commented Feb 10, 2026

As a comparison, the number of cells and instructions_executed in the 6th shard leaf prover before and after this PR is listed below.

pr #(total_trace_cells) instructions_executed
before 1_325_207_018 6424812
after 1_604_390_378 6017577

builder.set(&input_ctx, 5, Usize::from(1));
builder.set(&input_ctx, 6, Usize::from(4));
builder.set(&input_ctx, 7, Usize::from(0));
builder.set(&input_ctx, 8, Usize::from(999));
Copy link
Collaborator

Choose a reason for hiding this comment

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

we need to read from hint space to fetch the raw prod_out_evals / logup_out_evals.

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)

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