Lean Kernel Arena / bugs/nat-shift-huge

Test "bugs/nat-shift-huge"

Expected: 👍 accept · Size: 314.6 KB · Lines: 6.0 k · lean4export: 3.1.0 · Lean: 4.36.0 · 📄 Declaration · 🔗 Source

Nat.shiftRight and Nat.shiftLeft on literals with shift counts ≥ 2^64.

Both Nat.shiftRight 42 (2^64) and Nat.shiftLeft 0 (2^64) reduce to 0 in the kernel's Nat-literal extension. A checker that narrows the shift count to a 64-bit machine integer unconditionally overflows, and one that computes 2^shift explicitly OOMs or panics.

Covers both closed applications (rfl) and open applications in the major premise of Nat.rec (so closed-term evaluators cannot bypass the kernel's whnf Nat-literal path).

rpylean crashed with an uncaught OverflowError in nat_binop_value (v2.toint() on Nat.shiftRight and Nat.shiftLeft).

Checker Result ⏱️ 🧠
nano-lean 🚫 12.2 s 11.0 GB
gruszka 👍 4.97 ms 138.0 MB
sokonanoda 💥 4.46 ms 81.8 MB
rpylean 👍 3.71 ms 16.8 MB
pestka 👍 8.80 ms 26.4 MB
kefir 👍 15.2 ms 8.6 MB
palladium 👍 6.54 ms 19.3 MB
con-ron 👍 55.7 ms 51.1 MB
kefir-wasm 👍 385 ms 108.1 MB
con-agua 👍 52.0 ms 35.1 MB
nanobruijn 👍 19.8 ms 21.7 MB
nanoda 👍 13.3 ms 3.6 MB
con-leche 👍 37.2 ms 32.0 MB
pestka-wasm 👍 168 ms 143.9 MB
tenet-jvm 👍 453 ms 109.7 MB
official-nightly 👍 60.7 ms 99.5 MB
eink0rn 🚫 3.52 min 13.9 GB
official 👍 62.7 ms 93.8 MB
ind-models 👍 162 ms 114.7 MB
tenet 👍 189 ms 54.5 MB
tenet-hs 👍 22.9 ms 54.5 MB
kiota 👍 19.0 ms 17.3 MB
ocaml4lean 👍 33.4 ms 30.6 MB
logos-kernel 🚫 318 ms 429.9 MB
evmlean 🚫 6.30 min 751.8 MB
mini 🚫 52.4 ms 74.0 MB
overfull ⌛ — —
lean4lean 👍 67.4 ms 90.8 MB
lean4cobol ✋ 293 ms 15.1 MB
canonical-min ✋ 407 ms 1.0 GB
nanoclo ✋ 9.04 s 9.1 GB
vow-lean-kernel ⌛ — —
metalean-slow 🚫 55.1 ms 75.3 MB
lazylean ✋ 11.8 ms 23.2 MB
metalean-fast 👍 92.0 ms 82.0 MB
nanoclo-fortran 💥 17.6 s 14.7 GB
mathgraph ✋ 4.93 ms 87.6 MB