Skip to content
Nathan Waivio edited this page Apr 22, 2022 · 25 revisions

Welcome to the cl3 wiki!

TODO:

  • Consider adding SParameters for two port scattering parameters
  • Investigate Inline vs Inlinable
  • Setup CI if possible
  • Link to books and/or other resources for general Clifford Algebra information
  • Make Cl3 parametric over the Floating Point numbers (Perhaps a 2.0 feature after my Posit Library is released)

To dump GHC Core to a file:

$ ~/.local/bin/stack build --force-dirty --flag cl3:do-no-derived-instances --flag cl3:do-no-random --flag cl3:do-no-storable --ghc-options '-ddump-simpl -ddump-to-file -fforce-recomp'

Test Results of Various Stackage Builds

  • lts-2.22 for GHC 7.8.4
  • lts-6.35 for GHC 7.10.3
  • lts-9.21 for GHC 8.0.2
  • lts-11.13 for GHC 8.2.2
  • nightly-2018-05-20 for GHC 8.4.2

cl3-1.0.0.2 Stack: lts-2.22 (GHC 7.8.4)

$ ~/.local/bin/stack setup

$ /usr/bin/time -v ~/.local/bin/stack build

Command being timed: "/home/waivina/.local/bin/stack build"
User time (seconds): 270.73
System time (seconds): 1.99
Percent of CPU this job got: 100%
Elapsed (wall clock) time (h:mm:ss or m:ss): 4:32.35
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 3642784
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 1244615
Voluntary context switches: 2746
Involuntary context switches: 233
Swaps: 0
File system inputs: 0
File system outputs: 720736
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0

Results

  • Compile Space: 3.47 GB
  • Compile Time: 4:32.35
  • Tests: Pass
  • Benchmark:

$ ~/.local/bin/stack bench

benchmarking nbodyBaseline/50000000
time                 12.40 s    (12.34 s .. 12.44 s)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 12.39 s    (12.38 s .. 12.40 s)
std dev              13.43 ms   (0.0 s .. 15.50 ms)
variance introduced by outliers: 19% (moderately inflated)

benchmarking nbodyCl3/50000000
time                 14.85 s    (14.68 s .. 15.03 s)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 14.81 s    (14.78 s .. 14.84 s)
std dev              40.03 ms   (0.0 s .. 44.42 ms)
variance introduced by outliers: 19% (moderately inflated)

benchmarking nbodyAPS/50000000
time                 173.7 s    (172.1 s .. 175.9 s)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 173.7 s    (173.3 s .. 174.0 s)
std dev              449.0 ms   (0.0 s .. 518.5 ms)
variance introduced by outliers: 19% (moderately inflated)

cl3-1.0.0.2 Stack: lts-6.35 (GHC 7.10.3)

$ ~/.local/bin/stack setup

$ /usr/bin/time -v ~/.local/bin/stack build

Command being timed: "~/.local/bin/stack build"
User time (seconds): 238.46
System time (seconds): 2.06
Percent of CPU this job got: 100%
Elapsed (wall clock) time (h:mm:ss or m:ss): 3:59.19
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 3317316
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 1380478
Voluntary context switches: 3492
Involuntary context switches: 300
Swaps: 0
File system inputs: 0
File system outputs: 853432
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0

Results

  • Compile Space: 3.16 GB
  • Compile Time: 3:59.19
  • Tests: Pass
  • Benchmark:

$ ~/.local/bin/stack bench

benchmarking nbodyBaseline/50000000
time                 13.01 s    (12.97 s .. 13.07 s)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 13.05 s    (13.04 s .. 13.05 s)
std dev              7.954 ms   (0.0 s .. 9.170 ms)
variance introduced by outliers: 19% (moderately inflated)

benchmarking nbodyCl3/50000000
time                 15.35 s    (14.82 s .. 15.96 s)
                     1.000 R²   (NaN R² .. 1.000 R²)
mean                 15.27 s    (15.15 s .. 15.34 s)
std dev              107.5 ms   (0.0 s .. 117.0 ms)
variance introduced by outliers: 19% (moderately inflated)

benchmarking nbodyAPS/50000000
time                 157.6 s    (141.9 s .. 169.7 s)
                     0.999 R²   (0.996 R² .. 1.000 R²)
mean                 161.5 s    (158.7 s .. 163.4 s)
std dev              2.798 s    (0.0 s .. 3.231 s)
variance introduced by outliers: 19% (moderately inflated)

cl3-1.0.0.2 Stack: lts-9.21 (GHC 8.0.2)

$ ~/.local/bin/stack setup

$ /usr/bin/time -v ~/.local/bin/stack build

Command being timed: "~/.local/bin/stack build"
User time (seconds): 254.76
System time (seconds): 2.57
Percent of CPU this job got: 100%
Elapsed (wall clock) time (h:mm:ss or m:ss): 4:17.33
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 3679892
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 1606875
Voluntary context switches: 2977
Involuntary context switches: 584
Swaps: 0
File system inputs: 0
File system outputs: 917888
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0

Results:

  • Compile Space: 3.5 GB (w/o Generics 3.4 GB)
  • Compile Time: 4:17.33 (w/o Generics 4:01.98)
  • Tests: Pass
  • Benchmark:

$ ~/.local/bin/stack bench

benchmarking nbodyBaseline/50000000
time                 13.78 s    (13.24 s .. 14.92 s)
                     0.999 R²   (0.998 R² .. 1.000 R²)
mean                 13.38 s    (13.22 s .. 13.67 s)
std dev              252.6 ms   (0.0 s .. 262.7 ms)
variance introduced by outliers: 19% (moderately inflated)

benchmarking nbodyCl3/50000000
time                 15.98 s    (15.45 s .. 17.10 s)
                     0.999 R²   (0.999 R² .. 1.000 R²)
mean                 15.65 s    (15.51 s .. 15.78 s)
std dev              230.1 ms   (0.0 s .. 231.6 ms)
variance introduced by outliers: 19% (moderately inflated)

benchmarking nbodyAPS/50000000
time                 160.3 s    (148.0 s .. 171.2 s)
                     0.999 R²   (0.997 R² .. 1.000 R²)
mean                 159.6 s    (156.9 s .. 161.1 s)
std dev              2.361 s    (0.0 s .. 2.576 s)
variance introduced by outliers: 19% (moderately inflated)

cl3-1.0.0.2 Stack: lts-11.13 (GHC 8.2.2)

$ ~/.local/bin/stack setup

$ /usr/bin/time -v ~/.local/bin/stack build

Command being timed: "~/.local/bin/stack build"
User time (seconds): 1592.26
System time (seconds): 16.93
Percent of CPU this job got: 100%
Elapsed (wall clock) time (h:mm:ss or m:ss): 26:40.15
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 34404872
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 12
Minor (reclaiming a frame) page faults: 15408697
Voluntary context switches: 162833
Involuntary context switches: 1559
Swaps: 0
File system inputs: 0
File system outputs: 3611448
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0

Results:

  • Compile Space: 32.8 GB
  • Compile Time: 26:40.15 (w/o Generics 25:50.80, w/-O1 24:47.84, w/-O0 0:07.37)
  • Tests: Pass
  • Benchmark:

$ ~/.local/bin/stack bench

benchmarking nbodyBaseline/50000000
time                 9.826 s    (9.481 s .. 10.11 s)
                     1.000 R²   (0.999 R² .. 1.000 R²)
mean                 9.820 s    (9.746 s .. 9.865 s)
std dev              67.91 ms   (0.0 s .. 76.53 ms)
variance introduced by outliers: 19% (moderately inflated)

benchmarking nbodyCl3/50000000
time                 11.82 s    (11.33 s .. 12.05 s)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 11.73 s    (11.61 s .. 11.80 s)
std dev              105.8 ms   (0.0 s .. 120.7 ms)
variance introduced by outliers: 19% (moderately inflated)

benchmarking nbodyAPS/50000000
time                 185.7 s    (182.2 s .. 190.4 s)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 186.2 s    (185.3 s .. 186.7 s)
std dev              818.8 ms   (0.0 s .. 880.1 ms)
variance introduced by outliers: 19% (moderately inflated)

cl3-1.0.0.2 Stack: nightly-2018-05-20 (ghc-8.4.2)

$ ~/.local/bin/stack setup

$ /usr/bin/time -v ~/.local/bin/stack build

Command being timed: "~/.local/bin/stack build"
User time (seconds): 1619.93
System time (seconds): 18.03
Percent of CPU this job got: 100%
Elapsed (wall clock) time (h:mm:ss or m:ss): 27:08.89
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 33405700
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 13
Minor (reclaiming a frame) page faults: 16254336
Voluntary context switches: 165972
Involuntary context switches: 4255
Swaps: 0
File system inputs: 8
File system outputs: 3587072
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0

Results:

  • Compile Space: 31.8 GB
  • Compile Time: 27:08.89
  • Tests: Pass
  • Benchmark Results:

$ ~/.local/bin/stack bench

benchmarking nbodyBaseline/50000000
time                 9.391 s    (9.349 s .. 9.449 s)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 9.404 s    (9.391 s .. 9.416 s)
std dev              15.46 ms   (7.139 ms .. 19.64 ms)
variance introduced by outliers: 19% (moderately inflated)

benchmarking nbodyCl3/50000000
time                 10.03 s    (9.935 s .. 10.16 s)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 10.01 s    (9.979 s .. 10.02 s)
std dev              26.84 ms   (10.01 ms .. 37.09 ms)
variance introduced by outliers: 19% (moderately inflated)

benchmarking nbodyAPS/50000000
time                 174.1 s    (173.5 s .. 174.6 s)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 174.1 s    (174.0 s .. 174.2 s)
std dev              95.58 ms   (33.88 ms .. 129.8 ms)
variance introduced by outliers: 19% (moderately inflated)

cl3-1.0.0.3 Stack: nightly-2018-05-20 (ghc-8.4.2) Worker/Wrapper Investigation

  • Compile Time and Space with "-fno-worker-wrapper":

$ ~/.local/bin/stack setup

$ /usr/bin/time -v ~/.local/bin/stack build

Command being timed: "/home/waivina/.local/bin/stack build"
User time (seconds): 44.78
System time (seconds): 0.66
Percent of CPU this job got: 99%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:45.68
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 672440
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 36
Minor (reclaiming a frame) page faults: 307319
Voluntary context switches: 6703
Involuntary context switches: 181
Swaps: 0
File system inputs: 147216
File system outputs: 111440
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0

Results:

  • Compile Space: 656.6 MB
  • Compile Time: 0:45.68
  • Tests: Pass
  • Benchmark Results:

$ ~/.local/bin/stack bench

benchmarking nbodyBaseline/50000000
time                 9.271 s    (9.231 s .. 9.344 s)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 9.495 s    (9.407 s .. 9.636 s)
std dev              133.9 ms   (53.72 ms .. 174.3 ms)
variance introduced by outliers: 19% (moderately inflated)

benchmarking nbodyCl3/50000000
time                 10.10 s    (9.797 s .. 10.30 s)
                     1.000 R²   (NaN R² .. 1.000 R²)
mean                 10.10 s    (10.05 s .. 10.16 s)
std dev              58.98 ms   (28.18 ms .. 72.96 ms)
variance introduced by outliers: 19% (moderately inflated)

benchmarking nbodyAPS/50000000
time                 178.6 s    (NaN s .. 181.1 s)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 177.2 s    (175.5 s .. 178.2 s)
std dev              1.670 s    (618.8 ms .. 2.283 s)
variance introduced by outliers: 19% (moderately inflated)

cl3-1.0.0.4 Stack: lts-12.6 (GHC 8.4.3)

$ ~/.local/bin/stack setup

$ /usr/bin/time -v ~/.local/bin/stack build

Command being timed: "/home/waivina/.local/bin/stack build"
User time (seconds): 84.70
System time (seconds): 2.45
Percent of CPU this job got: 101%
Elapsed (wall clock) time (h:mm:ss or m:ss): 1:26.22
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 1414800
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 19
Minor (reclaiming a frame) page faults: 1011606
Voluntary context switches: 16934
Involuntary context switches: 145
Swaps: 0
File system inputs: 182336
File system outputs: 2673456
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0

Results:

  • Compile Space: 1.3 GB
  • Compile Time: 1:26.22
  • Tests: Pass
  • Benchmark:

$ ~/.local/bin/stack bench

benchmarking nbodyBaseline/50000000
time                 9.465 s    (9.423 s .. 9.498 s)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 9.479 s    (9.470 s .. 9.488 s)
std dev              10.28 ms   (5.337 ms .. 13.14 ms)
variance introduced by outliers: 19% (moderately inflated)

benchmarking nbodyCl3/50000000
time                 10.11 s    (9.932 s .. 10.20 s)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 10.09 s    (10.05 s .. 10.13 s)
std dev              44.90 ms   (16.16 ms .. 61.09 ms)
variance introduced by outliers: 19% (moderately inflated)

benchmarking nbodyAPS/50000000
time                 184.2 s    (172.7 s .. 189.9 s)
                     1.000 R²   (0.999 R² .. 1.000 R²)
mean                 184.9 s    (183.4 s .. 186.2 s)
std dev              1.838 s    (1.125 s .. 2.202 s)
variance introduced by outliers: 19% (moderately inflated)