|
14 | 14 | (define egg-iters 25) |
15 | 15 | (define ground-truth-iters 20) |
16 | 16 | (define compute-accuracy-iters 20) |
17 | | -(define egg-node-limit 10000) |
| 17 | +(define egg-node-limit 20000) |
18 | 18 | (define egg-match-limit 1000) |
19 | 19 | (define egg-if-match-limit 10000) |
20 | 20 | (define HIGH-COST 100000000) |
|
1347 | 1347 | `( |
1348 | 1348 | ,@(if |
1349 | 1349 | (econfig-local-error? config) |
1350 | | - `((set-option match_limit 10000000) |
1351 | | - (run ground-truth ,ground-truth-iters)) |
| 1350 | + `() |
1352 | 1351 | empty) |
| 1352 | + |
| 1353 | + (set-option match_limit 10000000) |
| 1354 | + (run ground-truth ,ground-truth-iters) |
1353 | 1355 |
|
1354 | 1356 | (set-option match_limit ,egg-match-limit) |
1355 | 1357 | ;; runs normal analysis |
1356 | 1358 | (run analysis 3) |
1357 | 1359 | ;; runs normal rewriting |
1358 | 1360 | (run rewrites 1) |
1359 | 1361 |
|
1360 | | - (set-option match_limit ,egg-if-match-limit) |
| 1362 | + ;;(set-option match_limit ,egg-if-match-limit) |
1361 | 1363 | ;; simplify if statement stuff |
1362 | | - (run simplify-if 2) |
| 1364 | + ;;(run simplify-if 2) |
1363 | 1365 | ;; permute the order of if statements |
1364 | | - (run if-permute 1))) |
| 1366 | + ;;(run if-permute 1))) |
| 1367 | + )) |
1365 | 1368 |
|
1366 | 1369 | (define (build-runner config) |
1367 | 1370 | (apply append |
|
1687 | 1690 | #t |
1688 | 1691 | ]))) |
1689 | 1692 |
|
| 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 | + |
1690 | 1701 | (define (rewrite-check-local-error egglog-program) |
1691 | 1702 | (for/list ([line egglog-program]) |
1692 | 1703 | (match line |
|
1739 | 1750 |
|
1740 | 1751 | (define (apply-egglog-macros egglog-program local-error?) |
1741 | 1752 | (sanity-check-rewrites egglog-program) |
1742 | | - (define with-ifs |
| 1753 | + #;(define with-ifs |
1743 | 1754 | (rewrite-if egglog-program)) |
| 1755 | + (define with-ifs |
| 1756 | + (remove-precisely-when egglog-program)) |
1744 | 1757 | (define res |
1745 | 1758 | (if local-error? |
1746 | 1759 | (rewrite-check-local-error with-ifs) |
|
1778 | 1791 | [else |
1779 | 1792 | (define shuffled (shuffle points)) |
1780 | 1793 | (define rand-point (first shuffled)) |
1781 | | - (define area-size 0.5) |
| 1794 | + |
1782 | 1795 | (make-hash |
1783 | 1796 | (for/list ([var (context-vars ctx)] |
1784 | | - [num rand-point]) |
| 1797 | + [num rand-point]) |
| 1798 | + (define area-size (/ (abs num) 4.0)) |
1785 | 1799 | (cons var (list (- num area-size) (+ num area-size)))))])) |
1786 | 1800 |
|
1787 | 1801 |
|
|
0 commit comments