Lean Kernel Arena (Preview) / perf/unroll-versus-evaluate

Test "perf/unroll-versus-evaluate"

Expected: 馃憤 accept 路 Size: 44.7鈥疜B 路 Lines: 1.2鈥痥 路 lean4export: 3.2.0 路 Lean: 4.38.0-nightly-2026-12-03 路 Timeout: 40.0鈥痵 路 馃搫 Declaration 路 馃敆 Source

The declaration to check compares

count #(n+1)      and      N.add (count #n) #1

where #k is the numeral with k successors, and count #k evaluates to #k in 螛(k虏) reductions.

The head constants differ. Unrolling count once turns the left side into the right side, leaving a traversal of the shared numeral #n, for 螛(n); evaluating both sides costs 螛(n虏). The test asks which of two differing head constants a checker chooses to unfold.

N=1000 in the Lean source. From Courant and Leroy, POPL 2026, 搂2.

Checker Result 鈴憋笍 馃
gruszka 馃憤 2.28鈥痬s (梅20) 78.6鈥疢B (-30%)
nano-lean 馃憤 0.772鈥痬s (梅59) 23.8鈥疢B (梅4.8)
pestka 馃憤 2.53鈥痬s (梅18) 20.4鈥疢B (梅5.5)
con-leche 馃憤 5.46鈥痬s (梅8.3) 25.4鈥疢B (梅4.5)
con-ron 馃憤 29.8鈥痬s (-34%) 41.9鈥疢B (梅2.7)
nucleus 馃憤 204鈥痬s (脳4.5) 17.5鈥疢B (梅6.5)
official 馃憤 45.3鈥痬s 113.0鈥疢B