Commit 1b1ce456c0f9b56f4c9bec032441d2d0865109a7
1 parent
fc352ee3
New.
Showing
4 changed files
with
83 additions
and
100 deletions
certainty.tex
| ... | ... | @@ -17,58 +17,44 @@ variety of different adaptation patterns. |
| 17 | 17 | The optional \texttt{evaluate} block of a \texttt{maybe} statement allows |
| 18 | 18 | programmers to provide app-specific \textit{a posteriori} evaluation logic. |
| 19 | 19 | However, in many cases, we expect that \texttt{maybe} statements will be used |
| 20 | -to achieve common objectives such as improving performance or saving energy. | |
| 21 | -To streamline application development, our current system evaluates | |
| 22 | -\texttt{maybe} statements without a \texttt{evaluate} block by measuring both | |
| 23 | -energy and performance. In cases where one alternative optimizes both, that | |
| 24 | -alternative will be used---although the decision may still be time-varying | |
| 25 | -due to dependence on time-varying factors such as network availability. | |
| 26 | - | |
| 27 | -\sloppypar{Cases where \texttt{maybe} statements provide an | |
| 28 | -energy-performance tradeoff require more investigation. We are exploring | |
| 29 | -several options, including collapsing both metrics into a single score by | |
| 30 | -computing the energy-delay product (EDP) of each alternative, or allowing | |
| 31 | -users to set a per-app preference indicating whether energy or performance | |
| 32 | -should determine \texttt{maybe} alternative selection.} | |
| 33 | - | |
| 34 | -When \texttt{maybe} statements include a \texttt{evaluate} block, their | |
| 35 | -custom evaluation logic must merge any relevant factors into a single score, | |
| 36 | -although \texttt{evaluate} blocks can still record other relevant information | |
| 37 | -to aid in understanding app behavior. Specifically, while the \texttt{score} | |
| 38 | -value is used to evaluate the alternative, the entire JSON object returned by | |
| 39 | -the \texttt{evaluate} block is recorded for later analysis. Our standard | |
| 40 | -energy and performance \texttt{evaluate} block records energy and performance | |
| 41 | -separately in the JSON object but combines them as required into a single | |
| 42 | -score. Note that because the \texttt{evaluate} block delivers information to | |
| 43 | -the developer through the \texttt{maybe} service, as described below, | |
| 44 | -\texttt{maybe} statements can be connected with end-to-end app performance | |
| 45 | -metrics that would normally not be visible on the device. \texttt{evaluate} | |
| 46 | -blocks may also want to query the user directly, and we are exploring ways to | |
| 47 | -make this possible. | |
| 48 | - | |
| 49 | -In some cases we expect that \texttt{evaluate} blocks may need to know which | |
| 50 | -alternative was executed to determine the score---for example, if the two | |
| 51 | -alternatives produce different quality output. The simplest solution is to | |
| 52 | -have each alternative set a variable indicating that it was used, but we | |
| 53 | -believe that eventually including some form of labeling syntax for | |
| 54 | -\texttt{maybe} alternatives may be beneficial. | |
| 20 | +to achieve common objectives such as improving performance or saving energy. To | |
| 21 | +streamline application development, our current system evaluates \texttt{maybe} | |
| 22 | +statements without a \texttt{evaluate} block by measuring both energy and | |
| 23 | +performance. In cases where one alternative optimizes both, that alternative | |
| 24 | +will be used---although the decision may still be time-varying due to | |
| 25 | +dependence on time-varying factors such as network availability. When | |
| 26 | +alternatives produce an energy-performance tradeoff we are exploring several | |
| 27 | +options, including collapsing both metrics into a single score by computing the | |
| 28 | +energy-delay product (EDP) of each alternative, or allowing users to set a | |
| 29 | +per-app energy or performance preference. | |
| 30 | + | |
| 31 | +\texttt{evaluate} blocks can also record other information to aid adaptation. | |
| 32 | +While the \texttt{score} value is used to evaluate the alternative, the | |
| 33 | +entire JSON object returned by the \texttt{evaluate} block is delivered to | |
| 34 | +the developer for later analysis. This allows \texttt{maybe} statements to be | |
| 35 | +connected with end-to-end app performance metrics not visible on the device. | |
| 36 | +\texttt{evaluate} blocks may also want to query the user directly, and we are | |
| 37 | +exploring ways to make this possible. | |
| 38 | + | |
| 39 | +We expect that some \texttt{evaluate} blocks may need to know which | |
| 40 | +alternative was executed to compute a score---for example, if the two | |
| 41 | +alternatives produce different quality output. We are exploring the use of | |
| 42 | +automatically-generated labels to aid this process. | |
| 55 | 43 | |
| 56 | 44 | If a \texttt{maybe} alternative throws an error, the system will bypass the |
| 57 | 45 | \texttt{evaluate} block and give it the worst possible score. By integrating |
| 58 | -a form of record-and-replay~\cite{gomez2013reran}, it may also be possible to | |
| 59 | -roll back the failed alternatives changes and retry another alternative. | |
| 60 | -\texttt{maybe} is intended to enable adaptation, not avoid errors, but the | |
| 61 | -existence of other alternatives provides our system with a way to work around | |
| 62 | -failures caused by uncertainty. Resistance to errors may also encourage | |
| 63 | -developers to use \texttt{maybe} statements to prototype alternatives to | |
| 64 | -existing well-tested code. | |
| 46 | +a form of record-and-replay~\cite{gomez2013reran}, it may be possible to roll | |
| 47 | +back the failed alternative and retry another. \texttt{maybe} is intended to | |
| 48 | +enable adaptation, not avoid errors, but the existence of other alternatives | |
| 49 | +provides a way to work around failures caused by uncertainty. Fault tolerance | |
| 50 | +may also encourage developers to use \texttt{maybe} statements to prototype | |
| 51 | +alternatives to existing well-tested code. | |
| 65 | 52 | |
| 66 | 53 | A final question concerns when a \texttt{maybe} alternative should be |
| 67 | -evaluated. In some cases it may be appropriate for \textit{a posteriori} | |
| 68 | -evaluation to happen immediately after execution. In others, it may be | |
| 69 | -necessary to continue executing the same alternative over a period of time to | |
| 70 | -perform a fair comparison. As described previously, \texttt{evaluate} blocks | |
| 71 | -can indicate explicitly whether or not to continue evaluating the | |
| 54 | +evaluated. Some alternatives may require evaluation immediately after | |
| 55 | +execution. Others may require repeated execution over a longer period of time | |
| 56 | +to perform a fair comparison. As described previously, \texttt{evaluate} | |
| 57 | +blocks can indicate explicitly whether or not to continue evaluating the | |
| 72 | 58 | alternative, and we are determining how to make a similar choice available to |
| 73 | 59 | \texttt{maybe} statements without \texttt{evaluate} blocks. In addition, |
| 74 | 60 | \texttt{evaluate} blocks can store state across multiple alternative | ... | ... |
conclusion.tex
| 1 | -\vspace*{-0.05in} | |
| 2 | 1 | \section{Conclusion} |
| 3 | 2 | \label{sec-conclusion} |
| 4 | 3 | |
| ... | ... | @@ -8,7 +7,6 @@ development time and for that uncertainty to be resolved through later |
| 8 | 7 | testing and adaptation. We are in the process of building a prototype of the |
| 9 | 8 | \texttt{maybe} system for Android smartphones. |
| 10 | 9 | |
| 11 | -\vspace*{-0.05in} | |
| 12 | 10 | \section*{Acknowledgments} |
| 13 | 11 | |
| 14 | 12 | Students and faculty working on the \texttt{maybe} project are supported by |
| ... | ... | @@ -19,5 +17,3 @@ and |
| 19 | 17 | \href{http://www.nsf.gov/awardsearch/showAward.do?AwardNumber=1423215}{1423215}. |
| 20 | 18 | The \texttt{maybe} team thanks the anonymous reviewers and our shepherd, |
| 21 | 19 | Mahadev Satyanarayanan, for their feedback. |
| 22 | - | |
| 23 | -\vspace*{-0.05in} | ... | ... |
discussion.tex
| ... | ... | @@ -5,44 +5,33 @@ |
| 5 | 5 | |
| 6 | 6 | We have yet to determine how natural programmers will find the \texttt{maybe} |
| 7 | 7 | statement. Encouragingly, \texttt{maybe} statements are similar to the |
| 8 | -ubiquitous \texttt{if-else} statement, and in many cases can be used to | |
| 9 | -directly replace \texttt{if-else} statements that attempt runtime adaptation. | |
| 10 | -To coordinate the adaptation of multiple code paths a single \texttt{maybe} | |
| 11 | -variable---such as the policy string in Figure~\ref{fig-maybeexamples}---can | |
| 12 | -be used to control multiple \texttt{if-else} statements. | |
| 8 | +ubiquitous \texttt{if-else} statement, and in many cases can directly replace | |
| 9 | +\texttt{if-else} statements that attempt runtime adaptation. To coordinate | |
| 10 | +the adaptation of multiple code paths a single \texttt{maybe} variable can be | |
| 11 | +used to control multiple \texttt{if-else} statements. | |
| 13 | 12 | |
| 14 | -While \texttt{maybe} is a powerful programming tool, it is important that it | |
| 15 | -be used sparingly. If objective dependencies exist between \texttt{maybe} | |
| 16 | -statements, the overall configuration space may expand exponentially, | |
| 17 | -complicating post-deployment adaptation process. Compile-time analysis may be | |
| 18 | -required to detect dependencies between \texttt{maybe} statements and | |
| 19 | -encourage programmers to limit their use of \texttt{maybe} if to ensure that | |
| 20 | -downstream optimization remains feasible. | |
| 13 | +Overuse of the \texttt{maybe} statement may cause problems. If dependencies | |
| 14 | +exist between \texttt{maybe} statements, the overall configuration space may | |
| 15 | +expand exponentially, complicating post-deployment adaptation. Compile-time | |
| 16 | +analysis may be required to detect dependencies between \texttt{maybe} | |
| 17 | +statements and encourage programmers to limit their use of \texttt{maybe} to | |
| 18 | +ensure that downstream optimization remains feasible. | |
| 21 | 19 | |
| 22 | -\texttt{maybe} statements should not be used when adaptation is not | |
| 23 | -app-specific and can be refactored into a library. As an example, an app | |
| 24 | -should not use \texttt{maybe} to decide which network interface to use when | |
| 25 | -attempting to achieve a common objective, such as maximizing throughput. This | |
| 26 | -choice would be better refactored into a dedicated library, which might use | |
| 27 | -its own internal \texttt{maybe} statements. Not only is the resulting | |
| 28 | -codebase smaller, but the total number of \texttt{maybe} statements that the | |
| 29 | -system has to test is reduced. | |
| 20 | +\texttt{maybe} statements should not be used when adaptation can be | |
| 21 | +refactored into a library. As an example, an app should not use | |
| 22 | +\texttt{maybe} to decide which network interface to use when attempting to | |
| 23 | +achieve a common objective, such as maximizing throughput. This adaptation | |
| 24 | +should be refactored into a dedicated library, which might use its own | |
| 25 | +\texttt{maybe} statements. Not only is the resulting codebase smaller, but | |
| 26 | +the total number of \texttt{maybe} statements to test is reduced. | |
| 30 | 27 | |
| 31 | 28 | However, the \texttt{maybe} statement represents a fundamentally different |
| 32 | -approach from attempts to enable runtime adaptation that rely on libraries. | |
| 33 | -As a code organization strategy, the benefits that libraries provide in terms | |
| 34 | -of reduced duplication and more powerful interfaces are orthogonal and | |
| 35 | -complementary to the \texttt{maybe} statement. However, a large amount of | |
| 36 | -code including adaptation logic remains app specific and cannot be refactored | |
| 37 | -into a library. | |
| 38 | - | |
| 39 | -More importantly, library development still requires development-time | |
| 40 | -certainty. Despite the fact that library developers are more likely to be | |
| 41 | -experts at the type of adaptation the library performs, we still believe that | |
| 42 | -even the most skilled programmers are not capable of anticipating all | |
| 43 | -possible sources of uncertainty and will benefit from being able to express | |
| 44 | -structured uncertainty. \texttt{maybe} allows all developers---including both | |
| 45 | -app and library writers---to shed the burden of producing a single certain | |
| 46 | -approach and instead write uncertain code containing the flexibility needed | |
| 47 | -required to enable powerful data-driven approaches to post-deployment | |
| 48 | -adaptation. | |
| 29 | +approach to runtime adaptation than systems that rely on libraries because | |
| 30 | +library development still requires development-time certainty. While library | |
| 31 | +developers are more likely to be experts at the type of adaptation their | |
| 32 | +library performs, we still believe that even the most skilled programmers | |
| 33 | +will benefit from being able to express structured uncertainty. | |
| 34 | +\texttt{maybe} allows all developers---including both app and library | |
| 35 | +writers---to shed the burden of producing a single certain approach and | |
| 36 | +instead write uncertain code containing the flexibility required to enable | |
| 37 | +powerful data-driven approaches to post-deployment adaptation. | ... | ... |
related.tex
| ... | ... | @@ -7,21 +7,20 @@ programming with uncertain data, rather than the runtime adaptation enabled |
| 7 | 7 | by \texttt{maybe}. |
| 8 | 8 | |
| 9 | 9 | Aspect oriented programming (AOP)~\cite{aop} aims to increase modularity |
| 10 | -through the separation of cross-cutting concerns. The programmer can express | |
| 11 | -cross-cutting concerns in stand alone modules, or aspects. Aspects are | |
| 12 | -composed of advice, which specifies a computation to be performed as well as | |
| 13 | -points in the program at which that computation should be performed. | |
| 14 | -Fundamentally, the goals of AOP and the \texttt{maybe} statement differ, with | |
| 15 | -AOP focusing on modularity and \texttt{maybe} focused on increasing runtime | |
| 16 | -flexibility in the face of uncertainty. | |
| 10 | +through the separation of cross-cutting concerns. The programmer expresses | |
| 11 | +cross-cutting concerns in stand alone modules, or aspects, which specify a | |
| 12 | +computation to be performed as well as points in the program at which that | |
| 13 | +computation should be performed. Fundamentally, the goals of AOP and the | |
| 14 | +\texttt{maybe} statement differ, with AOP focusing on modularity and | |
| 15 | +\texttt{maybe} focused on enabling adaptation by expressing uncertainty. | |
| 17 | 16 | |
| 18 | -\texttt{maybe} shares similaries with language-based approaches to managing | |
| 17 | +\texttt{maybe} shares similaries with language-based approaches to adapting | |
| 19 | 18 | energy consumption such as Eon~\cite{sensys07-eon} and |
| 20 | 19 | Levels~\cite{sensys07-levels}. However, these approaches still require |
| 21 | -programmers to express certainty by associating code with particular energy | |
| 22 | -states, rather than allowing the \texttt{maybe} system to determine which | |
| 23 | -energy states are appropriate. \texttt{maybe} can also enable adaptation | |
| 24 | -driven by goals other than energy management. | |
| 20 | +programmers to express certainty by associating code with energy states, | |
| 21 | +rather than allowing the \texttt{maybe} system to determine which energy | |
| 22 | +states are appropriate. \texttt{maybe} can also enable adaptation driven by | |
| 23 | +goals other than energy management. | |
| 25 | 24 | |
| 26 | 25 | Attempts to enable more adaptive mobile systems date back to systems such as |
| 27 | 26 | Odyssey~\cite{odyssey-sosp97}. However, a taxonomy of approaches to enabling |
| ... | ... | @@ -30,3 +29,16 @@ the focus of early efforts on incorporating adaptation into libraries that |
| 30 | 29 | could be used by multiple apps. As we have pointed out previously, while |
| 31 | 30 | adaptation libraries are useful, \texttt{maybe} statements can make them more |
| 32 | 31 | powerful by allowing programmers to express uncertainty. |
| 32 | + | |
| 33 | +Recent approaches that allow mobile devices to effectively offload | |
| 34 | +computation by automating client-cloud partitioning are also related to the | |
| 35 | +\texttt{maybe} statement. Systems such as Tactics~\cite{tactics-mobisys03} | |
| 36 | +and MAUI~\cite{FIXME} used a variety of approaches to enabling this form of | |
| 37 | +adaptation but are narrowly-focused on harnessing opportunities for remote | |
| 38 | +execution. While \texttt{maybe} statements can enable simple decisions about | |
| 39 | +whether to offload portions of an app, the \texttt{maybe} approach is not yet | |
| 40 | +rich enough to consider how much of the execution should be performed | |
| 41 | +remotely or deal with server failures. At present \texttt{maybe} focuses on | |
| 42 | +single-device adaptation, but we are interested in exploring the ability to | |
| 43 | +use uncertainty to distribute computation between multiple devices as future | |
| 44 | +work. | ... | ... |