From 6372e677798cab6c71dcf57f5a2cf93fe5f9e85d Mon Sep 17 00:00:00 2001 From: Geoffrey Challen Date: Mon, 22 Dec 2014 12:17:33 -0500 Subject: [PATCH] New. --- certainty.tex | 44 ++++++++++++++++++++------------------------ include/start.tex | 1 + maybe.tex | 23 ++++++++++++----------- 3 files changed, 33 insertions(+), 35 deletions(-) diff --git a/certainty.tex b/certainty.tex index e357af8..e9ab22f 100644 --- a/certainty.tex +++ b/certainty.tex @@ -1,29 +1,25 @@ \section{From Uncertainty to Certainty} \label{sec-certainty} -While \texttt{maybe} allows programmers to specify multiple alternatives, -ultimately only one alternative may be used. Either a single, globally best -alternative must be chosen, -or a deterministic decision procedure -must be selected. Before discussing options for \textit{adapting} an app -to its runtime environment, we first -explain our runtime's support for \texttt{maybe} alternatives, including post-mortem -evaluation and data-collection. -%system implements \texttt{maybe} statements and collects data used to tailor or -%\textit{adapt} an app to its host environment. -Then, we discuss how \texttt{maybe} testing -enables a variety of different adaptation patterns. - -\subsection{Evaluating Alternatives} -The optional \texttt{better} block of a \texttt{maybe} statement allows -programmers to provide app-specific post-mortem logic. However, in many -cases, we expect that \texttt{maybe} statements will be used to achieve -common objectives such as improving performance or saving energy. -To steamline application development, our current -system assesses \texttt{maybe} statements without a \texttt{better} -block in terms of both energy and performance. In cases where one -alternative is a clear winner in terms of both energy and performance, that alternative will be used---although note that this selection may -still need to be time-varying since it may depend on exogenous factors. +While \texttt{maybe} allows programmers to specify multiple alternatives, +ultimately only one alternative may be used. Either a single, globally best +alternative must be chosen, or a deterministic decision procedure must be +selected. Before discussing options for \textit{adapting} an app to its +runtime environment, we first explain our runtime's support for +\texttt{maybe} alternatives, including \textit{a posteriori} evaluation and +data-collection. Then, we discuss how \texttt{maybe} testing enables a +variety of different adaptation patterns. + +\subsection{Evaluating Alternatives} The optional \texttt{evaluate} block of +a \texttt{maybe} statement allows programmers to provide app-specific +\textit{a posteriori} evaluation logic. However, in many cases, we expect +that \texttt{maybe} statements will be used to achieve common objectives such +as improving performance or saving energy. To steamline application +development, our current system assesses \texttt{maybe} statements without a +\texttt{better} block in terms of both energy and performance. In cases where +one alternative is a clear winner in terms of both energy and performance, +that alternative will be used---although note that this selection may still +need to be time-varying since it may depend on exogenous factors. Cases where \texttt{maybe} blocks provide an energy-performance tradeoff require more investigation to handle. We are exploring several options, @@ -79,7 +75,7 @@ selection as described in more detail later in this section. We next describe the pre- and post-deployment testing that helps developers to design an \textit{adaptation} policy, a strategy for ultimately selecting -between alternatives. While the \texttt{maybe} system +between alternatives. While the \texttt{maybe} system automates many of the tedious tasks normally associated with large-scale testing, we still provide ways for the developer to guide and even override any step in the process. diff --git a/include/start.tex b/include/start.tex index 5a36024..3f71968 100644 --- a/include/start.tex +++ b/include/start.tex @@ -1,3 +1,4 @@ +\pdfobjcompresslevel=1 \documentclass[letterpaper,twocolumn]{sig-alternate} \usepackage{url,graphicx,multirow,hyperref,color,calc,ulem,threeparttable,tabularx,booktabs,enumitem,comment,subcaption,balance,leading} \usepackage{minted} diff --git a/maybe.tex b/maybe.tex index 6d36c2a..047f686 100644 --- a/maybe.tex +++ b/maybe.tex @@ -24,7 +24,7 @@ maybe { ret = fastPowerHungryAlgorithm(input); } or { ret = slowPowerEfficientAlgorithm(input); -} analyze { +} evaluate { return { "repeat": false, "score" : nanoTime() + powerDrain() } } @@ -69,16 +69,17 @@ statement providing syntactic sugar. \texttt{maybe} function annotations allow uncertainty to be expressed at the function level, with the alternatives consisting of multiple function definitions with identical signatures. Finally, \texttt{maybe} blocks that require special performance -evaluation logic can include that in the form of a \texttt{better} statement -following the main \texttt{maybe} block, as shown in the final example. -\texttt{better} blocks provide application-specific logic that analyze the -selected execution path. The \texttt{better} block must return a single JSON -object that includes two components: A score, with smaller being interpreted -as better; and a boolean indicating whether the system should use the same -branch next time, or if it is free to try another. Note that hints and -dedicated evaluation logic can also be applied to variable and function-level -\texttt{maybe} statements through annotations. We will return to post-mortem -evaluation in Section~\ref{sec-certainty}. +evaluation logic can include that in the form of a \texttt{evaluate} +statement following the main \texttt{maybe} block, as shown in the final +example. \texttt{evaluate} blocks provide app-specific \textit{a posteriori} +logic to evaluate the selected alternative. The \texttt{evaluate} block must +return a single JSON object that includes two components: A score, with +smaller being interpreted as better; and a boolean indicating whether the +system should use the same branch next time, or if it is free to try another. +Note that hints and dedicated evaluation logic can also be applied to +variable and function-level \texttt{maybe} statements through annotations. We +will return to \textit{a posteriori} evaluation in +Section~\ref{sec-certainty}. \subsection{Discussion} -- libgit2 0.22.2