Skip to content

Refactor/gkr/blueprints#1691

Merged
Tabaie merged 201 commits intomasterfrom
refactor/gkr/blueprints
Feb 13, 2026
Merged

Refactor/gkr/blueprints#1691
Tabaie merged 201 commits intomasterfrom
refactor/gkr/blueprints

Conversation

@Tabaie
Copy link
Contributor

@Tabaie Tabaie commented Jan 23, 2026

  • The main purpose of this PR is to replace the GKR hints with proper solver instruction blueprints.
  • Since the Solve blueprint has to hand large amounts of data over to the Prove blueprint, a GetBlueprint function has been added to solvers so that they can do so efficiently through a backdoor.
  • An experimental feature has been added to the CheckCircuit function, that in case of nondeterministic compilation tries to narrow down the unequal fields' path.
  • The test engine now also calls Blueprint.Reset after registration (i.e. before any calls to Solve).

Results from BenchmarkGkrMiMC on an hpc6a.48xlarge instance show a reduction in allocations but no significant change in runtime or total bytes allocated:

  ┌───────────┬───────────────┬───────────────┬──────────────────────────────┐
  │  Metric   │    master     │    This PR    │            delta             │
  ├───────────┼───────────────┼───────────────┼──────────────────────────────┤
  │ sec/op    │ 2.807 ±16%    │ 2.753 ±11%    │ ~ (p=0.796, not significant) │
  ├───────────┼───────────────┼───────────────┼──────────────────────────────┤
  │ B/op      │ 1.576 GiB ±0% │ 1.574 GiB ±0% │ ~ (p=0.971, not significant) │
  ├───────────┼───────────────┼───────────────┼──────────────────────────────┤
  │ allocs/op │ 726.8k ±0%    │ 585.3k ±0%    │ -19.48% (p=0.000)            │
  └───────────┴───────────────┴───────────────┴──────────────────────────────┘

Note

Medium Risk
Touches core constraint solving/serialization paths and replaces the GKR execution mechanism (hints -> blueprints), so regressions could surface in proving/solving order or backward compatibility of serialized systems despite explicit tag stabilization.

Overview
Refactors GKR integration to be driven by solver instruction blueprints instead of overriding solver hints, adding generated per-curve BlueprintSolve/BlueprintProve/BlueprintGetAssignment implementations and updating GKR code to use serializable (bytecode-based) gate/circuit types.

To support cross-blueprint data sharing, the constraint.Solver interface gains GetBlueprint, implemented across all curve solvers; CBOR serialization is extended with explicit, stable tag registration via RegisterGkrBlueprintTypes, and curve system.go files now blank-import their GKR packages to register these types. Legacy NewGkr plumbing and the generated solver_hints.go are removed, and the GKR gate registry/test helpers are updated to the new registered-gate/bytecode APIs.

Written by Cursor Bugbot for commit 0dc1d7b. This will update automatically on new commits. Configure here.

@Tabaie Tabaie added the feat: gkr PRs related to GKR label Feb 11, 2026
@Tabaie Tabaie requested a review from gbotrel February 11, 2026 17:42
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Copy link
Collaborator

@gbotrel gbotrel left a comment

Choose a reason for hiding this comment

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

lgtm, with caution on the need to recompile circuits for users -- that may introduce breaking changes in existing workflows

@Tabaie Tabaie merged commit 682b50c into master Feb 13, 2026
13 checks passed
@Tabaie Tabaie deleted the refactor/gkr/blueprints branch February 13, 2026 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: gkr PRs related to GKR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants