Repository navigation
Description
The target constructs bit-affine leaves and retains every grand-product level. Its reduction path explicitly leaves lazy lower layers as a TODO.
This issue owns lazy forest construction and on-demand regeneration of omitted lower layers, with eager execution retained as the correctness oracle and fallback.
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
- Define L2/L4/L8 storage schedules against the target's actual variable/column order, including minimum valid depths and final leaf handoff.
- Share public bit-affine case tables across trees; retain only necessary upper products and reconstruct each requested lower layer from packed witness bits.
- Keep roots, sumcheck messages, closing pairs and terminal claims unchanged. A schedule is prover-local metadata and must not influence Fiat–Shamir challenges.
Out of scope: arity-four proofs, new GKR relations, transcript changes, hardware kernels, and automatic platform tuning (#116).
Potential impact
For N leaves, the PoC's dominant tree-storage terms are about 8N/4N/2N bytes versus about 32N eager bytes. These are buffer estimates, not total RSS or speedups; shared lookup tables, scratch and reconstruction work remain. L8 may trade latency for memory.
Done when
- Differentially compare every reconstructed layer, root and final evaluation with eager execution across tall, shallow, singleton and padded shapes.
- For fixed inputs/transcript seeds, all supported schedules produce byte-identical proofs and terminal claims. Tampered roots, layer messages, closing pairs and terminal openings still reject.
- Reject unsupported schedule/depth combinations and overflowed geometry; no private value selects the schedule.
- Measure peak live tree/scratch/table bytes, RSS and prove time for forced schedules with matched field, shape, witness, compiler and worker count.
Dependencies and coordination
Coordinate with #52, #8. The GKR tracker #52 tracks the wider programme; this issue owns only the scoped implementation above.
Activity
zkfriendly commentedon Nov 24, 2026
Status update (
main34addac): partially implemented by #146 (f433296). Layers 0–2 are now lazy via 16-entry nibble lookup tables (LutLayersincrates/gkr/src/lib.rs), materializing only from layer 3 up (the eager leaves and TODO incrates/prover/src/reduce.rsare gone). Remaining scope: selectable L2/L4/L8 schedules and an eager fallback.zkfriendly commentedon Nov 24, 2026
Closing as substantially completed by #146 (
f433296):LutLayers(crates/gkr/src/lib.rs) already keeps layers 0–2 lazy via 16-entry nibble lookup tables and builds from layer 3 up. Configurable L2/L4 schedules and an eager fallback are not needed on current workloads; reopen if a shape ever regresses with the fixed lazy schedule.