Skip to content

refactor(zkvm,gkr): simplify chip finalize flow#1302

Merged
dreamATD merged 2 commits intomasterfrom
finalize-simplify
Apr 14, 2026
Merged

refactor(zkvm,gkr): simplify chip finalize flow#1302
dreamATD merged 2 commits intomasterfrom
finalize-simplify

Conversation

@dreamATD
Copy link
Copy Markdown
Collaborator

@dreamATD dreamATD commented Apr 10, 2026

Summary

This PR simplifies the chip finalize flow by moving layer construction into each chip/layout's finalize implementation, so callers no longer need to manually compute out_evals, build a Layer, and call chip.add_layer(...).

What changed

  • Added a shared default_out_eval_groups(...) helper in gkr_iop.
  • Updated finalize(...) implementations to directly assemble and return a fully built Chip.
  • Removed duplicated caller-side boilerplate in precompile, instruction, and table builders.

Why

This makes the finalize contract simpler and more consistent: callers ask for a finalized chip and receive a ready-to-use one, instead of partially constructing it in multiple places.

Validation

  • cargo check
  • cargo check --all-targets

@dreamATD dreamATD changed the title [codex] Simplify chip finalize flow refactor(zkvm,gkr): simplify chip finalize flow Apr 10, 2026
@dreamATD dreamATD marked this pull request as ready for review April 10, 2026 11:53
@dreamATD dreamATD requested a review from hero78119 April 10, 2026 11:53
Copy link
Copy Markdown
Collaborator

@hero78119 hero78119 left a comment

Choose a reason for hiding this comment

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

👍 apart from one comment, other LGTM!

@dreamATD dreamATD requested a review from hero78119 April 10, 2026 15:33
@dreamATD dreamATD enabled auto-merge April 10, 2026 15:34
Copy link
Copy Markdown
Collaborator

@hero78119 hero78119 left a comment

Choose a reason for hiding this comment

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

LGTM!

@dreamATD dreamATD added this pull request to the merge queue Apr 14, 2026
Merged via the queue into master with commit 5a1772d Apr 14, 2026
5 checks passed
@dreamATD dreamATD deleted the finalize-simplify branch April 14, 2026 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants