Index: doc/theses/thierry_delisle_PhD/thesis/text/eval_micro.tex
===================================================================
--- doc/theses/thierry_delisle_PhD/thesis/text/eval_micro.tex	(revision 0e34a143acbc54c5601c223ddac0cac229d6e477)
+++ doc/theses/thierry_delisle_PhD/thesis/text/eval_micro.tex	(revision 36cc24a9ce0e8d7cf82385365ff579f4bd309003)
@@ -1,6 +1,8 @@
 \chapter{Micro-Benchmarks}\label{microbench}
 
-The first step in evaluating this work is to test-out small controlled cases to ensure the basics work properly.
-This chapter presents five different experimental setup, evaluating some of the basic features of \CFA's scheduler.
+The first step in evaluating this work is to test small controlled cases to ensure the basics work properly.
+This chapter presents five different experimental setups, evaluating the basic features of the \CFA, libfibre~\cite{libfibre}, Go, and Tokio~\cite{Tokio} schedulers.
+All of these systems have a \gls{uthrding} model.
+Note, all tests in each system are functionally identical and available online~\cite{SchedulingBenchmarks}.
 
 \section{Benchmark Environment}\label{microenv}
@@ -20,13 +22,23 @@
 \end{description}
 
-For all benchmarks, @taskset@ is used to limit the experiment to 1 NUMA Node with no hyper threading.
-If more \glspl{hthrd} are needed, then 1 NUMA Node with hyperthreading is used.
-If still more \glspl{hthrd} are needed, then the experiment is limited to as few NUMA Nodes as needed.
+For all benchmarks, @taskset@ is used to limit the experiment to 1 NUMA node with no hyper threading.
+If more \glspl{hthrd} are needed, then 1 NUMA node with hyperthreading is used.
+If still more \glspl{hthrd} are needed, then the experiment is limited to as few NUMA nodes as needed.
 
 The limited sharing of the last-level cache on the AMD machine is markedly different than the Intel machine.
-Indeed, while on both architectures L2 cache misses that are served by L3 caches on a different CPU incur a significant latency, on the AMD it is also the case that cache misses served by a different L3 instance on the same CPU still incur high latency.
+Indeed, while on both architectures L2 cache misses that are served by L3 caches on a different CPU incur a significant latency, on the AMD it is also the case that cache misses served by a different L3 instance on the same CPU also incur high latency.
 
 
 \section{Cycling latency}
+
+The most basic evaluation of any ready queue is the latency needed to push and pop one element from the ready queue.
+Since these two operations also describe a @yield@ operation, many systems use this operation as the fundamental benchmark.
+However, yielding can be treated as a special case by optimizing it away since the number of ready \ats does not change.
+Hence, systems that perform this optimization have an artificial performance benefit because the yield becomes a \emph{nop}.
+For this reason, I chose a different first benchmark, called \newterm{Cycle Benchmark}.
+This benchmark arranges a number of \ats into a ring, as seen in Figure~\ref{fig:cycle}, where the ring is a circular singly-linked list.
+At runtime, each \at unparks the next \at before parking itself.
+Unparking the next \at pushes that \at onto the ready queue while the ensuing park leads to a \at being popped from the ready queue.
+
 \begin{figure}
 	\centering
@@ -35,21 +47,12 @@
 	\label{fig:cycle}
 \end{figure}
-The most basic evaluation of any ready queue is to evaluate the latency needed to push and pop one element from the ready queue.
-Since these two operation also describe a @yield@ operation, many systems use this operation as the most basic benchmark.
-However, yielding can be treated as a special case and some aspects of the scheduler can be optimized away since the number of ready \ats does not change.
-Not all systems perform this type of optimization, but those that do have an artificial performance benefit because the yield becomes a \emph{nop}.
-For this reason, I chose a different first benchmark, called \newterm{Cycle Benchmark}.
-This benchmark arranges a number of \ats into a ring, as seen in Figure~\ref{fig:cycle}, where the ring is a circular singly-linked list.
-At runtime, each \at unparks the next \at before parking itself.
-Unparking the next \at pushes that \at onto the ready queue while the ensuing park leads to a \at being popped from the ready queue.
-
-Hence, the underlying runtime cannot rely on the number of ready \ats staying constant over the duration of the experiment.
-In fact, the total number of \ats waiting on the ready queue is expected to vary because of the delay between the next \at unparking and the current \at parking.
-That is, the runtime cannot anticipate that the current task will immediately park.
-As well, the size of the cycle is also decided based on this delay.
-Note that, an unpark is like a V on a semaphore, so the subsequent park (P) may not block.
-If this happens, the scheduler push and pop are avoided and the results of the experiment would be skewed.
-Because of time-slicing or because cycles can be spread over multiple \procs, a small cycle may see the chain of unparks go full circle before the first \at parks.
-Every runtime system must handle this race and but cannot optimized away the ready-queue pushes and pops if the cycle is long enough.
+
+Therefore, the underlying runtime cannot rely on the number of ready \ats staying constant over the duration of the experiment.
+In fact, the total number of \ats waiting on the ready queue is expected to vary because of the race between the next \at unparking and the current \at parking.
+That is, the runtime cannot anticipate that the current task immediately parks.
+As well, the size of the cycle is also decided based on this race, \eg a small cycle may see the chain of unparks go full circle before the first \at parks because of time-slicing or multiple \procs.
+If this happens, the scheduler push and pop are avoided and the results of the experiment are skewed.
+(Note, an unpark is like a V on a semaphore, so the subsequent park (P) may not block.)
+Every runtime system must handle this race and cannot optimized away the ready-queue pushes and pops.
 To prevent any attempt of silently omitting ready-queue operations, the ring of \ats is made big enough so the \ats have time to fully park before being unparked again.
 Finally, to further mitigate any underlying push/pop optimizations, especially on SMP machines, multiple rings are created in the experiment.
@@ -73,123 +76,130 @@
 \caption[Cycle Benchmark : Pseudo Code]{Cycle Benchmark : Pseudo Code}
 \label{fig:cycle:code}
+%\end{figure}
+
+\bigskip
+
+%\begin{figure}
+	\subfloat[][Throughput, 100 cycles per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+			\input{result.cycle.jax.ops.pstex_t}
+		}
+		\label{fig:cycle:jax:ops}
+	}
+	\subfloat[][Throughput, 1 cycle per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+			\input{result.cycle.low.jax.ops.pstex_t}
+		}
+		\label{fig:cycle:jax:low:ops}
+	}
+
+	\subfloat[][Scalability, 100 cycles per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+			\input{result.cycle.jax.ns.pstex_t}
+		}
+		\label{fig:cycle:jax:ns}
+	}
+	\subfloat[][Scalability, 1 cycle per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+			\input{result.cycle.low.jax.ns.pstex_t}
+		}
+		\label{fig:cycle:jax:low:ns}
+	}
+	\caption[Cycle Benchmark on Intel]{Cycle Benchmark on Intel\smallskip\newline Throughput and scalability as a function of \proc count, 5 \ats per cycle, and different cycle count. For throughput, higher is better, for scalability, lower is better. Each series represent 15 independent runs, the dotted lines are maximums while the solid line is the medium.}
+	\label{fig:cycle:jax}
 \end{figure}
 
 \subsection{Results}
-\begin{figure}
-	\subfloat[][Throughput, 100 cycles per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-			\input{result.cycle.jax.ops.pstex_t}
-		}
-		\label{fig:cycle:jax:ops}
-	}
-	\subfloat[][Throughput, 1 cycle per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-			\input{result.cycle.low.jax.ops.pstex_t}
-		}
-		\label{fig:cycle:jax:low:ops}
-	}
-
-	\subfloat[][Scalability, 100 cycles per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-			\input{result.cycle.jax.ns.pstex_t}
-		}
-		\label{fig:cycle:jax:ns}
-	}
-	\subfloat[][Scalability, 1 cycle per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-			\input{result.cycle.low.jax.ns.pstex_t}
-		}
-		\label{fig:cycle:jax:low:ns}
-	}
-	\caption[Cycle Benchmark on Intel]{Cycle Benchmark on Intel\smallskip\newline Throughput and Scalability as a function of \proc count 5 \ats per cycle and different cycle count. For Throughput higher is better, for Scalability lower is better. Each series represent 15 independent runs, the dotted lines are extremums while the solid line is the medium.}
-	\label{fig:cycle:jax}
-\end{figure}
-
-\begin{figure}
-	\subfloat[][Throughput, 100 cycles per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-			\input{result.cycle.nasus.ops.pstex_t}
-		}
-		\label{fig:cycle:nasus:ops}
-	}
-	\subfloat[][Throughput, 1 cycle per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-			\input{result.cycle.low.nasus.ops.pstex_t}
-		}
-		\label{fig:cycle:nasus:low:ops}
-	}
-
-	\subfloat[][Scalability, 100 cycles per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-			\input{result.cycle.nasus.ns.pstex_t}
-		}
-		\label{fig:cycle:nasus:ns}
-	}
-	\subfloat[][Scalability, 1 cycle per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-			\input{result.cycle.low.nasus.ns.pstex_t}
-		}
-		\label{fig:cycle:nasus:low:ns}
-	}
-	\caption[Cycle Benchmark on AMD]{Cycle Benchmark on AMD\smallskip\newline Throughput and Scalability as a function of \proc count 5 \ats per cycle and different cycle count. For Throughput higher is better, for Scalability lower is better. Each series represent 15 independent runs, the dotted lines are extremums while the solid line is the medium.}
-	\label{fig:cycle:nasus}
-\end{figure}
-Figure~\ref{fig:cycle:jax} and Figure~\ref{fig:cycle:nasus} shows the throughput as a function of \proc count on Intel and AMD respectively, where each cycle has 5 \ats.
+
+Figures~\ref{fig:cycle:jax} and~\ref{fig:cycle:nasus} show the throughput as a function of \proc count on Intel and AMD respectively, where each cycle has 5 \ats.
 The graphs show traditional throughput on the top row and \newterm{scalability} on the bottom row.
-Where scalability uses the same data but the Y axis is calculated as the number of \procs over the throughput.
+Scalability uses the same data as throughput but the Y axis is calculated as the number of \procs over the throughput.
 In this representation, perfect scalability should appear as a horizontal line, \eg, if doubling the number of \procs doubles the throughput, then the relation stays the same.
 The left column shows results for 100 cycles per \proc, enough cycles to always keep every \proc busy.
-The right column shows results for only 1 cycle per \proc, where the ready queues are expected to be near empty at all times.
-The distinction is meaningful because the idle sleep subsystem is expected to matter only in the right column, where spurious effects can cause a \proc to run out of work temporarily.
-
-The experiment was run 15 times for each series and processor count and the \emph{$\times$}s on the graph show all of the results obtained.
-Each series also has a solid and two dashed lines highlighting the median, maximum and minimum result respectively.
-This presentation offers an overview of the distribution of the results for each series.
+The right column shows results for 1 cycle per \proc, where the ready queues are expected to be near empty most of the time.
+The distinction between 100 and 1 cycles is meaningful because the idle sleep subsystem is expected to matter only in the right column, where spurious effects can cause a \proc to run out of work temporarily.
+
+\begin{figure}
+	\subfloat[][Throughput, 100 cycles per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+			\input{result.cycle.nasus.ops.pstex_t}
+		}
+		\label{fig:cycle:nasus:ops}
+	}
+	\subfloat[][Throughput, 1 cycle per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+			\input{result.cycle.low.nasus.ops.pstex_t}
+		}
+		\label{fig:cycle:nasus:low:ops}
+	}
+
+	\subfloat[][Scalability, 100 cycles per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+			\input{result.cycle.nasus.ns.pstex_t}
+		}
+		\label{fig:cycle:nasus:ns}
+	}
+	\subfloat[][Scalability, 1 cycle per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+			\input{result.cycle.low.nasus.ns.pstex_t}
+		}
+		\label{fig:cycle:nasus:low:ns}
+	}
+	\caption[Cycle Benchmark on AMD]{Cycle Benchmark on AMD\smallskip\newline Throughput and scalability as a function of \proc count, 5 \ats per cycle, and different cycle count. For throughput, higher is better, for scalability, lower is better. Each series represent 15 independent runs, the dotted lines are extremes while the solid line is the medium.}
+	\label{fig:cycle:nasus}
+\end{figure}
+
+The experiment ran 15 times for each series and processor count.
+Each series has a solid and two dashed lines representing the median, maximum and minimum result respectively, where the minimum/maximum lines are referred to as the \emph{extremes}.\footnote{
+An alternative display is to use error bars with min/max as the bottom/top for the bar.
+However, this approach is not truly an error bar around a mean value and I felt the connected lines are easier to read.}
+This graph presentation offers an overview of the distribution of the results for each series.
 
 The experimental setup uses taskset to limit the placement of \glspl{kthrd} by the operating system.
-As mentioned in Section~\ref{microenv}, the experiement is setup to prioritize running on 2 \glspl{hthrd} per core before running on multiple sockets.
-For the Intel machine, this means that from 1 to 24 \procs, one socket and \emph{no} hyperthreading is used and from 25 to 48 \procs, still only one socket but \emph{with} hyperthreading.
+As mentioned in Section~\ref{microenv}, the experiment is setup to prioritize running on two \glspl{hthrd} per core before running on multiple sockets.
+For the Intel machine, this means that from 1 to 24 \procs one socket and \emph{no} hyperthreading is used, and from 25 to 48 \procs still only one socket is used but \emph{with} hyperthreading.
 This pattern is repeated between 49 and 96, between 97 and 144, and between 145 and 192.
 On AMD, the same algorithm is used, but the machine only has 2 sockets.
-So hyperthreading\footnote{Hyperthreading normally refers specifically to the technique used by Intel, however here it is loosely used to refer to AMD's equivalent feature.} is used when the \proc count reach 65 and 193.
-
+So hyperthreading\footnote{
+Hyperthreading normally refers specifically to the technique used by Intel, however it is often used generically to refer to any equivalent feature.}
+is used when the \proc count reach 65 and 193.
+
+The performance goal of \CFA is to obtain equivalent performance to other less fair schedulers.
 Figure~\ref{fig:cycle:jax:ops} and Figure~\ref{fig:cycle:jax:ns} show that for 100 cycles per \proc, \CFA, Go and Tokio all obtain effectively the same performance.
 Libfibre is slightly behind in this case but still scales decently.
-As a result of the \gls{kthrd} placement, we can see that additional \procs from 25 to 48 offer less performance improvements for all runtimes.
+As a result of the \gls{kthrd} placement, additional \procs from 25 to 48 offer less performance improvements for all runtimes.
 As expected, this pattern repeats between \proc count 72 and 96.
-The performance goal of \CFA is to obtain equivalent performance to other, less fair schedulers and that is what results show.
-Figure~\ref{fig:cycle:jax:ops} and \ref{fig:cycle:jax:ns} show very good throughput and scalability for all runtimes.
+Hence, Figures~\ref{fig:cycle:jax:ops} and \ref{fig:cycle:jax:ns} show very good throughput and scalability for all runtimes.
 
 When running only a single cycle, the story is slightly different.
-\CFA and tokio obtain very smiliar results overall, but tokio shows notably more variations in the results.
-While \CFA, Go and tokio achive equivalent performance with 100 cycles per \proc, with only 1 cycle per \proc Go achieves slightly better performance.
+\CFA and Tokio obtain very similar results overall, but Tokio shows notably more variations in the results.
+While \CFA, Go and Tokio achieve equivalent performance with 100 cycles per \proc, with only 1 cycle per \proc, Go achieves slightly better performance.
 This difference in throughput and scalability is due to the idle-sleep mechanism.
-With very few cycles, stealing or helping can cause a cascade of tasks migration and trick \proc into very short idle sleeps.
-Both effect will negatively affect performance.
-
-An interesting and unusual result is that libfibre achieves better performance with fewer cycle.
+With very few cycles, stealing or helping can cause a cascade of tasks migration and trick a \proc into very short idle sleeps, which negatively affect performance.
+
+An interesting and unusual result is that libfibre achieves better performance with 1 cycle.
 This suggest that the cascade effect is never present in libfibre and that some bottleneck disappears in this context.
 However, I did not investigate this result any deeper.
 
 Figure~\ref{fig:cycle:nasus} show a similar story happening on AMD as it does on Intel.
-The different performance improvements and plateaus due to cache topology appear at the expected \proc counts of 64, 128 and 192, for the same reasons as on Intel.
-Unlike Intel, on AMD all 4 runtimes achieve very similar throughput and scalability for 100 cycles per \proc.
+The different performance improvements and plateaus are due to cache topology and appear at the expected \proc counts of 64, 128 and 192, for the same reasons as on Intel.
+Unlike Intel, on AMD all 4 runtimes achieve very similar throughput and scalability for 100 cycles per \proc, with some variations in the results.
 
 In the 1 cycle per \proc experiment, the same performance increase for libfibre is visible.
-However, unlike on Intel, tokio achieves the same performance as Go rather than \CFA.
+However, unlike on Intel, Tokio achieves the same performance as Go rather than \CFA.
 This leaves \CFA trailing behind in this particular case, but only at hight core counts.
-Presumably this is because in this case, \emph{any} helping is likely to cause a cascade of \procs running out of work and attempting to steal.
-Since this effect is only problematic in cases with 1 \at per \proc it is not very meaningful for the general performance.
-
-The conclusion from both architectures is that all of the compared runtime have fairly equivalent performance in this scenario.
-Which demonstrate that in this case \CFA achieves equivalent performance.
+For this case, \emph{any} helping is likely to cause a cascade of \procs running out of work and attempting to steal.
+Essentially, \CFA's fairness must result in slower performance in some workload.
+Fortunately, this effect is only problematic in pathological cases, \eg with 1 \at per \proc, which seldom occurs in most workloads.
+
+The conclusion from both architectures is that all of the compared runtime have fairly equivalent performance for this micro-benchmark.
+This result shows that the \CFA scheduler has achieved the goal of obtaining equivalent performance to other less fair schedulers.
 
 \section{Yield}
 For completion, the classic yield benchmark is included.
-This benchmark is simpler than the cycle test: it creates many \ats that call @yield@.
+Here, the throughput is dominated by the mechanism used to handle the @yield@ function.
+Figure~\ref{fig:yield:code} shows pseudo code for this benchmark, where the cycle @wait/next.wake@ is replaced by @yield@.
 As mentioned, this benchmark may not be representative because of optimization shortcuts in @yield@.
-The only interesting variable in this benchmark is the number of \ats per \procs, where ratios close to 1 means the ready queue(s) can be empty.
-This scenario can put a strain on the idle-sleep handling compared to scenarios where there is plenty of work.
-Figure~\ref{fig:yield:code} shows pseudo code for this benchmark, where the @wait/next.wake@ is replaced by @yield@.
+The only interesting variable in this benchmark is the number of \ats per \procs, where ratios close to 1 means the ready queue(s) can be empty, which again puts a strain on the idle-sleep handling.
 
 \begin{figure}
@@ -207,53 +217,78 @@
 \caption[Yield Benchmark : Pseudo Code]{Yield Benchmark : Pseudo Code}
 \label{fig:yield:code}
+%\end{figure}
+\bigskip
+%\begin{figure}
+	\subfloat[][Throughput, 100 \ats per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+			\input{result.yield.jax.ops.pstex_t}
+		}
+		\label{fig:yield:jax:ops}
+	}
+	\subfloat[][Throughput, 1 \ats per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+		\input{result.yield.low.jax.ops.pstex_t}
+		}
+		\label{fig:yield:jax:low:ops}
+	}
+
+	\subfloat[][Scalability, 100 \ats per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+		\input{result.yield.jax.ns.pstex_t}
+		}
+		\label{fig:yield:jax:ns}
+	}
+	\subfloat[][Scalability, 1 \ats per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+		\input{result.yield.low.jax.ns.pstex_t}
+		}
+		\label{fig:yield:jax:low:ns}
+	}
+	\caption[Yield Benchmark on Intel]{Yield Benchmark on Intel\smallskip\newline Throughput and scalability as a function of \proc count, using 1 \ats per \proc. For throughput, higher is better, for scalability, lower is better. Each series represent 15 independent runs, the dotted lines are extremes while the solid line is the medium.}
+	\label{fig:yield:jax}
 \end{figure}
 
 \subsection{Results}
+
+Figures~\ref{fig:yield:jax} and~\ref{fig:yield:nasus} show the same throughput graphs as @cycle@ on Intel and AMD, respectively.
+Note, the Y-axis on the yield graph for Intel is twice as large as the Intel cycle-graph.
+A visual glance between the cycle and yield graphs confirms my claim that the yield benchmark is unreliable.
+
+For the Intel architecture, Figure~\ref{fig:yield:jax}:
+\begin{itemize}
+\item
+\CFA has no special handling for @yield@, but this experiment requires less synchronization than the @cycle@ experiment.
+Hence, the @yield@ throughput and scalability graphs for both 100 and 1 cycles/tasks per processor have similar shapes to the corresponding @cycle@ graphs.
+The only difference is sightly better performance for @yield@ because of less synchronization.
+As for @cycle@, the cost of idle sleep also comes into play in a very significant way in Figure~\ref{fig:yield:jax:low:ns}, where the scaling is not flat. 
+\item
+libfibre has special handling for @yield@ using the fact that the number of ready fibres does not change, and therefore, by-passing the idle-sleep mechanism entirely.
+Additionally, when only running 1 \at per \proc, libfibre optimizes further, and forgoes the context-switch entirely.
+Hence, libfibre behaves very differently in the cycle and yield benchmarks, with a 4 times increase in performance for 100 cycles/tasks and an 8 times increase for 1 cycle/task.
+\item
+Go has special handling for @yield@ by putting a yielding goroutine on a secondary global ready-queue, giving it lower priority.
+The result is that multiple \glspl{hthrd} contend for the global queue and performance suffers drastically.
+Hence, Go behaves very differently in the cycle and yield benchmarks, with a complete performance collapse in @yield@ for both 100 and 1 cycles/tasks.
+\item
+Tokio has a similar performance collapse after 16 processors, and therefore, its special @yield@ handling is probably related to a Go-like scheduler problem and/or a \CFA idle-sleep problem.
+(I did not dig through the Rust code to ascertain the exact reason for the collapse.)
+\end{itemize}
+
 \begin{figure}
 	\subfloat[][Throughput, 100 \ats per \proc]{
 		\resizebox{0.5\linewidth}{!}{
-			\input{result.yield.jax.ops.pstex_t}
-		}
-		\label{fig:yield:jax:ops}
-	}
-	\subfloat[][Throughput, 1 \ats per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-		\input{result.yield.low.jax.ops.pstex_t}
-		}
-		\label{fig:yield:jax:low:ops}
+			\input{result.yield.nasus.ops.pstex_t}
+		}
+		\label{fig:yield:nasus:ops}
+	}
+	\subfloat[][Throughput, 1 \at per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+			\input{result.yield.low.nasus.ops.pstex_t}
+		}
+		\label{fig:yield:nasus:low:ops}
 	}
 
 	\subfloat[][Scalability, 100 \ats per \proc]{
 		\resizebox{0.5\linewidth}{!}{
-		\input{result.yield.jax.ns.pstex_t}
-		}
-		\label{fig:yield:jax:ns}
-	}
-	\subfloat[][Scalability, 1 \ats per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-		\input{result.yield.low.jax.ns.pstex_t}
-		}
-		\label{fig:yield:jax:low:ns}
-	}
-	\caption[Yield Benchmark on Intel]{Yield Benchmark on Intel\smallskip\newline Throughput and Scalability as a function of \proc count, using 1 \ats per \proc. For Throughput higher is better, for Scalability lower is better. Each series represent 15 independent runs, the dotted lines are extremums while the solid line is the medium.}
-	\label{fig:yield:jax}
-\end{figure}
-
-\begin{figure}
-	\subfloat[][Throughput, 100 \ats per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-			\input{result.yield.nasus.ops.pstex_t}
-		}
-		\label{fig:yield:nasus:ops}
-	}
-	\subfloat[][Throughput, 1 \at per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-			\input{result.yield.low.nasus.ops.pstex_t}
-		}
-		\label{fig:yield:nasus:low:ops}
-	}
-
-	\subfloat[][Scalability, 100 \ats per \proc]{
-		\resizebox{0.5\linewidth}{!}{
 			\input{result.yield.nasus.ns.pstex_t}
 		}
@@ -266,32 +301,13 @@
 		\label{fig:yield:nasus:low:ns}
 	}
-	\caption[Yield Benchmark on AMD]{Yield Benchmark on AMD\smallskip\newline Throughput and Scalability as a function of \proc count, using 1 \ats per \proc. For Throughput higher is better, for Scalability lower is better. Each series represent 15 independent runs, the dotted lines are extremums while the solid line is the medium.}
+	\caption[Yield Benchmark on AMD]{Yield Benchmark on AMD\smallskip\newline Throughput and scalability as a function of \proc count, using 1 \ats per \proc. For throughput, higher is better, for scalability, lower is better. Each series represent 15 independent runs, the dotted lines are extremes while the solid line is the medium.}
 	\label{fig:yield:nasus}
 \end{figure}
-Figure~\ref{fig:yield:jax} shows the throughput as a function of \proc count on Intel.
-It is fairly obvious why I claim this benchmark is more artificial.
-The throughput is dominated by the mechanism used to handle the @yield@.
-\CFA does not have special handling for @yield@ but the experiment requires less synchronization.
-As a result achieves better performance than the cycle benchmark, but still comparable.
-
-When the number of \ats is reduce to 1 per \proc, the cost of idle sleep also comes into play in a very significant way.
-If anything causes a \at migration, where two \ats end-up on the same ready-queue, work-stealing will start occuring and could cause several \ats to shuffle around.
-In the process, several \procs can go to sleep transiently if they fail to find where the \ats were shuffled to.
-In \CFA, spurious bursts of latency can trick a \proc into helping, triggering this effect.
-However, since user-level threading with equal number of \ats and \procs is a somewhat degenerate case, especially when context-switching very often, this result is not particularly meaningful and is only included for completness.
-
-Libfibre uses the fact that @yield@ doesn't change the number of ready fibres and by-passes the idle-sleep mechanism entirely, producing significantly better throughput.
-Additionally, when only running 1 \at per \proc, libfibre optimizes further and forgoes the context-switch entirely.
-This results in incredible performance results comparing to the other runtimes.
-
-In stark contrast with libfibre, Go puts yielding goroutines on a secondary global ready-queue, giving them lower priority.
-The result is that multiple \glspl{hthrd} contend for the global queue and performance suffers drastically.
-Based on the scalability, Tokio obtains the similarly poor performance and therefore it is likely it handles @yield@ in a similar fashion.
-However, it must be doing something different since it does scale at low \proc count.
-
-Again, Figure~\ref{fig:yield:nasus} show effectively the same story happening on AMD as it does on Intel.
-\CFA fairs slightly better with many \ats per \proc, but the performance is satisfactory on both architectures.
-
-Since \CFA obtains the same satisfactory performance as the previous benchmark this is still a success, albeit a less meaningful one.
+
+For the AMD, Figure~\ref{fig:yield:nasus}, the results show the same story as on the Intel, with slightly increased jitter.
+Also, some transition points on the X-axis differ because of the architectures, like at 16 versus 24 processors.
+
+It is difficult to draw conclusions for this benchmark when runtime system treat @yield@ so differently.
+The win for \CFA is its consistency between the cycle and yield benchmarks making it simpler for programmers to use and understand, \ie it the \CFA semantics matches with programmer intuition..
 
 
@@ -300,7 +316,7 @@
 In these benchmarks, \ats can be easily partitioned over the different \procs upfront and none of the \ats communicate with each other.
 
-The Churn benchmark represents more chaotic executions, where there is more communication among \ats but no apparent relation between the last \proc on which a \at ran and blocked, and the \proc that subsequently unblocks it.
-With processor-specific ready-queues, when a \at is unblocked by a different \proc that means the unblocking \proc must either ``steal'' the \at from another processor or place it on a remote queue.
-This enqueuing results in either contention on the remote queue and/or \glspl{rmr} on the \at data structure.
+The Churn benchmark represents more chaotic executions, where there is more communication among \ats but no relationship between the last \proc on which a \at ran and blocked and the \proc that subsequently unblocks it.
+With processor-specific ready-queues, when a \at is unblocked by a different \proc that means the unblocking \proc must either ``steal'' the \at from another processor or find it on a remote queue.
+This dequeuing results in either contention on the remote queue and/or \glspl{rmr} on the \at data structure.
 In either case, this benchmark aims to measure how well each scheduler handles these cases, since both cases can lead to performance degradation if not handled correctly.
 
@@ -328,77 +344,78 @@
 \caption[Churn Benchmark : Pseudo Code]{Churn Benchmark : Pseudo Code}
 \label{fig:churn:code}
+%\end{figure}
+\bigskip
+%\begin{figure}
+	\subfloat[][Throughput, 100 \ats per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+			\input{result.churn.jax.ops.pstex_t}
+		}
+		\label{fig:churn:jax:ops}
+	}
+	\subfloat[][Throughput, 2 \ats per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+			\input{result.churn.low.jax.ops.pstex_t}
+		}
+		\label{fig:churn:jax:low:ops}
+	}
+
+	\subfloat[][Latency, 100 \ats per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+			\input{result.churn.jax.ns.pstex_t}
+		}
+		\label{fig:churn:jax:ns}
+	}
+	\subfloat[][Latency, 2 \ats per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+			\input{result.churn.low.jax.ns.pstex_t}
+		}
+		\label{fig:churn:jax:low:ns}
+	}
+	\caption[Churn Benchmark on Intel]{\centering Churn Benchmark on Intel\smallskip\newline Throughput and latency of the Churn on the benchmark on the Intel machine. For throughput, higher is better, for scalability, lower is better. Each series represent 15 independent runs, the dotted lines are extremes while the solid line is the medium.}
+	\label{fig:churn:jax}
 \end{figure}
 
 \subsection{Results}
-\begin{figure}
-	\subfloat[][Throughput, 100 \ats per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-			\input{result.churn.jax.ops.pstex_t}
-		}
-		\label{fig:churn:jax:ops}
-	}
-	\subfloat[][Throughput, 2 \ats per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-			\input{result.churn.low.jax.ops.pstex_t}
-		}
-		\label{fig:churn:jax:low:ops}
-	}
-
-	\subfloat[][Latency, 100 \ats per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-			\input{result.churn.jax.ns.pstex_t}
-		}
-		\label{fig:churn:jax:ns}
-	}
-	\subfloat[][Latency, 2 \ats per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-			\input{result.churn.low.jax.ns.pstex_t}
-		}
-		\label{fig:churn:jax:low:ns}
-	}
-	\caption[Churn Benchmark on Intel]{\centering Churn Benchmark on Intel\smallskip\newline Throughput and latency of the Churn on the benchmark on the Intel machine. For Throughput higher is better, for Scalability lower is better. Each series represent 15 independent runs, the dotted lines are extremums while the solid line is the medium.}
-	\label{fig:churn:jax}
-\end{figure}
-
-\begin{figure}
-	\subfloat[][Throughput, 100 \ats per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-			\input{result.churn.nasus.ops.pstex_t}
-		}
-		\label{fig:churn:nasus:ops}
-	}
-	\subfloat[][Throughput, 2 \ats per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-			\input{result.churn.low.nasus.ops.pstex_t}
-		}
-		\label{fig:churn:nasus:low:ops}
-	}
-
-	\subfloat[][Latency, 100 \ats per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-			\input{result.churn.nasus.ns.pstex_t}
-		}
-		\label{fig:churn:nasus:ns}
-	}
-	\subfloat[][Latency, 2 \ats per \proc]{
-		\resizebox{0.5\linewidth}{!}{
-			\input{result.churn.low.nasus.ns.pstex_t}
-		}
-		\label{fig:churn:nasus:low:ns}
-	}
-	\caption[Churn Benchmark on AMD]{\centering Churn Benchmark on AMD\smallskip\newline Throughput and latency of the Churn on the benchmark on the AMD machine.
-	For Throughput higher is better, for Scalability lower is better. Each series represent 15 independent runs, the dotted lines are extremums while the solid line is the medium.}
-	\label{fig:churn:nasus}
-\end{figure}
-Figure~\ref{fig:churn:jax} and Figure~\ref{fig:churn:nasus} show the throughput as a function of \proc count on Intel and AMD respectively.
-It uses the same representation as the previous benchmark : 15 runs where the dashed line show the extremums and the solid line the median.
+Figures~\ref{fig:churn:jax} and Figure~\ref{fig:churn:nasus} show the throughput as a function of \proc count on Intel and AMD respectively.
+It uses the same representation as the previous benchmark : 15 runs where the dashed line show the extremes and the solid line the median.
 The performance cost of crossing the cache boundaries is still visible at the same \proc count.
-However, this benchmark has performance dominated by the cache traffic as \proc are constantly accessing the eachother's data.
+However, this benchmark has performance dominated by the cache traffic as \proc are constantly accessing the each other's data.
 Scalability is notably worst than the previous benchmarks since there is inherently more communication between processors.
 Indeed, once the number of \glspl{hthrd} goes beyond a single socket, performance ceases to improve.
 An interesting aspect to note here is that the runtimes differ in how they handle this situation.
 Indeed, when a \proc unparks a \at that was last run on a different \proc, the \at could be appended to the ready-queue local \proc or to the ready-queue of the remote \proc, which previously ran the \at.
-\CFA, tokio and Go all use the approach of unparking to the local \proc while Libfibre unparks to the remote \proc.
+\CFA, Tokio and Go all use the approach of unparking to the local \proc while Libfibre unparks to the remote \proc.
 In this particular benchmark, the inherent chaos of the benchmark in addition to small memory footprint means neither approach wins over the other.
+
+\begin{figure}
+	\subfloat[][Throughput, 100 \ats per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+			\input{result.churn.nasus.ops.pstex_t}
+		}
+		\label{fig:churn:nasus:ops}
+	}
+	\subfloat[][Throughput, 2 \ats per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+			\input{result.churn.low.nasus.ops.pstex_t}
+		}
+		\label{fig:churn:nasus:low:ops}
+	}
+
+	\subfloat[][Latency, 100 \ats per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+			\input{result.churn.nasus.ns.pstex_t}
+		}
+		\label{fig:churn:nasus:ns}
+	}
+	\subfloat[][Latency, 2 \ats per \proc]{
+		\resizebox{0.5\linewidth}{!}{
+			\input{result.churn.low.nasus.ns.pstex_t}
+		}
+		\label{fig:churn:nasus:low:ns}
+	}
+	\caption[Churn Benchmark on AMD]{\centering Churn Benchmark on AMD\smallskip\newline Throughput and latency of the Churn on the benchmark on the AMD machine.
+	For throughput, higher is better, for scalability, lower is better. Each series represent 15 independent runs, the dotted lines are extremes while the solid line is the medium.}
+	\label{fig:churn:nasus}
+\end{figure}
 
 Like for the cycle benchmark, here all runtimes achieve fairly similar performance.
@@ -406,8 +423,8 @@
 Beyond that performance starts to suffer from increased caching costs.
 
-Indeed on Figures~\ref{fig:churn:jax:ops} and \ref{fig:churn:jax:ns} show that with 1 and 100 \ats per \proc, \CFA, libfibre, Go and tokio achieve effectively equivalent performance for most \proc count.
+Indeed on Figures~\ref{fig:churn:jax:ops} and \ref{fig:churn:jax:ns} show that with 1 and 100 \ats per \proc, \CFA, libfibre, Go and Tokio achieve effectively equivalent performance for most \proc count.
 
 However, Figure~\ref{fig:churn:nasus} again shows a somewhat different story on AMD.
-While \CFA, libfibre, and tokio achieve effectively equivalent performance for most \proc count, Go starts with better scaling at very low \proc counts but then performance quickly plateaus, resulting in worse performance at higher \proc counts.
+While \CFA, libfibre, and Tokio achieve effectively equivalent performance for most \proc count, Go starts with better scaling at very low \proc counts but then performance quickly plateaus, resulting in worse performance at higher \proc counts.
 This performance difference is visible at both high and low \at counts.
 
@@ -420,14 +437,19 @@
 As second possible explanation is that Go may sometimes use the heap when allocating variables based on the result of escape analysis of the code.
 It is possible that variables that should be placed on the stack are placed on the heap.
-This could cause extra pointer chasing in the benchmark, heightning locality effects.
+This could cause extra pointer chasing in the benchmark, heightening locality effects.
 Depending on how the heap is structure, this could also lead to false sharing.
 
 The objective of this benchmark is to demonstrate that unparking \ats from remote \procs do not cause too much contention on the local queues.
-Indeed, the fact all runtimes achieve some scaling at lower \proc count demontrate that migrations do not need to be serialized.
+Indeed, the fact all runtimes achieve some scaling at lower \proc count demonstrate that migrations do not need to be serialized.
 Again these result demonstrate \CFA achieves satisfactory performance.
 
 \section{Locality}
-\begin{figure}
-\begin{cfa}
+
+\begin{figure}
+\newsavebox{\myboxA}
+\newsavebox{\myboxB}
+
+\begin{lrbox}{\myboxA}
+\begin{cfa}[tabsize=3]
 Thread.main() {
 	count := 0
@@ -436,4 +458,5 @@
 		// go through the array
 		@work( a )@
+
 		spots[r].V()
 		spots[r].P()
@@ -444,5 +467,8 @@
 }
 \end{cfa}
-\begin{cfa}
+\end{lrbox}
+
+\begin{lrbox}{\myboxB}
+\begin{cfa}[tabsize=3]
 Thread.main() {
 	count := 0
@@ -460,13 +486,22 @@
 }
 \end{cfa}
+\end{lrbox}
+
+\subfloat[Thread$_1$]{\label{f:CFibonacci}\usebox\myboxA}
+\hspace{3pt}
+\vrule
+\hspace{3pt}
+\subfloat[Thread$_2$]{\label{f:CFAFibonacciGen}\usebox\myboxB}
+
 \caption[Locality Benchmark : Pseudo Code]{Locality Benchmark : Pseudo Code}
 \label{fig:locality:code}
 \end{figure}
-As mentionned in the churn benchmark, when unparking a \at, it is possible to either unpark to the local or remote ready-queue.
+
+As mentioned in the churn benchmark, when unparking a \at, it is possible to either unpark to the local or remote ready-queue.
 \footnote{It is also possible to unpark to a third unrelated ready-queue, but without additional knowledge about the situation, there is little to suggest this would not degrade performance.}
 The locality experiment includes two variations of the churn benchmark, where an array of data is added.
 In both variations, before @V@ing the semaphore, each \at increment random cells inside the array.
 The @share@ variation then passes the array to the shadow-queue of the semaphore, transferring ownership of the array to the woken thread.
-In the @noshare@ variation the array is not passed on and each thread continously accesses its private array.
+In the @noshare@ variation the array is not passed on and each thread continuously accesses its private array.
 
 The objective here is to highlight the different decision made by the runtime when unparking.
@@ -480,4 +515,5 @@
 
 \subsection{Results}
+
 \begin{figure}
 	\subfloat[][Throughput share]{
@@ -506,5 +542,5 @@
 		\label{fig:locality:jax:noshare:ns}
 	}
-	\caption[Locality Benchmark on Intel]{Locality Benchmark on Intel\smallskip\newline Throughput and Scalability as a function of \proc count. For Throughput higher is better, for Scalability lower is better. Each series represent 15 independent runs, the dotted lines are extremums while the solid line is the medium.}
+	\caption[Locality Benchmark on Intel]{Locality Benchmark on Intel\smallskip\newline Throughput and scalability as a function of \proc count. For throughput, higher is better, for scalability, lower is better. Each series represent 15 independent runs, the dotted lines are extremes while the solid line is the medium.}
 	\label{fig:locality:jax}
 \end{figure}
@@ -535,20 +571,20 @@
 		\label{fig:locality:nasus:noshare:ns}
 	}
-	\caption[Locality Benchmark on AMD]{Locality Benchmark on AMD\smallskip\newline Throughput and Scalability as a function of \proc count. For Throughput higher is better, for Scalability lower is better. Each series represent 15 independent runs, the dotted lines are extremums while the solid line is the medium.}
+	\caption[Locality Benchmark on AMD]{Locality Benchmark on AMD\smallskip\newline Throughput and scalability as a function of \proc count. For throughput, higher is better, for scalability, lower is better. Each series represent 15 independent runs, the dotted lines are extremes while the solid line is the medium.}
 	\label{fig:locality:nasus}
 \end{figure}
 
-Figure~\ref{fig:locality:jax} and \ref{fig:locality:nasus} shows the results on Intel and AMD respectively.
+Figures~\ref{fig:locality:jax} and \ref{fig:locality:nasus} shows the results on Intel and AMD respectively.
 In both cases, the graphs on the left column show the results for the @share@ variation and the graphs on the right column show the results for the @noshare@.
 
 On Intel, Figure~\ref{fig:locality:jax} shows Go trailing behind the 3 other runtimes.
-On the left of the figure showing the results for the shared variation, where \CFA and tokio slightly outperform libfibre as expected.
-And correspondingly on the right, we see the expected performance inversion where libfibre now outperforms \CFA and tokio.
-Otherwise the results are similar to the churn benchmark, with lower throughtput due to the array processing.
+On the left of the figure showing the results for the shared variation, where \CFA and Tokio slightly outperform libfibre as expected.
+And correspondingly on the right, we see the expected performance inversion where libfibre now outperforms \CFA and Tokio.
+Otherwise the results are similar to the churn benchmark, with lower throughput due to the array processing.
 Presumably the reason why Go trails behind are the same as in Figure~\ref{fig:churn:nasus}.
 
 Figure~\ref{fig:locality:nasus} shows the same experiment on AMD.
 \todo{why is cfa slower?}
-Again, we see the same story, where tokio and libfibre swap places and Go trails behind.
+Again, we see the same story, where Tokio and libfibre swap places and Go trails behind.
 
 \section{Transfer}
@@ -572,9 +608,9 @@
 In both flavours, the experiment effectively measures how long it takes for all \ats to run once after a given synchronization point.
 In an ideal scenario where the scheduler is strictly FIFO, every thread would run once after the synchronization and therefore the delay between leaders would be given by:
-$ \frac{CSL + SL}{NP - 1}$, where $CSL$ is the context switch latency, $SL$ is the cost for enqueuing and dequeuing a \at and $NP$ is the number of \procs.
+$ \frac{CSL + SL}{NP - 1}$, where $CSL$ is the context switch latency, $SL$ is the cost for enqueueing and dequeuing a \at and $NP$ is the number of \procs.
 However, if the scheduler allows \ats to run many times before other \ats are able to run once, this delay will increase.
 The semaphore version is an approximation of the strictly FIFO scheduling, where none of the \ats \emph{attempt} to run more than once.
 The benchmark effectively provides the fairness guarantee in this case.
-In the yielding version however, the benchmark provides no such guarantee, which means the scheduler has full responsability and any unfairness will be measurable.
+In the yielding version however, the benchmark provides no such guarantee, which means the scheduler has full responsibility and any unfairness will be measurable.
 
 While this is a fairly artificial scenario, it requires only a few simple pieces.
@@ -634,17 +670,18 @@
 libfibre  & 127 $\mu$s  & ~33.5 ms   & DNC         & DNC           & 156 $\mu$s  & ~36.7 ms   & DNC         & DNC         \\
 Go        & 106 $\mu$s  & ~64.0 ms   & 24.6 ms     & 74.3 ms       & 271 $\mu$s  & 121.6 ms   & ~~1.21~ms   & 117.4 ms    \\
-tokio     & 289 $\mu$s  & 180.6 ms   & DNC         & DNC           & 157 $\mu$s  & 111.0 ms   & DNC         & DNC
+Tokio     & 289 $\mu$s  & 180.6 ms   & DNC         & DNC           & 157 $\mu$s  & 111.0 ms   & DNC         & DNC
 \end{tabular}
 \end{centering}
-\caption[Transfer Benchmark on Intel and AMD]{Transfer Benchmark on Intel and AMD\smallskip\newline Average measurement of how long it takes for all \ats to acknowledge the leader \at. DNC stands for ``did not complete'', meaning that after 5 seconds of a new leader being decided, some \ats still had not acknowledged the new leader. }
+\caption[Transfer Benchmark on Intel and AMD]{Transfer Benchmark on Intel and AMD\smallskip\newline Average measurement of how long it takes for all \ats to acknowledge the leader \at. DNC stands for ``did not complete'', meaning that after 5 seconds of a new leader being decided, some \ats still had not acknowledged the new leader.}
 \label{fig:transfer:res}
 \end{figure}
-Figure~\ref{fig:transfer:res} shows the result for the transfer benchmark with 2 \procs and all \procs, where each experiement runs 100 \at per \proc.
+
+Figure~\ref{fig:transfer:res} shows the result for the transfer benchmark with 2 \procs and all \procs, where each experiment runs 100 \at per \proc.
 Note that the results here are only meaningful as a coarse measurement of fairness, beyond which small cost differences in the runtime and concurrent primitives begin to matter.
-As such, data points that are the on the same order of magnitude as eachother should be basically considered equal.
-The takeaway of this experiement is the presence of very large differences.
+As such, data points that are the on the same order of magnitude as each other should be basically considered equal.
+The takeaway of this experiment is the presence of very large differences.
 The semaphore variation is denoted ``Park'', where the number of \ats dwindles down as the new leader is acknowledged.
 The yielding variation is denoted ``Yield''.
-The experiement was only run for the extremums of the number of cores since the scaling per core behaves like previous experiements.
+The experiment was only run for the extremes of the number of cores since the scaling per core behaves like previous experiments.
 This experiments clearly demonstrate that while the other runtimes achieve similar performance in previous benchmarks, here \CFA achieves significantly better fairness.
 The semaphore variation serves as a control group, where all runtimes are expected to transfer leadership fairly quickly.
@@ -652,8 +689,8 @@
 Figure~\ref{fig:transfer:res} shows that while Go and Tokio are slower, all runtime achieve decent latency.
 However, the yielding variation shows an entirely different picture.
-Since libfibre and tokio have a traditional work-stealing scheduler, \procs that have \ats on their local queues will never steal from other \procs.
-The result is that the experiement simply does not complete for these runtime.
+Since libfibre and Tokio have a traditional work-stealing scheduler, \procs that have \ats on their local queues will never steal from other \procs.
+The result is that the experiment simply does not complete for these runtime.
 Without \procs stealing from the \proc running the leader, the experiment will simply never terminate.
-Go manages to complete the experiement because it adds preemption on top of classic work-stealing.
+Go manages to complete the experiment because it adds preemption on top of classic work-stealing.
 However, since preemption is fairly costly it achieves significantly worst performance.
 In contrast, \CFA achieves equivalent performance in both variations, demonstrating very good fairness.
