Skip to content

feat: update range proof of u1 registers#1967

Open
letypequividelespoubelles wants to merge 2 commits into
mainfrom
1910-no-static-table-for-range_u1-proof
Open

feat: update range proof of u1 registers#1967
letypequividelespoubelles wants to merge 2 commits into
mainfrom
1910-no-static-table-for-range_u1-proof

Conversation

@letypequividelespoubelles

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
Copilot AI review requested due to automatic review settings July 7, 2026 16:14
@letypequividelespoubelles letypequividelespoubelles linked an issue Jul 7, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates how 1-bit (u1) registers are range-proven in the ZkC pipeline, moving them away from static range tables toward booleanity constraints in the MIR constraint layer.

Changes:

  • Skip static range-table proof for width==1 registers and instead add a booleanity vanishing constraint (r*r == r) for u1 registers during constraint generation.
  • Adjust VM-side range module width discovery to stop explicitly seeding/including width==1 (intended to avoid generating/using $range_u1 tables).
  • Minor comment cleanup around range-width selection.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pkg/zkc/vm/internal/transform/range_constraints.go Changes which register widths are considered “needed” for generating range modules (notably width 1).
pkg/zkc/constraints/range_lookup.go Adds booleanity constraints for u1 registers instead of using static range-table lookups.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +142 to +144
// Note: width == 0 comes from native registers, which are not range-checked.
// width == 1 are not range proven with a call to a static table, but with a constraint r (1 - r) == 0
if w != 0 && w != 1 && !seen[w] {
Comment thread pkg/zkc/constraints/range_lookup.go
Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
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.

No static table for range_u1 proof

2 participants