Changeset 9c12dd0 for doc/theses/mike_brooks_MMath
- Timestamp:
- Apr 27, 2026, 7:17:34 PM (31 hours ago)
- Branches:
- master
- Children:
- f1ffc47
- Parents:
- 602cec4
- Location:
- doc/theses/mike_brooks_MMath
- Files:
-
- 5 edited
-
array.tex (modified) (14 diffs)
-
background.tex (modified) (8 diffs)
-
list.tex (modified) (15 diffs)
-
string.tex (modified) (19 diffs)
-
uw-ethesis.tex (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/mike_brooks_MMath/array.tex
r602cec4 r9c12dd0 30 30 31 31 A function can be polymorphic over @array@ arguments using the \CFA @forall@ declaration prefix. 32 \begin{minipage}{\linewidth} % forbid page splitting, force 32 33 \begin{cfa} 33 34 forall( T, @[N]@ ) … … 40 41 Cforall Runtime error: subscript 1000 exceeds dimension range [0,99) $for$ array 0x555555558020. 41 42 \end{cfa} 43 \end{minipage} 42 44 Function @g@ takes an arbitrary type parameter @T@ and an unsigned integer \emph{dimension} @N@. 43 45 The dimension represents a to-be-determined number of elements, managed by the type system, where 0 represents an empty array. … … 125 127 \lstinput{30-43}{hello-array.cfa} 126 128 \lstinput{45-48}{hello-array.cfa} 127 \caption{Example of calling a dimension-generic function .}129 \caption{Example of calling a dimension-generic function} 128 130 \label{f:fExample} 129 131 \end{figure} … … 243 245 This static check's rules are presented in \VRef[Section]{s:ArrayTypingC}. 244 246 245 Orthogonally, the \CFA array type works within generic \emph{types}, \ie @forall@-on-@struct@. 246 The same argument safety and the associated implicit communication of array length occurs. 247 Orthogonally, the \CFA array type also works inside generic \emph{types}. 248 That is, an @array@ as a generic @struct@'s member and an @[N]@ can parameterize a @struct@. 249 The same argument safety, and the associated implicit length communication, occur. 247 250 Preexisting \CFA allowed aggregate types to be generalized with type parameters, enabling parameterizing of element types. 248 This feature is extended to allow parameterizing by dimension. 249 Doing so gives a refinement of C's ``flexible array member''~\cite[\S~6.7.2.1.18]{C11}: 251 As polymorphism on functions was extended to allow parameterizing over dimensions, so is polymorphism on types. 252 The result has profound consequences for safe memory management. 253 254 C's Flexible Array Member (FAM) pattern~\cite[\S~6.7.2.1.18]{C11} gives an unsafe way to put an array of dynamic length inside a structure. 250 255 \begin{cfa} 251 256 struct S { 252 257 ... 253 double d []; // incomplete array type => flexible array member 254 } * s = malloc( sizeof( struct S ) + sizeof( double [10] ) ); 255 \end{cfa} 256 which creates a VLA of size 10 @double@s at the end of the structure. 257 A C flexible array member can only occur at the end of a structure; 258 \CFA allows length-parameterized array members to be nested at arbitrary locations, with intervening member declarations. 259 \lstinput{10-15}{hello-accordion.cfa} 260 The structure has course- and student-level metadata (their respective field names) and a position-based preferences' matrix. 261 The structure's layout is dynamic; the starting offset of @student_ids@ varies according to the generic parameter @C@; the offset of @preferences@ varies by both. 262 263 \VRef[Figure]{f:checkExample} shows a program main using @School@ and results with different array sizes. 258 double d[]; // incomplete array type => flexible array member 259 }; 260 struct S * s = malloc( sizeof( struct S ) + sizeof( double [10] ) ); 261 \end{cfa} 262 This type-@S@ declaration defines a quasi-VLA named @d@ as the last structure member. 263 The variable-@s@ initialization sizes this particular array at 10 elements. 264 The choice of @malloc@ here is the common-case FAM idiom, but @alloca@ can be substituted, resulting in stack allocation. 265 A \CFA @[N]@-parameterized structure improves on this pattern. 266 267 \begin{figure} 268 \lstinput{10-15}{hello-accordion.cfa} 269 \caption{\CFA Dynamic Array Member (DAM) declaration} 270 \label{DAM-declaration} 271 \end{figure} 272 273 \CFA allows length-parameterized array members to be nested at arbitrary locations, with further member declarations interleaved. 274 The result is a \newterm{Dynamic Array Member (DAM)} 275 % \footnote{ 276 % To keep the names straight, it may help to think of C's flexible array member as ``too flexible,'' where the discussion that follows makes the case that a FAM is weakly typed. 277 % }, 278 as illustrated in \VRef[Figure]{DAM-declaration}. The example's @School@ structure has course- and student-level metadata (in the respectively named fields) and a position-based preferences' matrix. 279 The structure's layout is dynamic; the starting offset of @student_ids@ varies according to the generic parameter @C@, which affects the size of the @course_codes@ field. 280 Similarly, the offset of @preferences@ varies by both parameters. 281 282 \VRef[Figure]{f:DAM-example} shows a program main using the @School@ type, along with results at different array sizes. 264 283 The @school@ variable holds many students' course-preference forms. 265 284 It is on the stack and its initialization does not use any casting or size arithmetic. 266 Both of these points are impossible with a C flexible array member. 267 When heap allocation is preferred, the original pattern still applies. 285 When heap allocation is preferred, the original pattern still applies, with the same qualities. 268 286 \begin{cfa} 269 287 School( classes, students ) * sp = alloc(); 270 288 \end{cfa} 271 This ability to avoid casting and size arithmetic improves safety and usability over C flexible array members.272 289 The example program prints the courses in each student's preferred order, all using the looked-up display names. 273 When a function operates on a @School@ structure, the type system handles its memory layout transparently.274 In the example, function @getPref@ returns, for the student at position @is@, what is the position of their @pref@\textsuperscript{th}-favoured class.275 Finally, inputs and outputs are given on the right for different sized schools.290 In the example, function @getPref@ returns, for the student at position @is@, the position of their @pref@\textsuperscript{th}-favoured class. 291 This function helps the program to output each student's ordered preferences. 292 The program's inputs and outputs are given on the right, for two different school sizes. 276 293 277 294 \begin{figure} … … 304 321 \end{tabular} 305 322 306 \caption{\lstinline{School} Example, Input and Output} 307 \label{f:checkExample} 323 324 \caption[\CFA Dynamic Array Member (DAM) usage]{ 325 \CFA Dynamic Array Member (DAM) usage. 326 Example program (left) with input and output (right).} 327 \label{f:DAM-example} 308 328 \end{figure} 329 330 Much of these \CFA DAM features are impossible with a C FAM. 331 In C, they can only occur at the end of a structure; 332 \CFA allows them anywhere. 333 As a consequence, \CFA allows several of them, while C is limited to one. 334 The \CFA ability to avoid casting and size arithmetic improves safety and usability over C. 335 While C offers the \emph{VLA} language feature, to eliminate casting and size arithmetic for stack-allocated \emph{simple arrays}, this feature does not extend to stack-allocating a FAM-structure, which makes the user fall back on explicit @alloca@. 336 The \CFA DAM, by contrast, treats every stack allocation as a simple variable declaration. 337 When a function operates on a \CFA DAM structure, the type system handles its memory layout transparently. 338 309 339 310 340 … … 343 373 The ``resolver'' compiler pass, which provides argument values for a declaration's type-system parameters, gathered from type information in scope at the usage site. 344 374 \item 345 The ``box'' compiler pass, which encodes information about type parameters into ``extra'' regular parameters on declarations and andarguments on calls.375 The ``box'' compiler pass, which encodes information about type parameters into ``extra'' regular parameters on declarations, and corresponding arguments on calls. 346 376 Notably, it conveys the size of a type @foo@ as a @__sizeof_foo@ parameter, and rewrites the @sizeof(foo)@ expression as @__sizeof_foo@, \ie a use of the parameter. 347 377 \end{itemize} … … 690 720 \end{itemize} 691 721 692 \caption {Case comparison for array type compatibility, given pairs of dimension expressions.}722 \caption[Case comparison for array type compatibility]{Case comparison for array type compatibility, given pairs of dimension expressions.} 693 723 \label{f:DimexprRuleCompare} 694 724 \end{figure} … … 946 976 \begin{figure} 947 977 \includegraphics{measuring-like-layout} 948 \caption{Visualization of subscripting by value and by \lstinline[language=CFA]{all}, for \lstinline{x} of type \lstinline{array( float, 5, 7 )} understood as 5 rows by 7 columns. 949 The horizontal layout represents contiguous memory addresses while the vertical layout is conceptual. 950 The vertical shaded band highlights the location of the targeted element, 2.3. 951 Any such vertical slice contains various interpretations of a single address.} 978 \caption[Visualization of subscripting by value and by `all']{ 979 Visualization of subscripting by value and by `\lstinline[language=CFA]{all}.' 980 Uses example variable \lstinline{x} of type \lstinline{array( float, 5, 7 )}, understood as 5 rows by 7 columns. 981 The horizontal layout represents contiguous memory addresses while the vertical layout is conceptual. 982 The vertical shaded band highlights the location of the targeted element, 2.3. 983 Any such vertical slice contains various interpretations of a single address. 984 } 952 985 \label{fig:subscr-all} 953 986 \end{figure} … … 1007 1040 % \noindent END: Paste looking for a home 1008 1041 1009 The new-array library defines types and operations that ensure proper elements are accessed soundly in spite of the overlapping. 1010 The @arpk@ structure and its @-[i]@ operator are defined as: 1042 \begin{figure} 1011 1043 \begin{cfa} 1012 1044 forall( … … 1026 1058 } 1027 1059 \end{cfa} 1060 \caption{Definition of structure `\lstinline{arpk},' which underlies the \CFA array} 1061 \label{f:arpk} 1062 \end{figure} 1063 1064 The new-array library defines types and operations that ensure proper elements are accessed soundly in spite of the overlapping. 1065 The @arpk@ structure and its @-[i]@ operator are defined in \VRef[Figure]{f:arpk}. 1028 1066 The private @arpk@ structure (array with explicit packing) is generic over four types: dimension length, masquerading-as, ... 1029 1067 This structure's public interface is hidden behind the @array(...)@ macro and the subscript operator. … … 1101 1139 \multicolumn{1}{c}{(i)} 1102 1140 \end{tabular} 1103 \caption{Overhead comparison, control case. 1104 All three programs/compilers generate equally performant code when the programmer ``self-checks'' bounds via a loop's condition. 1105 Yet both \CFA and \CC versions generate code that is slower and safer than C's when the programmer might overrun the bounds.} 1141 \caption[Bound-check overhead comparison, control case]{ 1142 Bound-check overhead comparison, control case. 1143 All three programs/compilers generate equally performant code when the programmer ``self-checks'' bounds via a loop's condition. 1144 Yet both \CFA and \CC versions generate code that is slower and safer than C's when the programmer might overrun the bounds. 1145 } 1106 1146 \label{f:ovhd-ctl} 1107 1147 \end{figure} … … 1344 1384 \end{cfa} 1345 1385 \end{tabular} 1346 \caption{Exponential thunk generation under the otype-recursion pattern. 1386 \caption[Exponential thunk generation under the otype-recursion pattern]{ 1387 Exponential thunk generation under the otype-recursion pattern. 1347 1388 Each time one type's function (\eg ctor) uses another type's function, the \CFA compiler generates a thunk, to capture the used function's dependencies, presented according to the using function's need. 1348 1389 So, each non-leaf line represents a generated thunk and every line represents a search request for the resolver to find a satisfying function.} … … 1640 1681 \hspace{6pt} 1641 1682 1642 \caption{Triangular Matrix}1683 \caption{Triangular matrix in Java and C} 1643 1684 \label{f:JavaVsCTriangularMatrix} 1644 1685 \end{figure} … … 1684 1725 1685 1726 Thus, these options do not offer an allocation with a dynamically given fixed size. 1686 And furthermore, they do not provide any improvement to the C flexible array member pattern, for making a dynamic amount of storage contiguous with its header, as do \CFA's accordions.1727 And furthermore, they do not provide any improvement to the C flexible array member pattern, for making a dynamic amount of storage contiguous with its header, as do \CFA's new dynamic array members. 1687 1728 1688 1729 -
doc/theses/mike_brooks_MMath/background.tex
r602cec4 r9c12dd0 491 491 \end{cfa} 492 492 \end{tabular} 493 \caption{Pre-VLA Fixed \vs Variable Contiguous Matrix Styles}493 \caption{Pre-VLA contiguous matrix styles, fixed \vs variable} 494 494 \label{f:FixedVariable} 495 495 \end{figure} … … 580 580 \end{cfa} 581 581 \end{tabular} 582 \caption{C99 Contiguous \vs Non-contiguous Matrix Styles}582 \caption{C99 matrix styles, contiguous \vs non-contiguous } 583 583 \label{f:ContiguousNon-contiguous} 584 584 \end{figure} … … 672 672 \end{cfa} 673 673 \end{tabular} 674 \caption{Multiple ways to declare an array parameter. 674 \caption[Multiple ways to declare an array parameter]{ 675 Multiple ways to declare an array parameter. 675 676 Across a valid row, every declaration is equivalent. 676 677 Each column gives a declaration style, where the style for that column is read from the first row. … … 955 956 \subfloat[Wrapped value]{\label{f:WrappedValue}\usebox\myboxC} 956 957 957 \caption {958 Three styles of link attachment :958 \caption[Three styles of link attachment]{ 959 Three styles of link attachment. 959 960 % \protect\subref*{f:Intrusive}~intrusive, \protect\subref*{f:WrappedRef}~wrapped reference, and \protect\subref*{f:WrappedValue}~wrapped value. 960 961 The diagrams show the memory layouts that result after the code runs, eliding the head object \lstinline{reqs}; … … 1012 1013 \lstinput[language=C++]{100-117}{lst-issues-attach-reduction.hpp} 1013 1014 \lstinput[language=C++]{150-150}{lst-issues-attach-reduction.hpp} 1014 \caption {1015 \caption[Simulation of wrapped using intrusive]{ 1015 1016 Simulation of wrapped using intrusive. 1016 1017 Illustrated by pseudocode implementation of an STL-compatible API fragment using LQ as the underlying implementation. … … 1048 1049 \hspace*{1.5in}\includegraphics[page=2]{lst-issues-direct.pdf} 1049 1050 } 1050 \caption {1051 \caption[Example of simultaneity using LQ lists]{ 1051 1052 Example of simultaneity using LQ lists. 1052 1053 The zoomed-out diagram (right/top) shows the complete multi-linked data structure. … … 1214 1215 \centering 1215 1216 \includegraphics[width=\textwidth]{lst-issues-ident.pdf} 1216 \caption {1217 \caption[Comparison of headed and ad-hoc list identities]{ 1217 1218 Comparison of headed and ad-hoc list identities, for various list lengths. 1218 1219 Pointers are logical, meaning that no claim is intended about which part of an object is being targeted. … … 1256 1257 \centering 1257 1258 \includegraphics[width=0.55\textwidth]{lst-issues-end.pdf} 1258 \caption {1259 LQ sub-object-level representation of links and ends.1259 \caption[LQ field-level representation of links and ends]{ 1260 LQ field-level representation of links and ends. 1260 1261 Each object's memory is pictured as a vertical strip. 1261 1262 The location, within a strip, at which an arrow points, is significant. -
doc/theses/mike_brooks_MMath/list.tex
r602cec4 r9c12dd0 43 43 g( s, &s ); $\C{// value, pointer}$ 44 44 \end{cfa} 45 \caption{Plan-9 Polymorphism}45 \caption{Plan-9 polymorphism} 46 46 \label{f:Plan9Polymorphism} 47 47 \end{figure} … … 79 79 \end{cfa} 80 80 \end{tabular} 81 \caption{Diamond Non-Virtual Inheritance Pattern}81 \caption{Diamond non-virtual inheritance pattern} 82 82 \label{f:DiamondInheritancePattern} 83 83 \end{figure} … … 127 127 } 128 128 \end{cfa} 129 \caption {\lstinline{dlisk} / \lstinline{dlist} Outline}129 \caption[Sketch of the dlink and dlist type definitions]{Sketch of the \lstinline{dlink} and \lstinline{dlist} type definitions } 130 130 \label{f:dlistOutline} 131 131 \end{figure} … … 154 154 \end{tabular} 155 155 156 \caption {157 Demonstration of multiple static link axes done in the \CFA list library.156 \caption[Demonstration of multiple static link axes in \CFA]{ 157 Demonstration of multiple static link axes in \CFA. 158 158 The right example is from \VRef[Figure]{fig:lst-issues-multi-static}. 159 159 The left \CFA example does the same job. … … 278 278 E & remove_first( dlist( E ) & list ); 279 279 E & remove_last( dlist( E ) & list ); 280 void transfer( dlist( E ) & to, dlist( E ) & from ) {281 void split( dlist( E ) & to, dlist( E ) & from, E & node ) {282 \end{cfa} 283 \caption{\CFA List API}280 void transfer( dlist( E ) & to, dlist( E ) & from ); 281 void split( dlist( E ) & to, dlist( E ) & from, E & node ); 282 \end{cfa} 283 \caption{\CFA list API} 284 284 \label{f:ListAPI} 285 285 \end{figure} … … 309 309 } 310 310 \end{cfa} 311 \caption{Iterator Driver}311 \caption{Iterator driver} 312 312 \label{f:IteratorDriver} 313 313 \end{figure} … … 586 586 \end{cfa} 587 587 \end{tabular} 588 \caption{ \CC \vs \CFA List Issues}588 \caption{Obtaining a linked-list iterator in \CC \vs \CFA} 589 589 \label{f:CCvsCFAListIssues} 590 590 \end{figure} … … 627 627 \includegraphics[width=\textwidth]{lst-impl-links.pdf} 628 628 \caption{ 629 \CFA list library representations for headed and headless lists .629 \CFA list library representations for headed and headless lists 630 630 } 631 631 \label{fig:lst-impl-links} … … 717 717 \end{tabular} 718 718 \caption{ 719 Glossary of terms used in the list performance evaluation .719 Glossary of terms used in the list performance evaluation 720 720 } 721 721 \label{f:ListPerfGlossary} … … 969 969 all hd & ins-e & rem-e & all hd & ins-e & rem-e 970 970 \end{tabular} 971 \caption{Experiment use cases, numbered .}971 \caption{Experiment use cases, numbered} 972 972 \label{f:ExperimentOperations} 973 973 \end{figure} … … 1041 1041 } 1042 1042 \end{tabular} 1043 \caption {Variety of IR duration \vslist length, at small--medium lengths. Two example use cases are shown: I, stack movement with head-only access (plot a); VIII, queue movement with element-oriented removal access (plot b); both use cases have insert-first polarity. One example is run on each machine: UC-I on AMD (ploat a); UC-VIII on Intel (plot b). Lower is better.}1043 \caption[Variety of IR duration responses to list length, at small--medium lengths]{Variety of IR duration responses to list length, at small--medium lengths. Two example use cases are shown: I, stack movement with head-only access (plot a); VIII, queue movement with element-oriented removal access (plot b); both use cases have insert-first polarity. One example is run on each machine: UC-I on AMD (ploat a); UC-VIII on Intel (plot b). Lower is better.} 1044 1044 \label{fig:plot-list-zoomin-abs} 1045 1045 \end{figure} … … 1147 1147 } 1148 1148 \end{tabular} 1149 \caption{IR duration, transformed for general anaysis. The analysis follows the single example setup of \VRef[Figure]{f:zoomin-abs-i-swift}, \ie Use Case I on AMD, where IR is given as absolute duration. Plot (a) transforms the source dataset by conditioning on specific size. Plot (b) takes the results from only the identified size zones, discards their specific-size information, and shows the resulting distribution. Lower is better.} 1149 \caption[IR duration, transformed for general anaysis]{ 1150 IR duration, transformed for general anaysis. 1151 The analysis follows the single example setup of \VRef[Figure]{f:zoomin-abs-i-swift}, \ie Use Case I on AMD, where IR is given as absolute duration. 1152 Plot (a) transforms the source dataset by conditioning on specific size. 1153 Plot (b) takes the results from only the identified size zones, discards their specific-size information, and shows the resulting distribution. 1154 Lower is better.} 1150 1155 \label{fig:plot-list-rel} 1151 1156 \end{figure} … … 1258 1263 } % subfigure 1259 1264 \end{tabular} 1260 \caption{Insert/remove duration \vs list length.1265 \caption[IR duration \vs list length, all sizes]{IR duration \vs list length, all sizes. 1261 1266 Lengths go as large possible without error. 1262 1267 One example use case is shown: stack movement, insert-first polarity and head-mediated access. Lower is better.} … … 1348 1353 \includegraphics{plot-list-1ord.pdf} 1349 1354 \small{\textsuperscript{\textdagger} LQ-@list@ is (/48) by its incomplete (25\%) use case coverage. Its bars are scaled to match.} 1350 \caption{Histogram of IR durations, decomposed by all first-order effects. 1351 Each of the three breakdowns divides the entire population of test results into its mutually disjoint constituents. Lower is better. 1355 \caption[IR duration, decomposed by all first-order effects]{ 1356 IR duration, decomposed by all first-order effects. 1357 Each of the three breakdowns divides the entire population of test results into its mutually disjoint constituents. 1358 Lower is better. 1352 1359 } 1353 1360 \label{fig:plot-list-1ord} … … 1396 1403 \textsuperscript{*} The full population of 192 individual configurations applies (48 for LQ-@list@), but this analysis summarizes pairs of them, giving each histogram's 96 contributions (24 for LQ-@list@). 1397 1404 } 1398 \caption{Histogram of IR durations, illustrating interactions with framework. 1399 Higher favours top option; lower favours bottom option. 1405 \caption[IR duration where framework selection interacts with other factors]{ 1406 IR duration where framework selection interacts with other factors. 1407 Higher favours top option; lower favours bottom option. 1400 1408 } 1401 1409 \label{fig:plot-list-2ord} -
doc/theses/mike_brooks_MMath/string.tex
r602cec4 r9c12dd0 14 14 The over-arching commonality is that operations work on groups of characters for assigning, copying, scanning, and updating. 15 15 16 \begin{figure}[h] 16 %\begin{figure}[h] 17 \begin{figure} 17 18 \begin{cquote} 18 19 \begin{tabular}{@{}l|l|l|l@{}} … … 34 35 \end{tabular} 35 36 \end{cquote} 36 \caption{ Language comparison of string API}37 \caption{Inter-language comparison of string APIs} 37 38 \label{f:StrApiCompare} 38 39 \end{figure} … … 620 621 \end{tabular} 621 622 \end{cquote} 622 \caption{ Extracting Words from Line of Text}623 \caption{Simplification by \CFA API for extracting words from a line of text} 623 624 \label{f:ExtractingWordsText} 624 625 \end{figure} … … 812 813 As well, the operations are asymmetric, \eg @String@ has @replace@ by text but not replace by position and vice versa for @StringBuffer@. 813 814 814 More significant operational differences relate to storage management, often appearing through assignment (@target = source@), and are summarized in \VRef[Figure]{f:StrSemanticCompare}, which defines properties type abstraction, state, symmetry, and referent. 815 The following discussion justifies the figure's yes/no entries per language. 816 817 \begin{figure} 815 More significant operational differences relate to storage management, often appearing through assignment (@target = source@), and are summarized in \VRef[Table]{f:StrSemanticCompare}, which defines properties type abstraction, state, symmetry, and referent. 816 The following discussion justifies the table's yes/no entries per language. 817 818 \begin{table} 819 \caption{Comparison of languages' strings, storage management perspective} 820 \label{f:StrSemanticCompare} 818 821 \setlength{\extrarowheight}{2pt} 819 822 \setlength{\tabcolsep}{5pt} … … 860 863 The Java @String@ class is analyzed; its @StringBuffer@ class behaves similarly to \CC. 861 864 \end{itemize} 862 \caption{Comparison of languages' strings, storage management perspective.} 863 \label{f:StrSemanticCompare} 864 \end{figure} 865 \end{table} 865 866 866 867 In C, these declarations are very different. … … 943 944 $\texttt{\small abcde abcde abcde abcde bc c}$ 944 945 \end{cfa} 945 % all helpful criteria of \VRef[ Figure]{f:StrSemanticCompare} are satisfied.946 % all helpful criteria of \VRef[Table]{f:StrSemanticCompare} are satisfied. 946 947 The \CFA string manages storage, handles all assignments, including those of fragment referents with fast initialization, provides the choice between snapshot and alias semantics, and does so symmetrically with one type (which assures text validity according to the lifecycles of the string variables). 947 948 The @s1@ case is the same in \CFA as in \CC. … … 956 957 \subsection{Logical Overlap} 957 958 958 It may be unfamiliar to combine \VRef[ Figure]{f:StrSemanticCompare}'s alias state and fragment referent in one API, or at the same time.959 It may be unfamiliar to combine \VRef[Table]{f:StrSemanticCompare}'s alias state and fragment referent in one API, or at the same time. 959 960 This section shows the capability in action. 960 961 … … 1076 1077 } 1077 1078 \end{cfa} 1078 \caption{Pa rameter Passing}1079 \caption{Passing substrings as parameters, program} 1079 1080 \label{f:ParameterPassing} 1080 1081 \end{figure} … … 1333 1334 \end{multicols} 1334 1335 1335 \caption{ Execution of Function \lstinline{test}}1336 \caption{Passing substrings as parameters, execution} 1336 1337 \label{f:ParametersPassingResults} 1337 1338 \end{figure} … … 1564 1565 \end{tabular} 1565 1566 1566 \caption{Code Lowering for RAII}1567 \caption{Code lowering by RAII implementation} 1567 1568 \label{f:CodeLoweringRAII} 1568 1569 \end{figure} … … 1618 1619 To use LL, a programmer rewrites invocations using pass-by-value APIs into invocations where resourcing is more explicit. 1619 1620 Many invocations are unaffected, notably assignment and comparison. 1620 \VRef[ Figure]{f:HL_LL_Lowering} shows, of the capabilities listed in \VRef[Figure]{f:StrApiCompare}, only three cases need revisions.1621 \VRef[Table]{f:HL_LL_Lowering} shows, of the capabilities listed in \VRef[Figure]{f:StrApiCompare}, only three cases need revisions. 1621 1622 The actual HL workaround wraps @string@ as a pointer to a uniquely owned, heap-allocated @string_res@. 1622 1623 This arrangement has @string@ using style-\ref{p:feature1} RAII, which is compatible with pass-by-value. 1623 1624 1624 \begin{figure} 1625 \begin{table} 1626 \caption{HL to LL \CFA string-API lowering} 1627 \label{f:HL_LL_Lowering} 1625 1628 \centering 1626 1629 \begin{tabular}{@{}ll@{}} … … 1666 1669 \end{tabular} 1667 1670 1668 \caption{HL to LL Lowering} 1669 \label{f:HL_LL_Lowering} 1670 \end{figure} 1671 \end{table} 1671 1672 1672 1673 … … 1738 1739 \raisebox{-0.17\totalheight}{\includegraphics{string-sharectx.pdf}} % lower 1739 1740 \end{tabular} 1740 \caption {Controlling copyingvs sharing of strings using \lstinline{string_sharectx}.}1741 \caption[Controlling copying \vs sharing of strings]{Controlling copying \vs sharing of strings using \lstinline{string_sharectx}.} 1741 1742 \label{fig:string-sharectx} 1742 1743 \end{figure} … … 1885 1886 \includegraphics{plot-string-peq-cppemu.pdf} 1886 1887 % \includegraphics[width=\textwidth]{string-graph-peq-cppemu.png} 1887 \caption{Fresh vs Reuse in \CC, Emulation Baseline. 1888 Average time per iteration with one \lstinline{x += y} invocation (lower is better). 1889 Comparing \CFA's STL emulation mode with STL implementations, and comparing the fresh with reused reset styles.} 1888 \caption[Fresh \vs reuse in \CC, emulation baseline]{ 1889 Fresh \vs reuse in \CC, emulation baseline. 1890 Average time per iteration with one \lstinline{x += y} invocation (lower is better). 1891 Comparing \CFA's STL emulation mode with STL implementations, and comparing the fresh with reused reset styles.} 1890 1892 \label{fig:string-graph-peq-cppemu} 1891 1893 \bigskip … … 1893 1895 \includegraphics{plot-string-peq-sharing.pdf} 1894 1896 % \includegraphics[width=\textwidth]{string-graph-peq-sharing.png} 1895 \caption{\CFA Compromise for Fresh \vs Reuse. 1896 Average time per iteration with one \lstinline{x += y} invocation (lower is better). 1897 Comparing \CFA's sharing mode with STL, and comparing the fresh with reused reset styles. 1898 The \CC results are repeated from \VRef[Figure]{fig:string-graph-peq-cppemu}.} 1897 \caption[\CFA compromise for fresh \vs reuse]{ 1898 \CFA compromise for fresh \vs reuse. 1899 Average time per iteration with one \lstinline{x += y} invocation (lower is better). 1900 Comparing \CFA's sharing mode with STL, and comparing the fresh with reused reset styles. 1901 The \CC results are repeated from \VRef[Figure]{fig:string-graph-peq-cppemu}. 1902 } 1899 1903 \label{fig:string-graph-peq-sharing} 1900 1904 \end{figure} … … 2015 2019 \includegraphics{plot-string-pta-sharing.pdf} 2016 2020 % \includegraphics[width=\textwidth]{string-graph-pta-sharing.png} 2017 \caption{CFA's low overhead for misusing concatenation. Average time per iteration with one \lstinline{x += y} invocation (lower is better). Comparing \CFA (having implicit sharing activated) with STL, and comparing the \lstinline{+}-then-\lstinline{=} with the \lstinline{+=} append styles. The \lstinline{+=} results are repeated from \VRef[Figure]{fig:string-graph-peq-sharing}.} 2021 \caption[\CFA's low overhead for misusing concatenation]{ 2022 \CFA's low overhead for misusing concatenation. 2023 Average time per iteration with one \lstinline{x += y} invocation (lower is better). 2024 Comparing \CFA (having implicit sharing activated) with STL, and comparing the \lstinline{+}-then-\lstinline{=} with the \lstinline{+=} append styles. 2025 The \lstinline{+=} results are repeated from \VRef[Figure]{fig:string-graph-peq-sharing}.} 2018 2026 \label{fig:string-graph-pta-sharing} 2019 2027 \end{figure} … … 2074 2082 % \includegraphics[width=\textwidth]{string-graph-pbv.png} 2075 2083 \begin{tabularx}{\linewidth}{>{\centering\arraybackslash}X >{\centering\arraybackslash}X} (a) & (b) \end{tabularx} 2076 \caption{Average time per iteration (lower is better) with one call to a function that takes a by-value string argument, comparing \CFA (having implicit sharing activated) with STL. 2077 (a) With \emph{Varying 1 and up} corpus construction, in which the STL-only benefit of SSO optimization occurs, in varying degrees, at all string sizes. 2078 (b) With \emph{Fixed-size} corpus construction, in which this benefit applies exactly to strings with length below 16.} 2084 \caption[Impact of \CC small-string optimization on experimental timings]{ 2085 Impact of \CC small-string optimization on experimental timings. 2086 Average time per iteration (lower is better) with one call to a function that takes a by-value string argument, comparing \CFA (having implicit sharing activated) with STL. 2087 (a) With \emph{Varying 1 and up} corpus construction, in which the STL-only benefit of SSO optimization occurs, in varying degrees, at all string sizes. 2088 (b) With \emph{Fixed-size} corpus construction, in which this benefit applies exactly to strings with length below 16.} 2079 2089 \label{fig:string-graph-pbv} 2080 2090 \end{figure} … … 2122 2132 \centering 2123 2133 \includegraphics{string-perf-alloc.pdf} 2124 \caption{Memory-allocation test's harness and its resulting pattern of memory usage under a bump-pointer-only scheme.} 2134 \caption[Memory-allocation test harness and its usage pattern]{ 2135 Memory-allocation test harness and its usage pattern. 2136 The pattern is shown early in a test run, when only bump-pointer allocation has occurred so far.} 2125 2137 \label{fig:string-perf-alloc} 2126 2138 \end{figure} … … 2154 2166 \includegraphics{plot-string-allocn.pdf} 2155 2167 \begin{tabularx}{\linewidth}{>{\centering\arraybackslash}X >{\centering\arraybackslash}X} (a) Vertical, Lower is better. \\ Horizontal, leftward is better. & (b) \hspace*{5pt} STL CFA \hspace*{20pt} STL \hspace*{10pt} CFA \hspace*{10pt} \end{tabularx} 2156 \caption{Space and time performance, under varying fraction-live targets, for the five string lengths shown, at \emph{Varying 16 and up} corpus construction.} 2168 \caption[String allocation space and time performance]{ 2169 String allocation space and time performance. 2170 The experiment varies the fraction-live target, at the five string lengths shown, under \emph{Varying 16 and up} corpus construction.} 2157 2171 \label{fig:string-graph-allocn} 2158 2172 \end{figure} -
doc/theses/mike_brooks_MMath/uw-ethesis.tex
r602cec4 r9c12dd0 93 93 \usepackage{multirow} 94 94 \usepackage[labelformat=simple,aboveskip=0pt,farskip=0pt,font=normalsize]{subfig} 95 \usepackage{caption} 96 \usepackage{etoolbox} 95 97 \renewcommand\thesubfigure{(\alph{subfigure})} 96 98 … … 122 124 \newcommand{\PAB}[1]{{\color{magenta}PAB: #1}} 123 125 \newcommand{\MLB}[1]{{\color{red}MLB: #1}} 126 127 % Mike's figure-framing look 128 129 \let\oldfigure\figure 130 \let\endoldfigure\endfigure 131 132 \renewenvironment{figure} 133 {% 134 \oldfigure 135 \centering 136 \rule{\linewidth}{0.4pt}\par\vskip4pt 137 } 138 {% 139 \endoldfigure 140 } 141 142 \DeclareCaptionFormat{ruled}{ 143 \rule{\linewidth}{0.4pt}\par 144 #1#2#3\par 145 \kern-\dp\strutbox 146 \rule{\linewidth}{0.4pt}% 147 } 148 \captionsetup[figure]{ 149 font=footnotesize, 150 labelfont=bf, 151 format=ruled 152 } 153 \captionsetup[subfigure]{ 154 format=plain, 155 font=normalsize, 156 labelfont=normalfont 157 } 158 159 % Mike forbids breaking "equation" style code blocks across pages 160 161 \AtBeginEnvironment{cfa}{% 162 \interlinepenalty=10000% 163 \clubpenalty=10000% 164 \widowpenalty=10000% 165 \displaywidowpenalty=10000% 166 } 167 168 124 169 125 170 % Hyperlinks make it very easy to navigate an electronic document.
Note:
See TracChangeset
for help on using the changeset viewer.