Lean Kernel Arena / perf/proj-cheap-struct

Test "perf/proj-cheap-struct"

Expected: 👍 accept · Size: 85.9 KB · Lines: 1.5 k · lean4export: 3.1.0 · Lean: 4.36.0 · Timeout: 40.0 s · 📄 Declaration · 🔗 Source

The declaration to check compares

(S u).re      and      (S ()).re

where u is a definition that unfolds to (), and reducing S _ to a constructor takes Θ(N) steps (it is a foldr over List.range N, with N = 2^17).

.re is a projection function, so both sides unfold to a primitive projection of S u and S (). Official reduces the structure of a projection during definitional equality only with whnf_core (no delta), compares the two stuck projections by their structures, and finds those equal by comparing the arguments of S. That is five unfoldings in all. A checker that fully reduces the structure of the projection to find a constructor evaluates S on both sides: Θ(N) steps, which runs into a step budget smaller than N.

Distilled from a Palomar submission, where the structure is a Finset.sum over Finset.range (2^17) under Complex.re.

Checker Result ⏱️ 🧠
nano-lean 👍 1.14 ms (÷34) 37.4 MB (÷2.5)
gruszka 👍 2.58 ms (÷15) 119.7 MB (+30%)
mathgraph 👍 2.42 ms (÷16) 49.8 MB (-46%)
sokonanoda 👍 1.91 ms (÷20) 47.6 MB (-48%)
pestka 👍 3.96 ms (÷9.8) 20.8 MB (÷4.4)
kefir 👍 3.95 ms (÷9.9) 6.2 MB (÷15)
kefir-wasm 👍 199 ms (×5.1) 101.1 MB (+10%)
con-ron 👍 32.0 ms (-18%) 41.6 MB (÷2.2)
con-ron-stream 👍 32.6 ms (-16%) 47.2 MB (-49%)
con-agua 👍 23.4 ms (-40%) 23.5 MB (÷3.9)
nanobruijn 👍 5.72 ms (÷6.8) 19.5 MB (÷4.7)
nanoda 👍 3.20 ms (÷12) 3.2 MB (÷29)
con-leche 👍 7.98 ms (÷4.9) 25.0 MB (÷3.7)
pestka-wasm 👍 544 ms (×14) 328.9 MB (×3.6)
official-nightly 👍 39.6 ms (+2%) 97.6 MB (+6%)
eink0rn 👍 4.94 ms (÷7.9) 18.4 MB (÷5.0)
official 👍 39.0 ms 92.1 MB
ind-models 👍 124 ms (×3.2) 111.8 MB (+21%)
kiota 👍 4.77 ms (÷8.2) 11.2 MB (÷8.2)
tenet 👍 152 ms (×3.9) 46.0 MB (÷2.0)
tenet-hs 👍 5.72 ms (÷6.8) 18.2 MB (÷5.0)
logos-kernel 👍 1.19 ms (÷33) 4.6 MB (÷20)
evmlean ⌛ — —
mini 🚫 38.9 ms 66.1 MB
overfull ⌛ — —
lean4lean 👍 37.5 ms (-4%) 89.0 MB (-3%)
lean4cobol 👍 61.1 ms (+57%) 14.1 MB (÷6.5)
tenet-jvm 👍 202 ms (×5.2) 83.7 MB (-9%)
nanoclo 👍 2.24 ms (÷17) 57.5 MB (-38%)
vow-lean-kernel 👍 550 ms (×14) 15.0 MB (÷6.1)
canonical-min 🚫 392 ms 1.0 GB
lazylean 👍 2.82 ms (÷14) 21.6 MB (÷4.3)
rpylean 👍 1.58 ms (÷25) 12.8 MB (÷7.2)
metalean-slow 🚫 97.6 ms 65.1 MB
metalean-fast 👍 41.7 ms (+7%) 81.4 MB (-12%)
nanoclo-fortran 👍 5.26 ms (÷7.4) 4.8 MB (÷19)