Skip to content

Tile shared GKR lookups across trees and preweight fold stashes #114

Not planned

Description

@wu-s-john

A tree-outer lookup traversal rereads the same large shared table for every tree. Repeated multiplication by common fold/equality weights also consumes work that can be prepared once.

This issue owns slot-tiled traversal and shared preweighted fold stashes for the existing lookup-prefix kernels.

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

  • Process bounded slot blocks outside the tree loop so a table tile is reused while resident in cache; keep each tree's accumulators independent.
  • Precompute only weights whose challenges are already available, and document the exact stash representation and live-prefix lifecycle.
  • Retain untiled/on-demand paths for small instances, and use public size/thread information for dispatch; do not assume one architecture's L1/L2 capacities.

Out of scope: changing lookup algebra, physical witness coordinates, transcript order, the global Rayon pool, or prefetch instructions (#115).

Potential impact

Tiling can replace repeated table streams with reuse across trees. Preweighting turns some materialization work into gathers/XORs instead of repeated field multiplications. Extra stash storage/build time must amortize; small shapes can be slower and need a measured fallback.

Done when

  • Tile and untiled implementations produce identical per-tree coefficients, fold outputs and final claims across partial tiles and supported table forms.
  • Complete proof/transcript bytes are unchanged across modes and worker counts; malformed dimensions and mutated proof/terminal claims remain rejected.
  • Test disjoint worker ownership, last-tile bounds, zero/one challenges and cache sizes smaller than the nominal tile.
  • Profile table traffic/cache misses, stash construction, retained bytes, materialization and full GKR; select thresholds using matched target runs.

Dependencies and coordination

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

Activity

  1. added
    enhancement
    cache
    difficulty: medium
    gkr
    lookup-tables
    optimization-port
    urgency: med
    on Sep 24, 2026
  2. zkfriendly commented on Nov 24, 2026

    @zkfriendly
    Collaborator

    Closing as premature / PoC-layout-specific: depends on #108 and #113 (closed), and #146's LutLayers::pieces already tiles by one LUT run per piece. Reopen if #108 profiling shows cache thrashing.

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

    cachedifficulty: mediumenhancementgkrlookup-tablesoptimization-porturgency: med

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions