Skip to content

Prover and verifier optimisation: tracking issue #41

Open

Description

@shreyas-londhe

Optimisations found by profiling the prover and verifier. Focus is now on the BitZ PCS (GKR, column folding, ring switching, opening, grinding); Spartan/circuit PIOP items have been closed as out of current focus.

In scope (PCS):

Forest GKR

Opening & PCS

Virtual map

Machinery

Done / Closed as out of current focus (Spartan & circuit PIOP):

Related: #8 (merged GKR forest, closed), #7 (opener, closed), #54 (post-GKR sumcheck, closed by #69), #143 (relax PCS/GKR constraints).

Done when: every PCS item is closed or explicitly dropped, and a fresh PCS profile turns up nothing worth adding.

Activity

  1. xrvdg commented on Sep 7, 2026

    @xrvdg
    Collaborator

    Parallelise the layer sumcheck

    This has already been implemented or do you mean something else?

    Consume leaves lazily and parallelise the tree build

    Currently being worked on.

    Match the grouping convention and claim shape to the step-4 reduction

    For GKR to parallelise effectively, the leaves need to be stored row-major. That layout lets the column bits be folded last without opening gaps, and it also helps the lazy lookup of the leaves. BitTable is currently column-major. If it were row-major instead, what breaks?

  2. shreyas-londhe commented on Sep 8, 2026

    @shreyas-londhe
    CollaboratorAuthor

    This has already been implemented or do you mean something else?

    I misread in my reading. This issue should be removed.

  3. shreyas-londhe commented on Sep 8, 2026

    @shreyas-londhe
    CollaboratorAuthor

    For GKR to parallelise effectively, the leaves need to be stored row-major. That layout lets the column bits be folded last without opening gaps, and it also helps the lazy lookup of the leaves. BitTable is currently column-major. If it were row-major instead, what breaks?

    The conversion costs is ~2ms (parallel) so I would keep the BitTable column-major for now, but we can convert at the GKR boundary so you can take advantage of row-major.

  4. frozenspider commented on Sep 8, 2026

    @frozenspider
    Collaborator

    Attaching the profiler results from exp/e2e branch (f9b89b1), profiling run example (SHA256): e2e-608.json.gz
    Commands that were used:

    $ CARGO_PROFILE_RELEASE_DEBUG=line-tables-only RUSTFLAGS="-C target-cpu=native -C force-frame-pointers=yes" cargo build --release -p e2e --example run
    $ samply record --save-only -o e2e-608.json.gz -- target/release/examples/run 608 1
    

    Most of prover time, and perf optimization opportunities, come from GKR - which is not a real GKR by @xrvdg - for instance significant amount of prover time (20-30%) is taken by allocations, specifically by to_vec in prove_product_forest which won't be there. So much for the time wasted 😞

    In addition to what @shreyas-londhe has logged, I'm adding the following tasks as a follow-up:

    We also can optimize bind_and_batch $F_q$ multiplication by using Montgomery form, but expected gain is not high enough to bother.
    The rest of my findings look negligible.

  5. xrvdg commented on Sep 9, 2026

    @xrvdg
    Collaborator

    Made a separate tracking issue for GKR: #52. Updated the issue to include the link.

  6. zkfriendly commented on Nov 24, 2026

    @zkfriendly
    Collaborator

    Updated checklist against main (34addac): marked build_batched_basis / accumulate_claim_block as obsolete (removed in 5fa331e / #38 and superseded by crates/post_gkr in #69, closing #54), updated the #52 link and related issue statuses, and noted current timing for virtual-path weight binding (~27–29 ms per #149).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions