Skip to content

Commit 4903a0e

Browse files
committed
run analysis in a local area around a point
1 parent 9f744b3 commit 4903a0e

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed

src/egglog/run-egglog.rkt

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
(define egg-iters 25)
1515
(define ground-truth-iters 20)
1616
(define compute-accuracy-iters 20)
17-
(define egg-node-limit 10000)
17+
(define egg-node-limit 20000)
1818
(define egg-match-limit 1000)
1919
(define egg-if-match-limit 10000)
2020
(define HIGH-COST 100000000)
@@ -1347,21 +1347,24 @@
13471347
`(
13481348
,@(if
13491349
(econfig-local-error? config)
1350-
`((set-option match_limit 10000000)
1351-
(run ground-truth ,ground-truth-iters))
1350+
`()
13521351
empty)
1352+
1353+
(set-option match_limit 10000000)
1354+
(run ground-truth ,ground-truth-iters)
13531355

13541356
(set-option match_limit ,egg-match-limit)
13551357
;; runs normal analysis
13561358
(run analysis 3)
13571359
;; runs normal rewriting
13581360
(run rewrites 1)
13591361

1360-
(set-option match_limit ,egg-if-match-limit)
1362+
;;(set-option match_limit ,egg-if-match-limit)
13611363
;; simplify if statement stuff
1362-
(run simplify-if 2)
1364+
;;(run simplify-if 2)
13631365
;; permute the order of if statements
1364-
(run if-permute 1)))
1366+
;;(run if-permute 1)))
1367+
))
13651368

13661369
(define (build-runner config)
13671370
(apply append
@@ -1687,6 +1690,14 @@
16871690
#t
16881691
])))
16891692

1693+
(define (remove-precisely-when egglog-program)
1694+
(for/list ([line egglog-program])
1695+
(match line
1696+
[`(rewrite (,Op ty ,children ...) ,rhs :precisely-when ,conditions ,other ...)
1697+
`(rewrite (,Op ty ,@children) ,rhs :when ,conditions ,@other)]
1698+
[else
1699+
line])))
1700+
16901701
(define (rewrite-check-local-error egglog-program)
16911702
(for/list ([line egglog-program])
16921703
(match line
@@ -1739,8 +1750,10 @@
17391750

17401751
(define (apply-egglog-macros egglog-program local-error?)
17411752
(sanity-check-rewrites egglog-program)
1742-
(define with-ifs
1753+
#;(define with-ifs
17431754
(rewrite-if egglog-program))
1755+
(define with-ifs
1756+
(remove-precisely-when egglog-program))
17441757
(define res
17451758
(if local-error?
17461759
(rewrite-check-local-error with-ifs)
@@ -1778,10 +1791,11 @@
17781791
[else
17791792
(define shuffled (shuffle points))
17801793
(define rand-point (first shuffled))
1781-
(define area-size 0.5)
1794+
17821795
(make-hash
17831796
(for/list ([var (context-vars ctx)]
1784-
[num rand-point])
1797+
[num rand-point])
1798+
(define area-size (/ (abs num) 4.0))
17851799
(cons var (list (- num area-size) (+ num area-size)))))]))
17861800

17871801

0 commit comments

Comments
 (0)