Commit 9db30a7c1dae04e05782f6778712c03cef1afbe7

Authored by Geoffrey Challen
1 parent 0f1ecfc3

New.

certainty.tex
... ... @@ -2,10 +2,10 @@
2 2 \label{sec-certainty}
3 3  
4 4 While \texttt{maybe} allows programmers to specify multiple alternatives,
5   -ultimately at runtime only one alternative can be executed. Either a single,
6   -globally-optimal alternative must be determined, or a deterministic decision
7   -procedure must be developed. Before discussing options for \textit{adapting}
8   -an app to its runtime environment, we first explain our runtime's support for
  5 +ultimately only one alternative can be executed at runtime. Either a single,
  6 +globally-optimal alternative must be identified, or a deterministic decision
  7 +procedure must be developed. Before discussing options for adapting an app to
  8 +its runtime environment, we first explain our runtime's support for
9 9 \texttt{maybe} alternatives, including \textit{a posteriori} evaluation and
10 10 data collection. Then, we discuss how \texttt{maybe} testing enables a
11 11 variety of different adaptation patterns.
... ... @@ -39,11 +39,11 @@ automatically-generated labels to aid this process.
39 39 If a \texttt{maybe} alternative throws an error, the system will bypass the
40 40 \texttt{evaluate} block and give it the worst possible score. By integrating
41 41 a form of record-and-replay~\cite{gomez2013reran}, it may be possible to roll
42   -back the failed alternative and retry another. \texttt{maybe} is intended to
43   -enable adaptation, not avoid errors, but the existence of other alternatives
44   -provides a way to work around failures caused by uncertainty. Fault tolerance
45   -may also encourage developers to use \texttt{maybe} statements to prototype
46   -alternatives to existing well-tested code.
  42 +back the failed alternative and retry another. While \texttt{maybe} is
  43 +intended to enable adaptation, not avoid errors, the existence of other
  44 +alternatives provides a way to work around failures caused by uncertainty.
  45 +Fault tolerance may also encourage developers to use \texttt{maybe}
  46 +statements to prototype alternatives to existing well-tested code.
47 47  
48 48 A final question concerns when a \texttt{maybe} alternative should be
49 49 evaluated. Some alternatives may require evaluation immediately after
... ... @@ -69,8 +69,8 @@ ways for the developer to guide and control any step in the process.
69 69 \subsubsection{Runtime control}
70 70  
71 71 To begin, we briefly outline how our Android prototype implements the
72   -\texttt{maybe} statement. We (1) rewrite each \texttt{maybe} statement to an
73   -\texttt{if-else} statement controlled by a call into the \texttt{maybe}
  72 +\texttt{maybe} statement. We (1) rewrite each \texttt{maybe} conditional to
  73 +an \texttt{if-else} statement controlled by a call into the \texttt{maybe}
74 74 system and (2) generate a similar setter for each \texttt{maybe} variable.
75 75 Variable values and code branches are now all under the control of a separate
76 76 \texttt{maybe} service which can be deployed as a separate app or
... ... @@ -100,8 +100,8 @@ simulation environments that accurately reflect all of the uncertainties
100 100 inherent to mobile systems programming, however, is difficult. To complicate
101 101 matters, \texttt{maybe} alternatives may depend on details of user
102 102 interaction that are difficult to know \textit{a priori}, particularly when
103   -new apps or functionalities are being investigated. So in most cases we
104   -believe post-deployment testing will be required.
  103 +new apps or features are being developed. So in most cases we believe
  104 +post-deployment testing will be required.
105 105  
106 106 However, pre-deployment testing may still be a valuable approach,
107 107 particularly when a large number of \texttt{maybe} statements are being used.
... ... @@ -114,16 +114,15 @@ significant impact on performance and should be evaluated first. Other
114 114  
115 115 Eventually code containing a number of \texttt{maybe} statements will be
116 116 deployed on thousands or millions of devices. At this point, large-scale
117   -split testing and learning can begin. If the user community is large enough,
118   -then it may be possible to collect statistically-significant results even for
119   -all possible permutations of \texttt{maybe} alternatives. For apps with a
120   -small number of users, or comparatively large number of \texttt{maybe}
121   -statements, we can collect data for variations of one \texttt{maybe}
122   -statement while holding the others constant. As an adaptation policy is
  117 +split testing and data-driven learning can begin. If the user community is
  118 +large enough, it may be possible to collect statistically-significant results
  119 +even for all possible permutations of \texttt{maybe} alternatives. For apps
  120 +with a small number of users, or a large number of \texttt{maybe} statements,
  121 +we can collect data for variations of one or several \texttt{maybe}
  122 +statements while holding the rest constant. As an adaptation policy is
123 123 designed and deployed for the statement being tested, we begin to vary and
124   -measure the next \texttt{maybe} statement. We will provide a web interface
125   -allowing the developer to determine which \texttt{maybe} statements should be
126   -tested at any given time.
  124 +measure the next group of \texttt{maybe} statements. Developers can observe
  125 +and control the testing process through a web interface.
