Home

Awesome

Solutions to Advent of Code puzzles using the Lamellar Runtime.

For most these problems, there appears to exist an efficient serial implementation, limiting the benefit of a parallel (and distributed) runtime. Still, this is an effort to explore Lamellar and provide some examples on how to use the runtime!

Generally, I will implement a serial solution as well as at least one Lamellar based solution.

I utilize the cargo-aoc crate as the execution harness.

install using cargo install cargo-aoc

run using cargo aoc optionally specifying a day with -d <day>

bench using cargo aoc bench optionally specifying a day with -d <day> and including the input parsing with -g

Performance

Run in WSL on an AMD 7950x

<table> <tr><th>Day</th><th>Part 1 Performance</th><th>Part 2 Performance</th></tr> <tr><td>
DImplementation
1Serial
1Active Message
2Serial
2Active Message
3Serial
3Active Message
4Serial
4Active Message
5Serial
5Active Message
6Serial
6Active Message
7Serial
7Active Message
8Serial
8Lamellar Array
9Serial
9Active Message
10Serial
10Active Message
11Serial
11Active Message
12Serial
12Active Message
13Serial
13Active Message
14Serial
14Active Message
15Serial
15Active Message
16Serial
16Active Message
17Serial
17Active Message
</td><td>
GeneratorRunnerTotal
14.032 ns16.779 µs16.793 µs
63.054 µs5.0559 µs68.109 µs
13.841 ns32.918 µs32.931 µs
16.551 µs10.880 µs27.431 µs
5.4154 µs29.827 µs35.242 µs
24.537 µs12.151 µs36.688 µs
14.200 ns270.32 µs270.334 µs
22.012 µs62.169 µs84.181 µs
13.757 ns17.769 µs17.782 µs
13.837 ns43.560 µs43.573 µs
195.02 ns14.865 ns209.885 ns
199.93 ns2.7972 µs2.996 µs
13.784 ns127.97 µs127.98 µs
28.847 µs159.19 µs188.037 µs
8.8126 µs22.189 µs31.0 µs
42.615 µs23.770 ms23.812 ms
81.735 µs23.400 µs105.135 µs
80.600 µs9.2678 µs89.868 µs
14.266 ns71.391 µs71.40 µs
14.031 ns161.86 µs161.87 µs
13.945 ns50.208 µs
13.986 ns27.313 µs
13.806 ns332.89 µs332.90 µs
13.950 ns190.53 µs190.54 µs
47.878 µs22.416 µs70.294 µs
111.10 µs10.529 µs121.629 µs
13.949 ns8.9763 µs8.9893 µs
14.015 ns26.257 µs26.271 µs
13.783 ns22.018 µs22.031 µs
110.73 µs4.0274 µs114.75 µs
22.668 µs466.67 µs489.34 µs
23.969 µs676.32 µs700.29 µs
21.387 µs95.200 ms95.221 ms
20.865 µs317.46 ms317.48 ms
</td><td>
GeneratorRunnerTotal
14.011 ns283.80 µs283.81 µs
72.646 µs60.733 µs133.37 µs
13.786 ns33.285 µs33.298 µs
16.181 µs9.4443 µs27.625 µs
5.1958 µs37.210 µs42.405 µs
24.124 µs11.453 µs35.177 µs
13.715 ns299.45 µs313.165 µs
21.927 µs78.105 µs100.032 µs
13.779 ns38.057 µs38.070 µs
14.019 ns54.063 µs54.077 µs
145.28 ns4.8219 ns150.1 ns
146.73 ns789.15 ns935.8 ns
13.800 ns148.86 µs148.87 µs
29.071 µs165.84 µs183.91 µs
9.1250 µs154.30 µs163.42 µs
69.443 µs66.549 ms66.62 ms
80.005 µs30.690 µs110.690 µs
80.010 µs56.556 µs136.566 µs
14.084 ns225.58 µs225.59 µs
14.043 ns180.32 µs180.33 µs
14.030 ns50.487 µs
14.020 ns27.679 µs
14.052 ns20.596 ms20.596 ms
13.889 ns5.561 ms5.561 ms
49.435 µs134.58 µs183.493 µs
112.14 µs51.599 µs163.739 µs
14.087 ns3.4685 ms3.4685 ms
14.069 ns6.5674 ms6.5674 ms
13.834 ns113.54 µs113.55 µs
149.66 µs34.455 µs184.02 µs
25.022 µs129.08 ms129.1 ms
22.919 µs26.667 ms26.689 ms
21.871 µs µs336.22 ms336.24 ms
20.801 µs1.1098 s1.1098 s
</td></tr> </table>