Skip to content

Conversation

@darth-cy
Copy link

@darth-cy darth-cy commented Sep 17, 2025

Summary

  • Add a custom opcode SUMCHECK_LAYER_EVAL for calculating layer evaluation.

    1. For GKR product iop, the main sumcheck has the form v'[b] = v[b,0] * v[b,1];
    2. For GKR logup iop, the main sumcheck has the form p'[b] = p[b,0]*q[b,1] + p[b,1]*q[b,0], q'[b] = q[b,0]*q[b,1]
  • The new added opcode supports two modes:

    1. calculate the expected evaluation of two types of sumchecks;
    2. calculate the expected value of next layer p[r] = eq(0,r)*p[0] + eq(1,r)*p[1].

Layout

Each row is able to process 1 product sumcheck or 1 logup sumcheck.

Performance

layout for new chip NativeSumcheck

air quotient deg prep cols main cols perm cols
NativeSumcheckAir Quotient Deg = 2 Prep Cols = 0 Main Cols = [110] Perm Cols = [132]

@darth-cy darth-cy marked this pull request as draft September 25, 2025 20:09
@darth-cy darth-cy marked this pull request as ready for review September 29, 2025 01:56
@kunxian-xia kunxian-xia self-requested a review November 6, 2025 01:53

self.memory_bridge
.read(
MemoryAddress::new(self.address_space, register_ptrs[0] + AB::F::from_canonical_usize(EXT_DEG * 2 - 1) + curr_prod_n),

Choose a reason for hiding this comment

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

why -1 ?

Choose a reason for hiding this comment

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

I see, since curr_prod_n starts from 1.

Copy link
Author

Choose a reason for hiding this comment

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

The formula is rewritten to make sure it's clear the -1 is grouped with curr_prod_n. Comment added.


self.memory_bridge
.read(
MemoryAddress::new(self.address_space, register_ptrs[0] + AB::F::from_canonical_usize(EXT_DEG * 2 - 1) + ctx[1] + curr_logup_n),
Copy link

@kunxian-xia kunxian-xia Nov 17, 2025

Choose a reason for hiding this comment

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

why -1?

Copy link
Author

Choose a reason for hiding this comment

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

The formula is rewritten to make sure it's clear the -1 is grouped with curr_logup_n. Comment added.

@kunxian-xia kunxian-xia mentioned this pull request Nov 19, 2025
8 tasks
@kunxian-xia kunxian-xia merged commit 8c2d257 into main Nov 25, 2025
2 of 28 checks passed
@kunxian-xia kunxian-xia mentioned this pull request Nov 27, 2025
kunxian-xia added a commit that referenced this pull request Nov 30, 2025
* wip

* wip2

* wip3

* wip4

* wip5

* replace variable position by name

* wip6

* wip7

* clippy

* wip8

* wip9

* wip10

* wip11

* wip12

* wip13

* wip14

* wip15

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