127 126  
128 127 Each time a \texttt{maybe} statement is reached or \texttt{maybe} variable is
129 128 set, the \texttt{maybe} system records:
... ... @@ -145,7 +144,7 @@ and platform information; networking provider and conditions; location;
145 144 battery level; and so on.
146 145  
147 146 \end{itemize}
148   -%
  147 +
149 148 This dataset is periodically uploaded to the \texttt{maybe} server and used
150 149 to drive the adaptation approaches discussed next.
151 150  
... ... @@ -154,17 +153,17 @@ to drive the adaptation approaches discussed next.
154 153 While large-scale split testing is intended to provide good coverage over all
155 154 possible sources of uncertainty we have discussed, it still normally requires
156 155 that only one choice be made at any given time---implying that two
157   -alternatives may \textit{never} be evaluated under identical conditions. For
  156 +alternatives may never be evaluated under identical conditions. For
158 157 \texttt{maybe} statements, however, we are exploring the idea of performing
159 158 \textit{simultaneous} split testing. In this model the app forks at the top
160   -of the \texttt{maybe} statement, executes and scores all alternatives, and then
161   -continues with the outputs from the best alternative at the bottom of the
162   -\texttt{maybe} statement. On single-core devices this can be done in serial,
163   -while the growing number of multi-core smartphones provides the option of
164   -doing this in parallel. The benefit of this approach is that each alternative
165   -is executed under near-identical conditions. The drawbacks include the
166   -overhead of the redundant executions and the possibility for interference
167   -between alternatives executing in parallel.
  159 +of the \texttt{maybe} statement, executes and scores all alternatives, and
  160 +then continues with the outputs from the best alternative at the bottom of
  161 +the \texttt{maybe} statement. On single-core devices this can be done in
  162 +serial, while the growing number of multi-core smartphones provides the
  163 +option of doing this in parallel. The benefit of this approach is that each
  164 +alternative is executed under near-identical conditions. The drawbacks
  165 +include the overhead of the redundant executions and the possibility for
  166 +interference between alternatives executing in parallel.
168 167  
169 168 \subsection{\texttt{\large maybe} Endgames}
170 169  
... ... @@ -206,11 +205,10 @@ second, somewhat easier case.
206 205 If the alternative is determined through static adaptation then the correct
207 206 choice is a function of some unchanging (or very-slowly changing) aspect of
208 207 the deployed environment. Examples include the device model, average network
209   -conditions, the other apps installed on the device, or some slowly-changing
210   -user characteristic such as gender, age, or charging habits. In this case it
211   -is possible that the correct alternative can be determined through some
212   -clustering based on these features, and once determined will remain the best
213   -choice over long time intervals.
  208 +conditions, the other apps installed on the device, or user characteristics
  209 +such as gender, age, or charging habits. In this case it is possible that the
  210 +correct alternative can be determined through clustering based on these
  211 +features, and once determined will remain the best choice for a long time.
214 212  
215 213 \subsubsection{Dynamic adaptation}
216 214  
... ... @@ -225,13 +223,14 @@ Note that \texttt{evaluate} blocks are \textit{not} intended to accomplish
225 223 this kind of adaptation. First, they run after the \texttt{maybe} statement
226 224 has been executed, not before. Second, per-\texttt{maybe} strategy defeats
227 225 the flexibility inherent to the \texttt{maybe} approach and would devolve
228   -into the fragile decision-making we are trying to avoid. Instead, the
229   -\texttt{maybe} system allows developers to experiment with and evaluate a
230   -variety of different dynamic adaptation strategies deployed in a companion
231   -library, with the choice guided by post-deployment testing. For example, if
232   -the performance of an alternative is discovered to be correlated with a link
233   -providing a certain amount of bandwidth, then that adaptation strategy can be
234   -connected with that particular \texttt{maybe} statement.
  226 +into the fragile decision-making we are trying to avoid.
  227 +
  228 +Instead, the \texttt{maybe} system allows developers to experiment with and
  229 +evaluate a variety of different dynamic adaptation strategies deployed in a
  230 +companion library, with the choice guided by post-deployment testing. For
  231 +example, if the performance of an alternative is discovered to be correlated
  232 +with a link providing a certain amount of bandwidth, then that adaptation
  233 +strategy can be connected with that particular \texttt{maybe} statement.
235 234  
236 235 Observe that in some cases of dynamic adaptation, what begins as a
237 236 \texttt{maybe} statement may end as effectively \texttt{if-else} statement
... ...
include/start.tex
... ... @@ -27,8 +27,8 @@
27 27  
28 28 \usepackage[all]{hypcap}
29 29  
30   -\setlist[itemize]{leftmargin=*,topsep=2pt,itemsep=-0.5ex,partopsep=1ex,parsep=1ex}
31   -\setlist[enumerate]{leftmargin=*,topsep=2pt,itemsep=-0.5ex,partopsep=1ex,parsep=1ex}
  30 +\setlist[itemize]{leftmargin=*,itemsep=-0.1ex}
  31 +%\setlist[enumerate]{leftmargin=*,topsep=0.5ex,itemsep=0.5ex,partopsep=0.5ex,parsep=0.5ex}
32 32  
33 33 \paperheight 11in
34 34 \paperwidth 8.5in
... ...