Skip to content

opt: circuit(CloClz, LT and ShiftRight)#479

Merged
eigmax merged 2 commits intopre-release-v1.2.5from
optimize-circuit
Mar 19, 2026
Merged

opt: circuit(CloClz, LT and ShiftRight)#479
eigmax merged 2 commits intopre-release-v1.2.5from
optimize-circuit

Conversation

@eigmax
Copy link
Copy Markdown
Member

@eigmax eigmax commented Mar 17, 2026

Summary

  • optimize(CloClz): Remove 5 witness columns (22 → 17, −23%):

    • sr1: Word<T> (4 cols) — hardcode [1, 0, 0, 0] in send_alu since
      sr1 == 1 is always verified.
    • is_clo (1 col) — derive as is_real - is_clz with a single
      when(is_clz).assert_one(is_real) guard.
  • optimize(Lt): Remove 4 dead columns byte_equality_check: [T; 4] (35
    → 31, −11%). The field was declared but never referenced in Air::eval or
    trace generation.

  • optimize(ShiftRight): Remove 4 redundant columns a: Word<T> (73 →
    69, −5%). Since a[i] == bit_shift_result[i] always holds, pass
    bit_shift_result[0..4] directly to receive_instruction.

Column savings

Chip Before After Saved
CloClz 22 17 5 (−23%)
Lt 35 31 4 (−11%)
ShiftRight 73 69 4 (−5%)
Total 13 columns

@eigmax eigmax changed the title Optimize circuit(LT and ShiftRight) Optimize circuit(CloClz, LT and ShiftRight) Mar 17, 2026
@eigmax eigmax changed the base branch from main to pre-release-v1.2.5 March 17, 2026 17:03
@eigmax eigmax merged commit 7ee1e66 into pre-release-v1.2.5 Mar 19, 2026
@eigmax eigmax deleted the optimize-circuit branch March 19, 2026 09:16
@eigmax eigmax changed the title Optimize circuit(CloClz, LT and ShiftRight) opt: circuit(CloClz, LT and ShiftRight) Mar 19, 2026
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.

4 participants