Skip to content

Commit faa768c

Browse files
committed
test: big_omega benchmark
1 parent 8151ac7 commit faa768c

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

src/Lean/Elab/Frontend.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def runFrontend
145145
: IO (Environment × Bool) := do
146146
let startTime := (← IO.monoNanosNow).toFloat / 1000000000
147147
let inputCtx := Parser.mkInputContext input fileName
148-
let opts := Language.Lean.internal.cmdlineSnapshots.set opts true
148+
let opts := Language.Lean.internal.cmdlineSnapshots.setIfNotSet opts true
149149
let ctx := { inputCtx with }
150150
let processor := Language.Lean.process
151151
let snap ← processor (fun _ => pure <| .ok { mainModuleName, opts, trustLevel }) none ctx

tests/bench/big_omega.lean

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/-!
2+
This benchmark exercises `omega` in a way that creates a big proof, exercising `instantiateMVars`
3+
and `shareCommonPreDefs` as well. In particular, running it with `internal.cmdlineSnapshots=false`,
4+
like the language server does, uncovered a significant slowdown in `instantiateMVars` (#5614).
5+
-/
6+
7+
set_option maxHeartbeats 0
8+
theorem memcpy_extracted_2 (six0 s0x0 : BitVec 64)
9+
(h_six0_nonzero : six0 ≠ 0)
10+
(h_s0x1 : s0x1 + 16#64 * (s0x0 - six0) + 16#64 = s0x1 + 16#64 * (s0x0 - (six0 - 1#64)))
11+
(h_s0x2 : s0x2 + 16#64 * (s0x0 - six0) + 16#64 = s0x2 + 16#64 * (s0x0 - (six0 - 1#64)))
12+
(h_assert_1 : six0 ≤ s0x0)
13+
(h_assert_3 : six1 = s0x1 + 16#64 * (s0x0 - six0))
14+
(h_assert_4 : six2 = s0x2 + 16#64 * (s0x0 - six0))
15+
(n : Nat)
16+
(addr : BitVec 64)
17+
(h_le : (s0x0 - (six0 - 1#64)).toNat ≤ s0x0.toNat)
18+
(h_upper_bound : addr.toNat + n ≤ 2 ^ 64)
19+
(h_upper_bound₂ : s0x2.toNat + s0x0.toNat * 162 ^ 64)
20+
(h_upper_bound₃ : s0x2.toNat + (16#64 * (s0x0 - (six0 - 1#64))).toNat ≤ 2 ^ 64)
21+
(h_width_lt : (16#64).toNat * (s0x0 - (six0 - 1#64)).toNat < 2 ^ 64)
22+
(hmemSeparate_omega : s0x1.toNat + s0x0.toNat * 162 ^ 64
23+
s0x2.toNat + s0x0.toNat * 162 ^ 64
24+
(s0x1.toNat + s0x0.toNat * 16 ≤ s0x2.toNat ∨ s0x1.toNat ≥ s0x2.toNat + s0x0.toNat * 16))
25+
(hmemLegal_omega : s0x1.toNat + s0x0.toNat * 162 ^ 64)
26+
(hmemLegal_omega : s0x2.toNat + s0x0.toNat * 162 ^ 64)
27+
(hmemSeparate_omega : s0x2.toNat + 16 % 2 ^ 64 * ((2 ^ 64 - (2 ^ 64 - 1 % 2 ^ 64 + six0.toNat) % 2 ^ 64 + s0x0.toNat) % 2 ^ 64) % 2 ^ 64
28+
2 ^ 64
29+
addr.toNat + n ≤ 2 ^ 64
30+
(s0x2.toNat +
31+
16 % 2 ^ 64 * ((2 ^ 64 - (2 ^ 64 - 1 % 2 ^ 64 + six0.toNat) % 2 ^ 64 + s0x0.toNat) % 2 ^ 64) % 2 ^ 64
32+
addr.toNat ∨
33+
s0x2.toNat ≥ addr.toNat + n))
34+
(hmemLegal_omega : s0x2.toNat + 16 % 2 ^ 64 * ((2 ^ 64 - (2 ^ 64 - 1 % 2 ^ 64 + six0.toNat) % 2 ^ 64 + s0x0.toNat) % 2 ^ 64) % 2 ^ 64
35+
2 ^ 64)
36+
(hmemLegal_omega : addr.toNat + n ≤ 2 ^ 64) :
37+
s0x2.toNat + (16#64 * (s0x0 - six0)).toNat ≤ 2 ^ 64
38+
addr.toNat + n ≤ 2 ^ 64
39+
(s0x2.toNat + (16#64 * (s0x0 - six0)).toNat ≤ addr.toNat ∨ s0x2.toNat ≥ addr.toNat + n) := by
40+
bv_omega

tests/bench/speedcenter.exec.velcom.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,3 +362,15 @@
362362
run_config:
363363
<<: *time
364364
cmd: lean bv_decide_inequality.lean
365+
- attributes:
366+
description: big_omega.lean
367+
tags: [fast]
368+
run_config:
369+
<<: *time
370+
cmd: lean big_omega.lean
371+
- attributes:
372+
description: big_omega.lean MT
373+
tags: [fast]
374+
run_config:
375+
<<: *time
376+
cmd: lean big_omega.lean -Dinternal.cmdlineSnapshots=false

0 commit comments

Comments
 (0)