Lean Kernel Arena (Preview) / perf/proj-lazy-struct

Test "perf/proj-lazy-struct"

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

The declaration to check compares

(P (slow 100000)).1      and      (Q (slow 100001)).1

where P a and Q a both unfold to (0, a), and slow n takes 螛(n) steps to evaluate.

A checker that compares two projections of the same structure by lazily unfolding their structs, and projects as soon as neither side unfolds any further, compares just the first fields, 0 and 0, after unfolding P and Q. That is four unfoldings in all. A checker that instead compares the two structs completely (here (0, slow 100000) and (0, slow 100001)) before projecting also compares the second fields, which differ, and does so by evaluating slow.

This is the counterpart of proj-cheap-struct, where the structs must not be evaluated because they are equal by their arguments.

Checker Result 鈴憋笍 馃
gruszka 馃憤 4.26鈥痬s (梅11) 116.2鈥疢B (+3%)
nano-lean 馃憤 0.964鈥痬s (梅47) 31.8鈥疢B (梅3.5)
pestka 馃憤 3.10鈥痬s (梅15) 19.0鈥疢B (梅5.9)
con-leche 馃憤 5.80鈥痬s (梅7.8) 25.2鈥疢B (梅4.5)
con-ron 馃憤 29.8鈥痬s (-34%) 39.5鈥疢B (梅2.9)
nucleus 馃憤 150鈥痬s (脳3.3) 13.7鈥疢B (梅8.2)
official 馃憤 45.4鈥痬s 112.7鈥疢B