...
 
Commits (51)
...@@ -109,6 +109,7 @@ spectral/constraints/constraints ...@@ -109,6 +109,7 @@ spectral/constraints/constraints
spectral/cryptarithm1/cryptarithm1 spectral/cryptarithm1/cryptarithm1
spectral/cryptarithm2/cryptarithm2 spectral/cryptarithm2/cryptarithm2
spectral/cse/cse spectral/cse/cse
spectral/dom-lt/dom-lt
spectral/eliza/eliza spectral/eliza/eliza
spectral/exact-reals/exact-reals spectral/exact-reals/exact-reals
spectral/expert/expert spectral/expert/expert
......
...@@ -3,6 +3,8 @@ variables: ...@@ -3,6 +3,8 @@ variables:
validate: validate:
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV" image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
tags:
- x86_64-linux
before_script: before_script:
- git clean -xdf - git clean -xdf
- sudo apt install -y time - sudo apt install -y time
......
...@@ -12,16 +12,20 @@ pick `$(which ghc)` or whatever the `HC` environment variable is set to. ...@@ -12,16 +12,20 @@ pick `$(which ghc)` or whatever the `HC` environment variable is set to.
Additional information can also be found on Additional information can also be found on
[NoFib's wiki page](https://ghc.haskell.org/trac/ghc/wiki/Building/RunningNoFib). [NoFib's wiki page](https://ghc.haskell.org/trac/ghc/wiki/Building/RunningNoFib).
There's also a `easy.sh` helper script, which as name implies, is
automated and easy way to run `nofib`.
See the section at the end of README for its usage.
## Using ## Using
<details> <details>
<summary>Git symlink support for Windows machines</summary> <summary>Git symlink support for Windows machines</summary>
NoFib uses a few symlinks here and there to share code between benchmarks. NoFib uses a few symlinks here and there to share code between benchmarks.
Git for Windows has symlinks support for some time now, but Git for Windows has symlinks support for some time now, but
[it may not be enabled by default](https://stackoverflow.com/a/42137273/388010). [it may not be enabled by default](https://stackoverflow.com/a/42137273/388010).
You will notice strange `make boot` failures if it's not enabled for you. You will notice strange `make boot` failures if it's not enabled for you.
Make sure you follow the instructions in the link to enable symlink support, Make sure you follow the instructions in the link to enable symlink support,
possibly as simple as through `git config core.symlinks true` or cloning with possibly as simple as through `git config core.symlinks true` or cloning with
`git clone -c core.symlinks=true <URL>`. `git clone -c core.symlinks=true <URL>`.
...@@ -49,6 +53,9 @@ $ make boot ...@@ -49,6 +53,9 @@ $ make boot
$ make EXTRA_HC_OPTS="-fllvm" $ make EXTRA_HC_OPTS="-fllvm"
``` ```
**Note:** to get all the results, you have to `clean` and `boot` between
separate `nofib` runs.
To compare the results of multiple runs, save the output in a logfile To compare the results of multiple runs, save the output in a logfile
and use the program in `./nofib-analyse/nofib-analyse`, for example: and use the program in `./nofib-analyse/nofib-analyse`, for example:
...@@ -142,7 +149,17 @@ Optionally combine this with `mode=fast`, see [Modes](#modes). ...@@ -142,7 +149,17 @@ Optionally combine this with `mode=fast`, see [Modes](#modes).
Some benchmarks aren't run by default and require extra packages are Some benchmarks aren't run by default and require extra packages are
installed for the GHC compiler being tested. These packages include: installed for the GHC compiler being tested. These packages include:
* stm - for smp benchmarks
* `old-time`: for `gc` benchmarks
* `stm`: for smp benchmarks
* `parallel`: for parallel benchmarks
* `random`: for various benchmarks
These can be installed with
```
cabal v1-install --allow-newer -w $HC random parallel old-time
````
## Adding benchmarks ## Adding benchmarks
...@@ -150,20 +167,87 @@ If you add a benchmark try to set the problem sizes for ...@@ -150,20 +167,87 @@ If you add a benchmark try to set the problem sizes for
fast/normal/slow reasonably. [Modes](#modes) lists the recommended brackets for fast/normal/slow reasonably. [Modes](#modes) lists the recommended brackets for
each mode. each mode.
### Benchmark Categories
So you have a benchmark to submit but don't know in which subfolder to put it? Here's some
advice on the intended semantics of each category.
#### Single threaded benchmarks
These are run when you just type `make`. Their semantics is explained in
[the Nofib paper](https://link.springer.com/chapter/10.1007%2F978-1-4471-3215-8_17)
(You can find a .ps online, thanks to @bgamari. Alternatively grep for
'Spectral' in docs/paper/paper.verb).
- `imaginary`: Mostly toy benchmarks, solving puzzles like n-queens.
- `spectral`: Algorithmic kernels, like FFT. If you want to add a benchmark of a
library, this most certainly the place to put it.
- `real`: Actual applications, with a command-line interface and all. Because of
the large dependency footprint of today's applications, these have become
rather aged.
- `shootout`: Benchmarks from
[the benchmarks game](https://benchmarksgame-team.pages.debian.net/benchmarksgame/),
formerly known as "language shootout".
Most of the benchmarks are quite old and aren't really written in way one would
write high-performance Haskell code today (e.g., use of `String`, lists,
redefining own list combinators that don't take part in list fusion, rare use of
strictness annotations or unboxed data), so new benchmarks for the `real` and
`spectral` in brackets in particular are always welcome!
#### Other categories
Other than the default single-threaded categories above, there are the
following (SG: I'm guessing here, have never run them):
- `gc`: Run by `make -C gc` (though you'll probably have to edit the Makefile to
your specific config). Select benchmarks from `spectral` and `real`, plus a
few more (Careful, these have not been touched by #15999/!5, see the next
subsection). Testdrives different GC configs, apparently.
- `smp`: Microbenchmarks for the `-threaded` runtime, measuring scheduler
performance on concurrent and STM-heavy code.
### Stability wrt. GC paramerisations ### Stability wrt. GC paramerisations
Additionally, pay attention that your benchmarks are stable wrt. different Additionally, pay attention that your benchmarks are stable wrt. different
GC paramerisations, so that small changes in allocation don't lead to big, GC paramerisations, so that small changes in allocation don't lead to big,
unexplicable jumps in performance. See Trac #15999 for details. Also make sure unexplicable jumps in performance. See #15999 for details. Also make sure
that you run the benchmark with the default GC settings, as enlarging Gen 0 or that you run the benchmark with the default GC settings, as enlarging Gen 0 or
Gen 1 heaps just amplifies the problem. Gen 1 heaps just amplifies the problem.
As a rule of thumb on how to ensure this: Make sure that your benchmark doesn't As a rule of thumb on how to ensure this: Make sure that your benchmark doesn't
just build up one big data and consume it in a final step, but rather that the just build up one big data and consume it in a final step, but rather that the
working set grows and shrinks (e.g. is approximately constant) over the whole working set grows and shrinks (e.g. is approximately constant) over the whole
run of the benchmark. You can ensure this by iterating your main logic $n times run of the benchmark. You can ensure this by iterating your main logic `$n`
(how often depends on your program, but in the ball park of 100-1000). times (how often depends on your program, but in the ball park of 100-1000).
You can test stability by plotting productivity curves for your `fast` settings You can test stability by plotting productivity curves for your `fast` settings
with the `prod.py` script attached to Trac #15999. with the `prod.py` script attached to #15999.
If in doubt, ask Sebastian Graf for help. If in doubt, ask Sebastian Graf for help.
## Important notes
Note that some of these tests (e.g. `spectral/fish`) tend to be very sensitive
to branch predictor effectiveness. This means that changes in the compiler
can easily be masked by "random" fluctuations in the code layout produced by
particular compiler runs. Recent GHC versions provide the `-fproc-alignment`
flag to pad procedures, ensuring slightly better stability across runs. If you
are seeing an unexpected change in performance try adding `-fproc-alignment=64`
the compiler flags of both your baseline and test tree.
## easy.sh
```
./easy.sh - easy nofib
Usage: ./easy.sh [ -m mode ] /path/to/baseline/ghc /path/to/new/ghc"
GHC paths can point to the root of the GHC repository,
if it's build with Hadrian.
Available options:
-m MODE nofib mode: fast norm slow
This script caches the results using the sha256 of ghc executable.
Remove these files, if you want to rerun the benchmark.
```
#!/bin/sh
echo '\033]0;NOFIB: starting...\007'
# Settings
#######################################################################
mode=norm
# "Library" part
#######################################################################
show_usage () {
cat <<EOF
./easy.sh - easy nofib
Usage: ./easy.sh [ -m mode ] /path/to/baseline/ghc /path/to/new/ghc"
GHC paths can point to the root of the GHC repository,
if it's build with Hadrian.
Available options:
-m MODE nofib mode: fast norm slow
This script caches the results using the sha256 of ghc executable.
Remove these files, if you want to rerun the benchmark.
EOF
}
hashoffile () {
shasum -a 256 $1 | awk '{ print $1 }'
}
# getopt
#######################################################################
while getopts 'm:' flag; do
case $flag in
m)
case $OPTARG in
slow)
mode=$OPTARG
;;
norm)
mode=$OPTARG
;;
fast)
mode=$OPTARG
;;
*)
echo "Unknown mode: $OPTARG"
show_usage
exit 1
;;
esac
;;
?) show_usage
;;
esac
done
shift $((OPTIND - 1))
if [ $# -ne 2 ]; then
echo "Expected two arguments: ghc executables or roots of source repositories"
show_usage
exit 1
fi
OLD_HC=$1
NEW_HC=$2
# Set up
#######################################################################
# Arguments can point to GHC repository roots
if [ -d $OLD_HC -a -f "$OLD_HC/_build/stage1/bin/ghc" ]; then
OLD_HC="$OLD_HC/_build/stage1/bin/ghc"
fi
if [ -d $NEW_HC -a -f "$NEW_HC/_build/stage1/bin/ghc" ]; then
NEW_HC="$NEW_HC/_build/stage1/bin/ghc"
fi
# Check we have executables
if [ ! -f $NEW_HC -a -x $OLD_HC ]; then
echo "$OLD_HC is not an executable"
exit 1
fi
if [ ! -f $NEW_HC -a -x $NEW_HC ]; then
echo "$NEW_HC is not an executable"
exit 1
fi
# Info before we get going
#######################################################################
echo "Running nofib (mode=$mode) with $OLD_HC and $NEW_HC"
echo "Running nofib (mode=$mode) with $OLD_HC and $NEW_HC" | sed 's/./-/g'
sleep 2
# Run nofib
#######################################################################
# Run with old ghc
echo '\033]0;NOFIB: old\007'
OLD_HASH=$(hashoffile $OLD_HC)
OLD_OUTPUT=result-$OLD_HASH-$mode.txt
if [ -f $OLD_OUTPUT ]; then
echo "$OLD_OUTPUT exists; not re-running."
else
echo '\033]0;NOFIB: old, cleaning...\007'
make clean
echo '\033]0;NOFIB: old, booting...\007'
make boot mode=$mode HC=$OLD_HC
echo '\033]0;NOFIB: old, benchmarking...\007'
make mode=$mode HC=$OLD_HC 2>&1 | tee $OLD_OUTPUT
fi
# Run with new ghc
echo '\033]0;NOFIB: new\007'
NEW_HASH=$(hashoffile $NEW_HC)
NEW_OUTPUT=result-$NEW_HASH-$mode.txt
if [ -f $NEW_OUTPUT ]; then
echo "$NEW_OUTPUT exists; not re-running."
else
echo '\033]0;NOFIB: new, cleaning...\007'
make clean
echo '\033]0;NOFIB: new, booting...\007'
make boot mode=$mode HC=$NEW_HC
echo '\033]0;NOFIB: new, benchmarking...\007'
make mode=$mode HC=$NEW_HC 2>&1 | tee $NEW_OUTPUT
fi
# Done
#######################################################################
echo '\033]0;NOFIB: done\007'
# Analyse
./nofib-analyse/nofib-analyse $OLD_OUTPUT $NEW_OUTPUT > report.txt
# Show report
less report.txt
...@@ -2,10 +2,10 @@ TOP = ../.. ...@@ -2,10 +2,10 @@ TOP = ../..
include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/boilerplate.mk
ifeq "$(HEAP)" "LARGE" ifeq "$(HEAP)" "LARGE"
SRC_RUNTEST_OPTS += +RTS -H16m -RTS PROG_ARGS += +RTS -H16m -RTS
endif endif
ifeq "$(HEAP)" "OLD" ifeq "$(HEAP)" "OLD"
SRC_RUNTEST_OPTS += +RTS -H10m -RTS PROG_ARGS += +RTS -H10m -RTS
endif endif
include $(TOP)/mk/target.mk include $(TOP)/mk/target.mk
......
...@@ -7,10 +7,10 @@ NORM_OPTS = 8 3000 ...@@ -7,10 +7,10 @@ NORM_OPTS = 8 3000
SLOW_OPTS = 8 5000 SLOW_OPTS = 8 5000
ifeq "$(HEAP)" "LARGE" ifeq "$(HEAP)" "LARGE"
SRC_RUNTEST_OPTS += +RTS -H256m -RTS PROG_ARGS += +RTS -H256m -RTS
endif endif
ifeq "$(HEAP)" "OLD" ifeq "$(HEAP)" "OLD"
SRC_RUNTEST_OPTS += +RTS -H30m -RTS PROG_ARGS += +RTS -H30m -RTS
endif endif
include $(TOP)/mk/target.mk include $(TOP)/mk/target.mk
...@@ -7,10 +7,10 @@ NORM_OPTS = 10 ...@@ -7,10 +7,10 @@ NORM_OPTS = 10
SLOW_OPTS = 11 SLOW_OPTS = 11
ifeq "$(HEAP)" "LARGE" ifeq "$(HEAP)" "LARGE"
SRC_RUNTEST_OPTS += +RTS -H330m -RTS PROG_ARGS += +RTS -H330m -RTS
endif endif
ifeq "$(HEAP)" "OLD" ifeq "$(HEAP)" "OLD"
SRC_RUNTEST_OPTS += +RTS -H10m -RTS PROG_ARGS += +RTS -H10m -RTS
endif endif
include $(TOP)/mk/target.mk include $(TOP)/mk/target.mk
...@@ -75,7 +75,7 @@ the roots of two binomial trees and makes the larger a child of the ...@@ -75,7 +75,7 @@ the roots of two binomial trees and makes the larger a child of the
smaller (thus bumping its degree by one). It is essential that this smaller (thus bumping its degree by one). It is essential that this
only be called on binomial trees of equal degree. only be called on binomial trees of equal degree.
>link (a @ (Node x as)) (b @ (Node y bs)) = >link (a@(Node x as)) (b@(Node y bs)) =
> if x <= y then Node x (b:as) else Node y (a:bs) > if x <= y then Node x (b:as) else Node y (a:bs)
It will also be useful to extract the minimum element from a tree. It will also be useful to extract the minimum element from a tree.
......
...@@ -3,14 +3,14 @@ include $(TOP)/mk/boilerplate.mk ...@@ -3,14 +3,14 @@ include $(TOP)/mk/boilerplate.mk
NORM_OPTS = 300000 NORM_OPTS = 300000
SRC_HC_OPTS += -package array SRC_DEPS = array
SRC_RUNTEST_OPTS += +RTS -K64m -RTS PROG_ARGS += +RTS -K64m -RTS
ifeq "$(HEAP)" "LARGE" ifeq "$(HEAP)" "LARGE"
SRC_RUNTEST_OPTS += +RTS -H128m -RTS PROG_ARGS += +RTS -H128m -RTS
endif endif
ifeq "$(HEAP)" "OLD" ifeq "$(HEAP)" "OLD"
SRC_RUNTEST_OPTS += +RTS -H10m -RTS PROG_ARGS += +RTS -H10m -RTS
endif endif
include $(TOP)/mk/target.mk include $(TOP)/mk/target.mk
...@@ -195,19 +195,19 @@ calc (Geom a (RotZ rad)) rgb xyz ...@@ -195,19 +195,19 @@ calc (Geom a (RotZ rad)) rgb xyz
-- conflate matrices together and into planes planes... -- conflate matrices together and into planes planes...
reduceM (Object X) mata reduceM (Object X) mata
= case (mat1x4 (1,0,0,0) mata) of = case (mat1x4 (1,0,0,0) mata) of
(x,y,z,w) -> (Object (Plane x y z w),True) (x,y,z,w) -> (Object (Plane x y z w),True)
reduceM (Object Y) mata reduceM (Object Y) mata
= case (mat1x4 (0,1,0,0) mata) of = case (mat1x4 (0,1,0,0) mata) of
(x,y,z,w) -> (Object (Plane x y z w),True) (x,y,z,w) -> (Object (Plane x y z w),True)
reduceM (Object Z) mata reduceM (Object Z) mata
= case (mat1x4 (0,0,1,0) mata) of = case (mat1x4 (0,0,1,0) mata) of
(x,y,z,w) -> (Object (Plane x y z w),True) (x,y,z,w) -> (Object (Plane x y z w),True)
reduceM (Object (Plane a b c d)) mata reduceM (Object (Plane a b c d)) mata
= case (mat1x4 (a,b,c,d) mata) of = case (mat1x4 (a,b,c,d) mata) of
(x,y,z,w) -> (Object (Plane x y z w),True) (x,y,z,w) -> (Object (Plane x y z w),True)
reduceM (Matrix b matb) mata reduceM (Matrix b matb) mata
= case (mat4x4 mata matb) of = case (mat4x4 mata matb) of
matc -> (Matrix b matc,True) matc -> (Matrix b matc,True)
reduceM _ _ = (no,False) reduceM _ _ = (no,False)
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
-} -}
module Interval(Interval, (#), pt, sqr, module Interval(Interval, (#), pt, sqr,
tophalf, bothalf, topbit, tophalf, bothalf, topbit,
lo, hi, mid1, mid2, lo, hi, mid1, mid2,
up,down,unpt) up,down,unpt)
where where
infix 4 #,:#: infix 4 #,:#:
...@@ -46,38 +46,38 @@ instance (Ord a) => Ord (Interval a) where ...@@ -46,38 +46,38 @@ instance (Ord a) => Ord (Interval a) where
instance (Num a,Ord a,Eq a,Show{-was:Text-} a) => Num (Interval a) where instance (Num a,Ord a,Eq a,Show{-was:Text-} a) => Num (Interval a) where
(+) = ivPlus (+) = ivPlus
(*) = ivMult (*) = ivMult
negate = ivNegate negate = ivNegate
abs = ivAbs abs = ivAbs
signum = ivSignum signum = ivSignum
fromInteger = ivFromInteger fromInteger = ivFromInteger
instance (Show a,Num a,Ord a,Fractional a) => Fractional (Interval a) where instance (Show a,Num a,Ord a,Fractional a) => Fractional (Interval a) where
(/) = ivDiv (/) = ivDiv
fromRational = ivFromRational fromRational = ivFromRational
-- instance (Fractional a,Ord a,Floating a) => - not this ? -- instance (Fractional a,Ord a,Floating a) => - not this ?
instance (Show a,RealFloat a) => instance (Show a,RealFloat a) =>
Floating (Interval a) where Floating (Interval a) where
pi = Pt pi pi = Pt pi
exp = ivExp exp = ivExp
log = ivLog log = ivLog
sqrt = ivSqrt sqrt = ivSqrt
(**) = ivPower (**) = ivPower
sin = ivSin sin = ivSin
cos = ivCos cos = ivCos
tan = ivTan tan = ivTan
asin = ivAsin asin = ivAsin
acos = ivAcos acos = ivAcos
atan = ivAtan atan = ivAtan
sinh = ivSinh sinh = ivSinh
cosh = ivCosh cosh = ivCosh
tanh = ivTanh tanh = ivTanh
asinh = ivAsinh asinh = ivAsinh
acosh = ivAcosh acosh = ivAcosh
atanh = ivAtanh atanh = ivAtanh
-- Error functions - un-used. -- Error functions - un-used.
...@@ -141,35 +141,35 @@ ivNegate (a :#: b) = negate b :#: negate a ...@@ -141,35 +141,35 @@ ivNegate (a :#: b) = negate b :#: negate a
ivMult (Pt a) (Pt c) = Pt (a*c) ivMult (Pt a) (Pt c) = Pt (a*c)
ivMult (a :#: b) (c :#: d) | (min a c) > 0 = a*c :#: b*d ivMult (a :#: b) (c :#: d) | (min a c) > 0 = a*c :#: b*d
| (max b d) < 0 = b*d :#: a*c | (max b d) < 0 = b*d :#: a*c
| otherwise = minmax [e,f,g,h] | otherwise = minmax [e,f,g,h]
where where
e = b * c e = b * c
f = a * d f = a * d
g = a * c g = a * c
h = b * d h = b * d
ivMult (Pt a) (c :#: d) | a > 0 = a*c :#: a*d ivMult (Pt a) (c :#: d) | a > 0 = a*c :#: a*d
| a < 0 = a*d :#: a*c | a < 0 = a*d :#: a*c
| otherwise = (Pt 0) | otherwise = (Pt 0)
ivMult (c :#: d) (Pt a) | a > 0 = a*c :#: a*d ivMult (c :#: d) (Pt a) | a > 0 = a*c :#: a*d
| a < 0 = a*d :#: a*c | a < 0 = a*d :#: a*c
| otherwise = (Pt 0) | otherwise = (Pt 0)
-- minmax finds the lowest, and highest in a list - used for mult. -- minmax finds the lowest, and highest in a list - used for mult.
-- Should use foldl rather than foldr -- Should use foldl rather than foldr
minmax [a] = a :#: a minmax [a] = a :#: a
minmax (a:as) = case True of minmax (a:as) = case True of
True | (a > s) -> f :#: a True | (a > s) -> f :#: a
True | (a < f) -> a :#: s True | (a < f) -> a :#: s
otherwise -> f :#: s otherwise -> f :#: s
where where
(f :#: s) = minmax as (f :#: s) = minmax as
ivAbs (Pt a) = Pt (abs a) ivAbs (Pt a) = Pt (abs a)
ivAbs (a :#: b) | a<=0 && 0<=b = 0 :#: (max (abs a) (abs b)) ivAbs (a :#: b) | a<=0 && 0<=b = 0 :#: (max (abs a) (abs b))
| a<=b && b<0 = b :#: a | a<=b && b<0 = b :#: a
| 0<a && a<=b = a :#: b | 0<a && a<=b = a :#: b
| otherwise = error "abs doesny work!" | otherwise = error "abs doesny work!"
ivSignum (Pt a) = Pt (signum a) ivSignum (Pt a) = Pt (signum a)
ivSignum (a :#: b) = (signum a) :#: (signum b) ivSignum (a :#: b) = (signum a) :#: (signum b)
...@@ -195,7 +195,7 @@ ivLog (a :#: b) = (log a) :#: (log b) ...@@ -195,7 +195,7 @@ ivLog (a :#: b) = (log a) :#: (log b)
ivSqrt (Pt a) = Pt (sqrt a) ivSqrt (Pt a) = Pt (sqrt a)
ivSqrt (a :#: b) = (sqrt a) :#: (sqrt b) ivSqrt (a :#: b) = (sqrt a) :#: (sqrt b)
ivPower x y = exp (log x * y) -- Optimise for x ** 2 ivPower x y = exp (log x * y) -- Optimise for x ** 2
ivSin :: (Floating a) => (Interval a) -> (Interval a) ivSin :: (Floating a) => (Interval a) -> (Interval a)
......
This diff is collapsed.
...@@ -37,9 +37,9 @@ import System.IO ...@@ -37,9 +37,9 @@ import System.IO
main = do main = do
argv <- getArgs argv <- getArgs
let let
n = case argv of n = case argv of
[a] -> read a [a] -> read a
_ -> 7 _ -> 7
hSetBinaryMode stdin True hSetBinaryMode stdin True
hSetBinaryMode stdout True hSetBinaryMode stdout True
putStr (picture n) putStr (picture n)
......
TOP = ../.. TOP = ../..
include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/boilerplate.mk
SRC_HC_OPTS += -cpp
# Bah.hs is a test file, which we don't want in SRCS # Bah.hs is a test file, which we don't want in SRCS
EXCLUDED_SRCS = Bah.hs EXCLUDED_SRCS = Bah.hs
...@@ -11,10 +9,10 @@ NORM_OPTS = 9 ...@@ -11,10 +9,10 @@ NORM_OPTS = 9
SLOW_OPTS = 9 SLOW_OPTS = 9
ifeq "$(HEAP)" "LARGE" ifeq "$(HEAP)" "LARGE"
SRC_RUNTEST_OPTS += +RTS -H160m -RTS PROG_ARGS += +RTS -H160m -RTS
endif endif
ifeq "$(HEAP)" "OLD" ifeq "$(HEAP)" "OLD"
SRC_RUNTEST_OPTS += +RTS -H10m -RTS PROG_ARGS += +RTS -H10m -RTS
endif endif
SRC_RUNTEST_OPTS += -stdout-binary SRC_RUNTEST_OPTS += -stdout-binary
......
...@@ -33,10 +33,10 @@ dorow :: (Fractional a) => Row -> R3 a -> a ...@@ -33,10 +33,10 @@ dorow :: (Fractional a) => Row -> R3 a -> a
dorow (m11,m12,m13,m14) (x,y,z) dorow (m11,m12,m13,m14) (x,y,z)
= case (m1 * x) + (m2 * y) + (m3 * z) + m4 of n -> n = case (m1 * x) + (m2 * y) + (m3 * z) + m4 of n -> n
where where
m1 = realToFrac m11 m1 = realToFrac m11
m2 = realToFrac m12 m2 = realToFrac m12
m3 = realToFrac m13 m3 = realToFrac m13
m4 = realToFrac m14 m4 = realToFrac m14
mat4x1' :: (Fractional a) => Arr -> R3 a -> R3 a mat4x1' :: (Fractional a) => Arr -> R3 a -> R3 a
mat4x1' (r1,r2,r3) xyz = (x,y,z) mat4x1' (r1,r2,r3) xyz = (x,y,z)
...@@ -49,9 +49,9 @@ dorow' :: (Fractional a) => Row -> R3 a -> a ...@@ -49,9 +49,9 @@ dorow' :: (Fractional a) => Row -> R3 a -> a
dorow' (m11,m12,m13,m14) (x,y,z) dorow' (m11,m12,m13,m14) (x,y,z)
= case (m1 * x) + (m2 * y) + (m3 * z) of n -> n = case (m1 * x) + (m2 * y) + (m3 * z) of n -> n
where where
m1 = realToFrac m11 m1 = realToFrac m11
m2 = realToFrac m12 m2 = realToFrac m12
m3 = realToFrac m13 m3 = realToFrac m13
mat1x4 :: Row -> Arr -> Row mat1x4 :: Row -> Arr -> Row
mat1x4 a (b1,b2,b3) = (c1,c2,c3,c4) mat1x4 a (b1,b2,b3) = (c1,c2,c3,c4)
......
...@@ -46,7 +46,7 @@ makeoct csg = octer 1 csg xyz ...@@ -46,7 +46,7 @@ makeoct csg = octer 1 csg xyz
-- octer :: Int -> Csg -> (R3 BI) -> Oct -- octer :: Int -> Csg -> (R3 BI) -> Oct
octer nn csg xyz octer nn csg xyz
= case (calc csg white xyz) of = case (calc csg white xyz) of
(res,newc',rgb,new) -> (res,newc',rgb,new) ->
let let
newc = if new then newc' else csg newc = if new then newc' else csg
c = light rgb (calcn newc xyz) c = light rgb (calcn newc xyz)
...@@ -54,35 +54,35 @@ octer nn csg xyz ...@@ -54,35 +54,35 @@ octer nn csg xyz
bhx = bothalf x ; thx = tophalf x bhx = bothalf x ; thx = tophalf x
bhy = bothalf y ; thy = tophalf y bhy = bothalf y ; thy = tophalf y
tbz = topbit z ; bhz = bothalf z tbz = topbit z ; bhz = bothalf z
os = if nn == 1 then osb else osa os = if nn == 1 then osb else osa
n1 = nn + 1 n1 = nn + 1
osa = map (octer n1 newc) osa = map (octer n1 newc)
[ (bhx,bhy,tbz) , (bhx,bhy,bhz) , [ (bhx,bhy,tbz) , (bhx,bhy,bhz) ,
(thx,bhy,tbz) , (thx,bhy,bhz) , (thx,bhy,tbz) , (thx,bhy,bhz) ,
(bhx,thy,tbz) , (bhx,thy,bhz) , (bhx,thy,tbz) , (bhx,thy,bhz) ,
(thx,thy,tbz) , (thx,thy,bhz) ] (thx,thy,tbz) , (thx,thy,bhz) ]
osb = [(octer n1 newc (bhx,bhy,tbz)) , osb = [(octer n1 newc (bhx,bhy,tbz)) ,
(octer n1 newc (bhx,bhy,bhz)) , (octer n1 newc (bhx,bhy,bhz)) ,
(octer n1 newc (thx,bhy,tbz)) , (octer n1 newc (thx,bhy,tbz)) ,
(octer n1 newc (thx,bhy,bhz)) , (octer n1 newc (thx,bhy,bhz)) ,
(octer n1 newc (bhx,thy,tbz)) , (octer n1 newc (bhx,thy,tbz)) ,
(octer n1 newc (bhx,thy,bhz)) , (octer n1 newc (bhx,thy,bhz)) ,
(octer n1 newc (thx,thy,tbz)) , (octer n1 newc (thx,thy,tbz)) ,
(octer n1 newc (thx,thy,bhz)) ] (octer n1 newc (thx,thy,bhz)) ]
in in
if res < (pt 0) then if res < (pt 0) then
O_Full c O_Full c
else if res > (pt 0) then else if res > (pt 0) then
O_Empty O_Empty
else else
O_Sub c os O_Sub c os
{- {-
os = map (octer newc) os = map (octer newc)
[ (bhx,bhy,tbz) , (bhx,bhy,bhz) , [ (bhx,bhy,tbz) , (bhx,bhy,bhz) ,
(thx,bhy,tbz) , (thx,bhy,bhz) , (thx,bhy,tbz) , (thx,bhy,bhz) ,
(bhx,thy,tbz) , (bhx,thy,bhz) , (bhx,thy,tbz) , (bhx,thy,bhz) ,
(thx,thy,tbz) , (thx,thy,bhz) ] (thx,thy,tbz) , (thx,thy,bhz) ]
-} -}
calcn csg xyz = normalise (makevector f0 f1 f2 f3) calcn csg xyz = normalise (makevector f0 f1 f2 f3)
......
...@@ -34,7 +34,7 @@ qo (O_Sub s l) (Q_Empty ) = Q_Sub s z ...@@ -34,7 +34,7 @@ qo (O_Sub s l) (Q_Empty ) = Q_Sub s z
(l2:ll3) = ll2 ; (l3:ll4) = ll3 (l2:ll3) = ll2 ; (l3:ll4) = ll3
(l4:ll5) = ll4 ; (l5:ll6) = ll5 (l4:ll5) = ll4 ; (l5:ll6) = ll5
(l6:ll7) = ll6 ; (l7:ll8) = ll7 (l6:ll7) = ll6 ; (l7:ll8) = ll7
z = [ qo (l1) (qo (l0) Q_Empty) , z = [ qo (l1) (qo (l0) Q_Empty) ,
qo (l3) (qo (l2) Q_Empty) , qo (l3) (qo (l2) Q_Empty) ,
qo (l5) (qo (l4) Q_Empty) , qo (l5) (qo (l4) Q_Empty) ,
qo (l7) (qo (l6) Q_Empty) ] qo (l7) (qo (l6) Q_Empty) ]
...@@ -46,7 +46,7 @@ qo (O_Sub s l) (Q_Sub t k) = Q_Sub t z ...@@ -46,7 +46,7 @@ qo (O_Sub s l) (Q_Sub t k) = Q_Sub t z
(l6:ll7) = ll6 ; (l7:ll8) = ll7 (l6:ll7) = ll6 ; (l7:ll8) = ll7
(k0:kk1) = k ; (k1:kk2) = kk1 (k0:kk1) = k ; (k1:kk2) = kk1
(k2:kk3) = kk2 ; (k3:kk4) = kk3 (k2:kk3) = kk2 ; (k3:kk4) = kk3
z = [ qo (l1) (qo (l0) (k0)) , z = [ qo (l1) (qo (l0) (k0)) ,
qo (l3) (qo (l2) (k1)) , qo (l3) (qo (l2) (k1)) ,
qo (l5) (qo (l4) (k2)) , qo (l5) (qo (l4) (k2)) ,
qo (l7) (qo (l6) (k3)) ] qo (l7) (qo (l6) (k3)) ]
...@@ -54,7 +54,7 @@ qo o@(O_Full s) (Q_Sub t k) = Q_Sub t z ...@@ -54,7 +54,7 @@ qo o@(O_Full s) (Q_Sub t k) = Q_Sub t z
where where
(k0:kk1) = k ; (k1:kk2) = kk1 (k0:kk1) = k ; (k1:kk2) = kk1
(k2:kk3) = kk2 ; (k3:kk4) = kk3 (k2:kk3) = kk2 ; (k3:kk4) = kk3
z = [ qo o (k0) , qo o (k1) , z = [ qo o (k0) , qo o (k1) ,
qo o (k2) , qo o (k3) ] qo o (k2) , qo o (k3) ]
qo (O_Full s ) (q ) = Q_Full s qo (O_Full s ) (q ) = Q_Full s
...@@ -37,14 +37,14 @@ data Prim = Sphere FType FType FType FType ...@@ -37,14 +37,14 @@ data Prim = Sphere FType FType FType FType
| Cube FType FType FType FType | Cube FType FType FType FType
| Plane FType FType FType FType | Plane FType FType FType FType
| X | Y | Z | X | Y | Z
deriving Show{-was:Text-} deriving Show{-was:Text-}
data Ops = RotX FType data Ops = RotX FType
| RotY FType | RotY FType
| RotZ FType | RotZ FType
| Scale FType FType FType | Scale FType FType FType
| Trans FType FType FType | Trans FType FType FType
deriving Show{-was:Text-} deriving Show{-was:Text-}
data Csg = Object Prim data Csg = Object Prim
| Geom Csg Ops | Geom Csg Ops
...@@ -55,7 +55,7 @@ data Csg = Object Prim ...@@ -55,7 +55,7 @@ data Csg = Object Prim
| Inter Csg Csg | Inter Csg Csg
| Sub Csg Csg | Sub Csg Csg
| Comp Csg | Comp Csg
-- deriving Show{-was:Text-} -- deriving Show{-was:Text-}
-- type CsgOut = (R1 BI,Csg,Color,Bool) -- type CsgOut = (R1 BI,Csg,Color,Bool)
...@@ -68,7 +68,7 @@ type Calc = Color -> (R3 BI) -> CsgOut ...@@ -68,7 +68,7 @@ type Calc = Color -> (R3 BI) -> CsgOut
---------------------------------------------------------- ----------------------------------------------------------
data Color = RGB FType FType FType data Color = RGB FType FType FType
deriving Show{-was:Text-} deriving Show{-was:Text-}
---------------------------------------------------------- ----------------------------------------------------------
-- Matrix -- Matrix
...@@ -89,7 +89,7 @@ type R1 a = (a,a) ...@@ -89,7 +89,7 @@ type R1 a = (a,a)
---------------------------------------------------------- ----------------------------------------------------------
data Oct = O_Full Color | O_Empty | O_Sub Color [Oct] data Oct = O_Full Color | O_Empty | O_Sub Color [Oct]
deriving Show{-was:Text-} deriving Show{-was:Text-}
---------------------------------------------------------- ----------------------------------------------------------
-- Quad -- Quad
...@@ -98,7 +98,7 @@ data Oct = O_Full Color | O_Empty | O_Sub Color [Oct] ...@@ -98,7 +98,7 @@ data Oct = O_Full Color | O_Empty | O_Sub Color [Oct]
data Quad = Q_Empty | Q_Full Color data Quad = Q_Empty | Q_Full Color
| Q_Sub Color [Quad] | Q_Sub Color [Quad]
| Q_NewXY FType FType FType | Q_NewXY FType FType FType
deriving Show{-was:Text-} deriving Show{-was:Text-}
---------------------------------------------------------- ----------------------------------------------------------
-- Vector -- Vector
......
...@@ -38,7 +38,7 @@ len :: Vector -> FType ...@@ -38,7 +38,7 @@ len :: Vector -> FType
len (x,y,z) = ans len (x,y,z) = ans
where where
ans | sqs /= 0.0 = sqrt sqs ans | sqs /= 0.0 = sqrt sqs
| True = 1 | True = 1
sqs :: FType sqs :: FType
sqs = (x2 + y2 + z2) sqs = (x2 + y2 + z2)
x2 = x * x x2 = x * x
......
TOP = ../.. TOP = ../..
include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/boilerplate.mk
SRC_HC_OPTS += -cpp -package old-time SRC_DEPS = old-time
# kLongLivedTreeDepth = 17 :: Int # kLongLivedTreeDepth = 17 :: Int
# kArraySize = 500000 :: Int # kArraySize = 500000 :: Int
...@@ -13,7 +13,7 @@ NORM_OPTS = 18 500000 4 19 ...@@ -13,7 +13,7 @@ NORM_OPTS = 18 500000 4 19
SLOW_OPTS = 19 500000 5 22 SLOW_OPTS = 19 500000 5 22
ifeq "$(HEAP)" "LARGE" ifeq "$(HEAP)" "LARGE"
SRC_RUNTEST_OPTS += +RTS -H180m -RTS PROG_ARGS += +RTS -H180m -RTS
endif endif
include $(TOP)/mk/target.mk include $(TOP)/mk/target.mk
......
> {-# LANGUAGE CPP #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Abstract syntax for grammar files. Abstract syntax for grammar files.
......
This diff is collapsed.
> {-# LANGUAGE CPP #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
The Grammar data type. The Grammar data type.
......
> {-# LANGUAGE CPP #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
The lexer. The lexer.
......
> {-# LANGUAGE CPP #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
The main driver. The main driver.
......
...@@ -3,14 +3,15 @@ TOP = ../.. ...@@ -3,14 +3,15 @@ TOP = ../..
include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/boilerplate.mk
NORM_OPTS = TestInput.y NORM_OPTS = TestInput.y
SRC_HC_OPTS += -cpp -package containers SRC_HC_OPTS += -cpp
SRC_DEPS = containers
EXCLUDED_SRCS += TestInput.hs EXCLUDED_SRCS += TestInput.hs
ifeq "$(HEAP)" "LARGE" ifeq "$(HEAP)" "LARGE"
SRC_RUNTEST_OPTS += +RTS -H128m -RTS PROG_ARGS += +RTS -H128m -RTS
endif endif
ifeq "$(HEAP)" "OLD" ifeq "$(HEAP)" "OLD"
SRC_RUNTEST_OPTS += +RTS -H10m -RTS PROG_ARGS += +RTS -H10m -RTS
endif endif
include $(TOP)/mk/target.mk include $(TOP)/mk/target.mk
...@@ -30,4 +30,6 @@ The parser monad. ...@@ -30,4 +30,6 @@ The parser monad.
> m >>= k = P $ \s l -> case runP m s l of > m >>= k = P $ \s l -> case runP m s l of
> OkP a -> runP (k a) s l > OkP a -> runP (k a) s l
> FailP s -> FailP s > FailP s -> FailP s
> instance MonadFail P where
> fail s = P $ \ _ _ -> FailP s > fail s = P $ \ _ _ -> FailP s
This diff is collapsed.
module Paths_happy ( module Paths_happy (
version, version,
getBinDir, getLibDir, getDataDir, getLibexecDir, getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName getDataFileName
) where ) where
import Data.Version import Data.Version
......
{-# LANGUAGE CPP #-}
module Set ( module Set (
Set, null, member, empty, singleton, Set, null, member, empty, singleton,
union, difference, filter, fold, union, difference, filter, fold,
......
This diff is collapsed.
...@@ -16,7 +16,7 @@ module Parser ( parseModule, parseStmt, parseIdentifier, parseType, ...@@ -16,7 +16,7 @@ module Parser ( parseModule, parseStmt, parseIdentifier, parseType,
#include "HsVersions.h" #include "HsVersions.h"
import HsSyn import GHC.Hs
import RdrHsSyn import RdrHsSyn
import HscTypes ( IsBootInterface, DeprecTxt ) import HscTypes ( IsBootInterface, DeprecTxt )
import Lexer import Lexer
......
...@@ -6,7 +6,7 @@ NORM_OPTS = 5000000 ...@@ -6,7 +6,7 @@ NORM_OPTS = 5000000
SLOW_OPTS = 100000000 SLOW_OPTS = 100000000
ifeq "$(HEAP)" "LARGE" ifeq "$(HEAP)" "LARGE"
SRC_RUNTEST_OPTS += +RTS -H430m -RTS PROG_ARGS += +RTS -H430m -RTS
endif endif
include $(TOP)/mk/target.mk include $(TOP)/mk/target.mk
...@@ -6,7 +6,7 @@ NORM_OPTS = 1 2 2000 1000 1001 4000 ...@@ -6,7 +6,7 @@ NORM_OPTS = 1 2 2000 1000 1001 4000
SLOW_OPTS = 1 2 4000 1000 1001 4000 SLOW_OPTS = 1 2 4000 1000 1001 4000
ifeq "$(HEAP)" "LARGE" ifeq "$(HEAP)" "LARGE"
SRC_RUNTEST_OPTS += +RTS -H256m -RTS PROG_ARGS += +RTS -H256m -RTS
endif endif
include $(TOP)/mk/target.mk include $(TOP)/mk/target.mk
...@@ -5,10 +5,10 @@ include $(TOP)/mk/boilerplate.mk ...@@ -5,10 +5,10 @@ include $(TOP)/mk/boilerplate.mk
NORM_OPTS = 14 NORM_OPTS = 14
ifeq "$(HEAP)" "LARGE" ifeq "$(HEAP)" "LARGE"
SRC_RUNTEST_OPTS += +RTS -H8m -RTS PROG_ARGS += +RTS -H8m -RTS
endif endif
ifeq "$(HEAP)" "OLD" ifeq "$(HEAP)" "OLD"
SRC_RUNTEST_OPTS += +RTS -H10m -RTS PROG_ARGS += +RTS -H10m -RTS
endif endif
include $(TOP)/mk/target.mk include $(TOP)/mk/target.mk
...@@ -8,8 +8,8 @@ NORM_OPTS = 80 ...@@ -8,8 +8,8 @@ NORM_OPTS = 80
SLOW_OPTS = 90 SLOW_OPTS = 90
ifeq "$(HEAP)" "LARGE" ifeq "$(HEAP)" "LARGE"
SRC_RUNTEST_OPTS += +RTS -H16m -RTS PROG_ARGS += +RTS -H16m -RTS
endif endif
ifeq "$(HEAP)" "OLD" ifeq "$(HEAP)" "OLD"
SRC_RUNTEST_OPTS += +RTS -H10m -RTS PROG_ARGS += +RTS -H10m -RTS
endif endif
...@@ -7,14 +7,14 @@ all boot :: input ...@@ -7,14 +7,14 @@ all boot :: input
input : words input : words
cat words words words words words words words words words words >$@ cat words words words words words words words words words words >$@
SRC_HC_OPTS += -package containers SRC_DEPS = containers
NORM_OPTS = words input NORM_OPTS = words input
ifeq "$(HEAP)" "LARGE" ifeq "$(HEAP)" "LARGE"
SRC_RUNTEST_OPTS += +RTS -H32m -RTS PROG_ARGS += +RTS -H32m -RTS
endif endif
ifeq "$(HEAP)" "OLD" ifeq "$(HEAP)" "OLD"
SRC_RUNTEST_OPTS += +RTS -H10m -RTS PROG_ARGS += +RTS -H10m -RTS
endif endif
include $(TOP)/mk/target.mk include $(TOP)/mk/target.mk
...@@ -5,10 +5,10 @@ include $(TOP)/mk/boilerplate.mk ...@@ -5,10 +5,10 @@ include $(TOP)/mk/boilerplate.mk
PROG_ARGS = 27000.1 27000.2 PROG_ARGS = 27000.1 27000.2
ifeq "$(HEAP)" "LARGE" ifeq "$(HEAP)" "LARGE"
SRC_RUNTEST_OPTS += +RTS -H32m -RTS PROG_ARGS += +RTS -H32m -RTS
endif endif
ifeq "$(HEAP)" "OLD" ifeq "$(HEAP)" "OLD"
SRC_RUNTEST_OPTS += +RTS -H24m -RTS PROG_ARGS += +RTS -H24m -RTS
endif endif
include $(TOP)/mk/target.mk include $(TOP)/mk/target.mk
...@@ -6,4 +6,4 @@ FAST_OPTS = 150000 ...@@ -6,4 +6,4 @@ FAST_OPTS = 150000
NORM_OPTS = 1500000 NORM_OPTS = 1500000
SLOW_OPTS = 7500000 SLOW_OPTS = 7500000
SRC_HC_OPTS += -package array SRC_DEPS = array
...@@ -3,7 +3,7 @@ include $(TOP)/mk/boilerplate.mk ...@@ -3,7 +3,7 @@ include $(TOP)/mk/boilerplate.mk
-include opts.mk -include opts.mk
# Seems to be a real memory hog, this one # Seems to be a real memory hog, this one
SRC_RUNTEST_OPTS += +RTS -M300m -RTS PROG_ARGS += +RTS -M300m -RTS
include $(TOP)/mk/target.mk include $(TOP)/mk/target.mk
......
...@@ -59,7 +59,7 @@ endif ...@@ -59,7 +59,7 @@ endif
# All the standard gluing together, as in the comment right at the front # All the standard gluing together, as in the comment right at the front
HC_OPTS = $(BOOTSTRAPPING_PACKAGE_CONF_HC_OPTS) $(SRC_HC_OPTS) $(WAY$(_way)_HC_OPTS) $($*_HC_OPTS) $(EXTRA_HC_OPTS) HC_OPTS = $(BOOTSTRAPPING_PACKAGE_CONF_HC_OPTS) $(SRC_HC_OPTS) $(WAY$(_way)_HC_OPTS) $($*_HC_OPTS) $(EXTRA_HC_OPTS) $(addprefix -package, $(SRC_DEPS))
ifeq "$(HC_VERSION_GE_6_13)" "YES" ifeq "$(HC_VERSION_GE_6_13)" "YES"
HC_OPTS += -rtsopts HC_OPTS += -rtsopts
endif endif
......
TOP = ../.. TOP = ../..
include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/boilerplate.mk
SRC_RUNTEST_OPTS += 8400 PROG_ARGS += 8400
include $(TOP)/mk/target.mk include $(TOP)/mk/target.mk
...@@ -4,7 +4,7 @@ include $(TOP)/mk/boilerplate.mk ...@@ -4,7 +4,7 @@ include $(TOP)/mk/boilerplate.mk
# Override default SRCS; the default is all source files # Override default SRCS; the default is all source files
SRCS=parfact.hs SRCS=parfact.hs
SRC_RUNTEST_OPTS += 8000000 1000 PROG_ARGS += 8000000 1000
SRC_HC_OPTS += -package concurrent SRC_HC_OPTS += -package concurrent
include $(TOP)/mk/target.mk include $(TOP)/mk/target.mk
......
...@@ -3,7 +3,7 @@ include $(TOP)/mk/boilerplate.mk ...@@ -3,7 +3,7 @@ include $(TOP)/mk/boilerplate.mk
# Override default SRCS; the default is all source files # Override default SRCS; the default is all source files
SRCS=Main.hs SRCS=Main.hs
SRC_RUNTEST_OPTS += 20 PROG_ARGS += 20
SRC_HC_OPTS += -cpp -package concurrent SRC_HC_OPTS += -cpp -package concurrent
include $(TOP)/mk/target.mk include $(TOP)/mk/target.mk
......
...@@ -2,7 +2,7 @@ TOP = ../.. ...@@ -2,7 +2,7 @@ TOP = ../..
include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/boilerplate.mk
PROG_ARGS = 10000 15000000 PROG_ARGS = 10000 15000000
SRC_HC_OPTS += -package parallel SRC_DEPS += parallel
include $(TOP)/mk/target.mk include $(TOP)/mk/target.mk
...@@ -2,11 +2,11 @@ TOP = ../.. ...@@ -2,11 +2,11 @@ TOP = ../..
include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/boilerplate.mk
# This version just counts the results, and runs in constant space: # This version just counts the results, and runs in constant space:
# SRC_RUNTEST_OPTS += 7 1163 # PROG_ARGS += 7 1163
# This version builds a list of the results, and needs a lot of memory: # This version builds a list of the results, and needs a lot of memory:
SRC_RUNTEST_OPTS += 3 873 PROG_ARGS += 3 873
SRC_HC_OPTS += -package parallel SRC_DEPS = parallel
include $(TOP)/mk/target.mk include $(TOP)/mk/target.mk
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
-- which is included in the distribution. -- which is included in the distribution.
module CSG(module Construct, module CSG(module Construct,
module Geometry, module Geometry,
module Intersections, module Intersections,
module Interval, module Interval,
module Misc) where module Misc) where
import Construct import Construct
import Geometry import Geometry
......
...@@ -69,7 +69,7 @@ data CSG a ...@@ -69,7 +69,7 @@ data CSG a
-- the a is application-specific texture information -- the a is application-specific texture information
type Texture a = (Face, Point, a) type Texture a = (Face, Point, a)
union, intersect, difference :: CSG a -> CSG a -> CSG a union, intersect, difference :: CSG a -> CSG a -> CSG a
union p@(Box b1 _) q@(Box b2 _) = Box (mergeBox b1 b2) (Union p q) union p@(Box b1 _) q@(Box b2 _) = Box (mergeBox b1 b2) (Union p q)
union p q = Union p q union p q = Union p q
...@@ -85,25 +85,25 @@ difference p q = Difference p q ...@@ -85,25 +85,25 @@ difference p q = Difference p q
mkBox b p = Box b p mkBox b p = Box b p