Skip to content

perf: revisit varrangechecker#2401

Merged
Tuanlinh12312 merged 4 commits intodevelop-v2from
perf/revisit-varrangechecker
Feb 11, 2026
Merged

perf: revisit varrangechecker#2401
Tuanlinh12312 merged 4 commits intodevelop-v2from
perf/revisit-varrangechecker

Conversation

@Tuanlinh12312
Copy link

Resolves INT-5965.

@stephenh-axiom-xyz
Copy link
Contributor

@Tuanlinh12312 please clean up this PR

@Tuanlinh12312 Tuanlinh12312 force-pushed the perf/revisit-varrangechecker branch from efe9ccd to 1cabea1 Compare February 10, 2026 15:32
@claude
Copy link

claude bot commented Feb 10, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Tuanlinh12312 and others added 2 commits February 11, 2026 15:36
Remove selector_inverse and is_not_wrap columns from VariableRangeCheckerAir
by using a "monotonic sum" constraint approach instead of selector-based
branching. This reduces trace width from 6 to 4 columns while maintaining
max constraint degree of 2.

Key insight: (value + two_to_max_bits) equals (row_index + 1), forming a
strictly increasing sequence. By constraining this sum to increase by
exactly 1 each row, combined with constraints that value can only be 0 or
increment and max_bits can only stay or increment, the trace is forced
into the correct enumeration. The last-row constraint acts as a checksum.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add missing imports (VerificationError, BabyBearBlake3Engine, StarkFriEngine)
and remove unused dead code to allow circuit-primitives tests to compile.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Tuanlinh12312 Tuanlinh12312 force-pushed the perf/revisit-varrangechecker branch from 1cabea1 to d49802d Compare February 11, 2026 15:36
Copy link
Contributor

@stephenh-axiom-xyz stephenh-axiom-xyz left a comment

Choose a reason for hiding this comment

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

A couple nits + request to change a comment, but otherwise LGTM 🚀 ! Please confirm that tests + benchmarks pass locally

Tuanlinh12312 and others added 2 commits February 11, 2026 16:16
- Use assert_bool for max_bits_delta constraint
- Use when(next.value).assert_eq pattern instead of assert_zero(a * b)
- Simplify comments and reference README for explanation
- Replace "checksum" terminology with proper security explanation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Tuanlinh12312 Tuanlinh12312 merged commit b8a282a into develop-v2 Feb 11, 2026
6 of 71 checks passed
@Tuanlinh12312 Tuanlinh12312 deleted the perf/revisit-varrangechecker branch February 11, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants