Skip to content

Use bit-selected lookup prefixes in the GKR sumcheck #108

Open

Description

@wu-s-john

The current GKR round kernel receives materialized field tables. Bit-affine leaves and the first product levels have only a small number of cases determined by packed witness bits.

This issue owns leaf, pair and four-leaf lookup-prefix kernels that delay dense field materialization while preserving the ordinary GKR round protocol.

Sources

The target repository's existing relation, field encoding, coordinate order, and transcript contracts are authoritative. The current target implementation determines compatibility; the PoC implementation is reference-only and must be re-derived against those contracts.

In scope

  • Derive shared weighted case products over the target GF(2^128) representation, including the both-set pair contribution and equality weights.
  • Use packed selecting bits for early messages/folds and materialize residues only at the documented transition to dense execution.
  • Keep every ordinary round boundary: absorb the existing round message, then derive its challenge, then update the prover state. Lookup preparation may not use future challenges.

Out of scope: univariate round skipping, changing degree bounds/encoding, new PCS handoffs, cache layout tuning (#113), and making private-data timing guarantees absent from the existing witness path.

Potential impact

The leaf message can replace per-tree multiplications with table selection/addition after shared preparation; two or three early variables may remain bit-driven. Setup must amortize across enough trees. Dense-memory savings overlap lazy storage and cannot be multiplied as independent gains.

Done when

  • Compare each message, folded residue and terminal evaluation with the eager reference, covering all bit patterns and zero/one/general challenges.
  • Prove byte-identical transcript/proof behavior across lookup/dense transitions; malformed proofs and terminal openings continue to reject.
  • Check shared-table dimensions and checked indexing for shallow/partial groups; unsupported shapes use the reference path.
  • Profile preparation, first messages, materialization and full GKR separately for narrow/wide forests, including allocation and peak memory.

Dependencies and coordination

Depends on #107, #58. Coordinate with #52. The GKR tracker #52 tracks the wider programme; this issue owns only the scoped implementation above.

Activity

  1. added
    enhancement
    difficulty: hard
    gkr
    optimization-port
    small-values
    sumcheck
    urgency: high
    on Sep 24, 2026
  2. zkfriendly commented on Nov 24, 2026

    @zkfriendly
    Collaborator

    Status update (main 34addac): partially implemented by #146 (f433296). Round 1 of layers 0, 1, and 2 (prove_lut_layer in crates/gkr/src/lib.rs) now reads nibbles and 16-entry lookup tables with bucketed eq sums (and open PR #152 splits EqTables for #58). Remaining scope: keeping rounds 2–3 bit-driven before materializing dense bound_children.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty: hardenhancementgkroptimization-portsmall-valuessumcheckurgency: high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions