<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
      <title>2020 Week 2: Indigenous Programming — CCS Working Group 2020</title>
      <link>http://wg20.criticalcodestudies.com/index.php?p=/</link>
      <pubDate>Sat, 04 Apr 2026 22:49:50 +0000</pubDate>
          <description>2020 Week 2: Indigenous Programming — CCS Working Group 2020</description>
    <language>en</language>
    <atom:link href="http://wg20.criticalcodestudies.com/index.php?p=/categories/2020-week-2:-indigenous-programming/feed.rss" rel="self" type="application/rss+xml"/>
    <item>
        <title>Week 2: Cree#</title>
        <link>http://wg20.criticalcodestudies.com/index.php?p=/discussion/71/week-2-cree</link>
        <pubDate>Mon, 27 Jan 2020 18:54:21 +0000</pubDate>
        <category>2020 Week 2: Indigenous Programming</category>
        <dc:creator>joncorbett</dc:creator>
        <guid isPermaLink="false">71@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><img src="http://wg20.criticalcodestudies.com/uploads/editor/5f/3m7hl73f2qc3.jpg" alt="" title="" /><br />
A simple example of "Hello World" in the first iteration of Cree# with it's graphic output.</p>

<p>Programs in Cree# are told as stories, connecting with the Cree tradition; the graphical output can’t exist without the story that the code is telling. A Cree# program is also a multimedia story. In the above example, we have Raven (the Trickster), a character from Cree folklore who is as well known for his mischievousness as he is known for his role as a teacher and a guide. The program initializes when Raven flies on to the screen and lands on a tree and ends when the Raven flies away. But while sitting on the tree, Raven can perform a number of tasks. In the above example, the Raven says “Hello World” in Cree. But Raven can perform any number of activities, which occur randomly or are controlled through user interaction. It is in the tree-state that the actions of Raven can occur in any order, these activities are only dependant on the storyteller, as each storyteller that tells this story does so with slight modifications and changes in behaviours of Raven in order to emphasize a particular aspect of the story. The Cree# language favours this flexibility in the body of the story so that the generative and dynamic nature of the storyteller’s personality can be reflected in the code, the result is that though a similar (or same) story by different storytellers (i.e. programmers) will be noticeably different in their graphic output, even though they tell the same story.</p>

<p>For an example of what that looks like, here is a longer program in Cree#:</p>

<p><img src="http://wg20.criticalcodestudies.com/uploads/editor/01/4ub21a70cnd7.png" alt="" title="" /></p>

<pre><code>ᒥᔭᐦᑲᓯᑫ᙮
ᒪᒪᐁᐧᔭᐢ ᐃᐧᐦᐅᐃᐧᐣ ᐊᒐᑭᐯᐊᐧᓯᓇᐦᐃᑭᐧᐣ᙮ᑕᓂᓯ᙮
   ᐅᓯᐦᒋᑫᐤ ᑳᐦᑳᑭᐤ᙮
   ᐅᓯᐦᒋᑫᐤ ᒥᐢᑎᐠ᙮
▬
   ᑳᐦᑳᑭᐤ᙮ᐊᐧᐢᑭᑕᐢᑌᐤ᙮ᒥᐢᑎᐠ᙮
   ᐃ|| ᑲᐦᑲᑭᐘᐠ᙮ᐊᐧᐢᑭᑕᐢᑌᐤ᙮ᒥᐢᑎᐠ᙮
   | ᑳᐦᑳᑭᐤ᙮ᓯᐯᐧᐱᐦᐋᐤ᙮
   ᑳᐦᑳᑭᐤ ᐃ᙮ᓯᐯᐧᐱᐦᐋᐤ᙮
   ᑳᐦᑳᑭᐘᐠ᙮ᐅᔭᐱᐤ᙮
   ᑳᐦᑳᑭᐤ |᙮ᐃᑌᐧ᙮ᑕᓂᓯ ᒥᓯᐁᐧ ᐊᐢᑮᕀ᙮
   ᑳᐦᑳᑭᐤ᙮ᓇᓇᒫᐢᑲᒋᐤ᙮
   ᑳᐦᑳᑭᐤ᙮ᓯᐯᐧᐱᐦᐋᐤ᙮
   ᒥᔭᐦᑲᓯᑫ ᒥᐢᑎᐠ᙮
◯
</code></pre>

<p>Because I am still working on the language there is no way to test the above code, so to provide a bit of background to Cree#: its intent is to capture story elements and animate them on the screen. Before writing the code, there must be a series of images or animations created first (like sprites or animated gifs). These are placed in applicable library folders that can then be used in the program by "Creating" them. The verbs used must also be predetermined and unique.<br />
Now as far as the language itself goes the only punctuation in Cree is the full stop "᙮" which is used here to separate statements. The two glyphs used for "start" and "stop" are a horizontal bar "▬", and a circle "◯" respectively. Or in other words "open the circuit" and "close the circuit".</p>

<p>Commands follow basic sentence construction of [noun].[verb], and in some cases [noun].[verb][parameter], and in most cases as long as the program reads in those patterns the order of the instructions is not necessarily relevant. The only exception is smudge, which must be the first line of the program, can be the last line, and can also receive parameter(s) so [smudge] and [smudge][parameter].</p>

<p><strong>Here is a quick run through of the example code:</strong></p>

<p>In this example I start the program with a smudge, then declare two "noun" variables "Raven" and "Tree", open/start the "animation" on line 5. In the first two lines I first add one Raven (ᑳᐦᑳᑭᐤ) to the tree , the next line changes the singular Raven to an array of 5 Ravens (ᐃ|| ᑳᐦᑳᑭᐘᐠ) - note the suffix change from "ᐤ" to "ᐘᐠ", this changes the singular to the plural. And now when I reference the Raven its as an array I can use both singular and plural forms:<br />
    <strong>Line 8:</strong>    1 Raven leaves flying<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#42; <em>because I don't indicate which Raven, one of the array is chosen at random and removed.</em><br />
    <strong>Line 9:</strong>    Raven <a rel="nofollow" href="http://wg20.criticalcodestudies.com/index.php?p=/search&amp;Search=%233&amp;Mode=like">#3</a> leaves flying.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#42; <em>Note that placing a number at the end of the array variable indicates the index - see the end note about Cree numbers</em><br />
    <strong>Line 10:</strong> using the variable in its plural form ᑳᐦᑳᑭᐘᐠ means apply the action to the entire set<br />
    <strong>Line 11:</strong> Raven <a rel="nofollow" href="http://wg20.criticalcodestudies.com/index.php?p=/search&amp;Search=%231&amp;Mode=like">#1</a> speaks "Hello Turtle Island"<br />
    <strong>Line 12:</strong> Raven shivers with cold<br />
    <strong>Line 13:</strong> ᑳᐦᑳᑭᐤ᙮ᓯᐯᐧᐱᐦᐋᐤ᙮&nbsp;&nbsp;&nbsp;  <em>//Raven leaves flying</em><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#42; <em>this actually only removes 1 raven at random, to remove all I could smudge the singular ᑳᐦᑳᑭᐤ or all ᑳᐦᑳᑭᐘᐠ, or send them all flying ᑳᐦᑳᑭᐘᐠ᙮ᓯᐯᐧᐱᐦᐋᐤ᙮</em><br />
    <strong>Line 14:</strong> smudge the tree<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#42; <em>the smudge function is used to "cleanse" or reset anything in the program. calling ᙮ᓯᐯᐧᐱᐦᐋᐤ᙮ without any variable will just wipe everything</em></p>

<p><strong>A note on numbers</strong> - the glyphs used for Cree numbers are based on "sticks" with the vertical bar or pipe being 1, 2 pipes is 2, 3 pipes is the same as the syllabic ᐃ, 4 is then ᐃ| - an so on  much like roman numerals. There are glyphs for indicating 5, 10, and 20, and higher numbers have differing ways of representing them. An extended example - in many Indigenous numbering systems (not just Cree) the representation of 5 is a hand, and 20 is a person or body, because we are made of 20 digits (10 fingers and toes).</p>

<p><strong>Cree is also a morphemic language</strong>, so as long as you know the rules for combining syllables your programming can also be a series of syllable commands strung together. For example there is a prefix "mista" (ᒥᐢᑕ) that can be added to a word to make it a larger version of itself, like ᒥᐢᑕᑳᐦᑳᑭᐤ would be Big Raven, in Cree# this is also a way of adding so - ᒥᐢᑕᑳᐦᑳᑭᐤ (literally big ravens) would actually be a way of increasing my array of 5 Ravens to 6 Ravens. Likewise the suffix "osis" (ᐅᓯᐢ) makes it smaller. ᑳᐦᑳᑭᐤᐅᓯᐢ would therefore remove 1 from the array. And though I have yet to see a need for it, combining the two is still a legal statement so “mista-kahkakiw-osis” or  ᒥᐢᑕᑳᐦᑳᑭᐤᐅᓯᐢ, is the same as saying Raven = Raven + 1 - 1.</p>
]]>
        </description>
    </item>
    <item>
        <title>Week 2: Indigenous Programming (Main thread)</title>
        <link>http://wg20.criticalcodestudies.com/index.php?p=/discussion/70/week-2-indigenous-programming-main-thread</link>
        <pubDate>Mon, 27 Jan 2020 17:50:07 +0000</pubDate>
        <category>2020 Week 2: Indigenous Programming</category>
        <dc:creator>Temkin</dc:creator>
        <guid isPermaLink="false">70@/index.php?p=/discussions</guid>
        <description><![CDATA[<h1>Indigenous Programming</h1>

<h2>by Jon Corbett, Outi Laiti, Jason Edward Lewis, Daniel Temkin</h2>

<p>Our group will discuss Indigenous Programming; that is, code and programming languages built on spoken and written Indigenous languages.</p>

<p>With the wider support for Unicode, there has been an uptick in languages that challenge English's dominance. The most widely remarked-upon in the academic community is <a rel="nofollow" href="https://esoteric.codes/blog/interview-with-ramsey-nasser">قلب by Ramsey Nasser</a>, an Arabic LISP (also discussed in the 2014 working group). It showed not just that such a language is possible, but through the difficulties in making it functional, illustrated the Western biases of tools used by programmers. Another example is <a rel="nofollow" href="https://github.com/anoniscoding/yorlang/">Yorlang</a>, a Yoruba-based programming language by Karounwi Anu, a Nigerian developer. He uses English with his clients, but Yoruba with his friends, and wanted to be able to write code in the language they consider their own.</p>

<p>Outi Laiti's <a rel="nofollow" href="https://lauda.ulapland.fi/handle/10024/62624">thesis on Ethnoprogramming</a> gives insight into these works. She shows how programming's hardware and software levels rest on a terminology level, which itself rests on a cultural level. People who are excluded from the cultural level may find the other levels more challenging and be discouraged from programming. Alternately, they may be forced to embrace an English-based programming language, thus reinforcing a colonial language’s dominance locally. As Laiti says, "If we want to see a new generation of computer programmers who blur the borders of language, gender and culture, the ethnic side of computing needs to be researched and discussed."</p>

<p>However, what sets apart indigenous languages specifically can be difficult to define. Even the term Indigenous itself is debated. In her thesis, Laiti remarks on how the term has been criticized in defining people by their connection to colonial history. However, she provides an outline that might be helpful: "Indigenous people have their own language. They have a small population inside a dominant culture of the country. They still practice their cultural traditions and at last, some of them live in a territory that is, or used to be, theirs. They identify themselves as Indigenous people." Part of the issue arises from Western concepts of Indigeneity as analogous, that regardless of geographic locale being Indigenous merely means non-European/Western. But to say, for example, that Indigenous people in Papua New Guinea share the same or similar political and cultural concerns of the Inuit people would be false. However, there is a commonality that could be seen as a Pan-Indigenous lens and that is the socio-political and cultural perspectives of Indigenous people collectively contest the power of assimilationist nation-states and strongly self-advocate for community sovereignty and autonomy.</p>

<p>Beyond the question of bringing these languages into the text of code are how Indigenous culture might shape programming language design at a deeper level. <a rel="nofollow" href="index.php?p=/discussion/71/week-2-cree">Jon Corbett’s Cree# language</a>, which we will look at more deeply in a code critique thread, serves as an example. In Cree#, each program begins with smudging, a command that mirrors the ceremonial cleansing practice common to many North American Native people. This practice in life is intended to clear the mind, ears, eyes, mouth, heart, body and spirit. In his digital incorporation of this ceremony, the smudge command clears the buffer, resets the virtual machine to an initial state, and prepares it for a new activity. This connects the computer’s activities to living practices and by extension becomes braided and harmonious with everyday life.</p>

<p>We invite you to join us in exploring these and other issues in Indigenous computation, with these questions in mind:</p>

<ul>
<li><p>With the advancements in language technologies (unicode, etc), why is 90% of all computing done in English still? Is this changing? Why can’t we write code in our ancestral languages?</p></li>
<li><p>What is uniquely at stake for Indigenous communities vs. other communities that happen to speak languages other than English?</p></li>
<li><p>How do we get code to reflect Indigenous thinking beyond just using relevant keywords? How can we bring the cultural logic of the community into the language?</p></li>
</ul>
]]>
        </description>
    </item>
    <item>
        <title>Code Critique:  Mel, FIRESTARTER and Misreading Code</title>
        <link>http://wg20.criticalcodestudies.com/index.php?p=/discussion/77/code-critique-mel-firestarter-and-misreading-code</link>
        <pubDate>Sun, 02 Feb 2020 07:16:22 +0000</pubDate>
        <category>2020 Week 2: Indigenous Programming</category>
        <dc:creator>barry.rountree</dc:creator>
        <guid isPermaLink="false">77@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><strong>Title:</strong>  FIRESTARTER<br />
<strong>Author:</strong>  Daniel Hackenberg et al.<br />
<strong>Languages:</strong>  Python, C, x86-64 assembly<br />
<strong>Date:</strong> 2013-<br />
<strong>Git repo:</strong>  <a rel="nofollow" href="https://github.com/tud-zih-energy/FIRESTARTER" title="https://github.com/tud-zih-energy/FIRESTARTER">https://github.com/tud-zih-energy/FIRESTARTER</a><br />
<strong>Requirements:</strong>  Python and a C compiler (I have not confirmed the OSX or Windows versions; the code is native to Linux)</p>

<p><strong>TL;DR:</strong> Programmers (and processor architects) usually write with some intent in mind, and the resulting work can be measured against how closely it matches that intent.  Once the code escapes into the wild, it can be endlessly repurposed, and the original intents of the authors gradually fade away.  In this critique I'll be focusing on two cases where the meaning of repurposed code depends entirely on its externalities:  the text of the code becomes divorced from its meaning; the execution of the code is only needed to trigger the external effects.  Calling the process "misreading code" doesn't quite capture the sense of mischief involved, but it's close.</p>

<p><strong>The Story of Mel</strong></p>

<p><a rel="nofollow" href="https://en.wikipedia.org/wiki/Eric_S._Raymond" title="https://en.wikipedia.org/wiki/Eric_S._Raymond">Eric S. Raymond</a> continues to maintain the collection of hacker lore known as the <a rel="nofollow" href="http://catb.org/jargon/html/" title="catb.org/jargon/html/">Jargon File</a>.  It's origins go back to 1975, and along with hundreds of definitions of programmer slang of that era it also contains a few longer pieces that distill that culture.  <a rel="nofollow" href="http://catb.org/jargon/html/story-of-mel.html" title="catb.org/jargon/html/story-of-mel.html">The Story of Mel</a> (Ed Nather, 1983) describes the oldest description of code misreading I know of--there are certainly older ones out there--and manages to do so in (unintentional) free verse.  It begins:</p>

<blockquote><div>
  <p>A recent article devoted to the macho side of programming<br />
  made the bald and unvarnished statement:<br />
  <br />
   Real Programmers write in FORTRAN.<br />
  <br />
  Maybe they do now,<br />
      in this decadent era of<br />
      Lite beer, hand calculators, and “user-friendly” software<br />
      but back in the Good Old Days,<br />
      when the term “software” sounded funny<br />
      and Real Computers were made out of drums and vacuum tubes,<br />
      Real Programmers wrote in machine code.<br />
      Not FORTRAN.  Not RATFOR.  Not, even, assembly language.<br />
      Machine Code.<br />
      Raw, unadorned, inscrutable hexadecimal numbers.<br />
      Directly.</p>
</div></blockquote>

<p>The text goes on to describe Mel, a Real Programmer:</p>

<blockquote><div>
  <p>Mel never wrote time-delay loops, either,<br />
      even when the balky Flexowriter<br />
      required a delay between output characters to work right.<br />
      He just located instructions on the drum<br />
      so each successive one was just past the read head<br />
      when it was needed;<br />
      the drum had to execute another complete revolution<br />
      to find the next instruction.<br />
      He coined an unforgettable term for this procedure.<br />
      Although “optimum” is an absolute term,<br />
      like “unique”, it became common verbal practice<br />
      to make it relative:<br />
      “not quite optimum” or “less optimum”<br />
      or “not very optimum”.<br />
      Mel called the maximum time-delay locations<br />
      the “most pessimum”.</p>
</div></blockquote>

<p>That's a fun hacker story, but it gains a bit more meaning from a CCS perspective.  The drum manufacturer didn't intend for their equipment to be used as an impromptu delay loop.  Looking at the text of Mel's code would have revealed instructions carefully splattered across the entire drum, but nothing in the documentation of those instructions would have revealed why that would have been useful.  It's only after the externalities are accounted for that the code (and its layout) is revealed as an instance of genius.  We're not quite to the point where the code is <em>only</em> triggering externalities; for that, we turn to FIRESTARTER.  But first, a quick note each about processor architecture and vector instructions.</p>

<p><strong>A very brief primer on power and processor architecture</strong></p>

<p>Here's what you need to know about the recent evolution of processor architecture.  Keeping bits on or off requires very little energy.  Switching back and forth takes substantially more energy and generates a lot more heat.  Increasing the clock frequency of the processor makes the problem worse, as does increasing the number of bits.  Vector instructions use lots of bits (up to 512 per register compared with the usual 32 or 64), and each additional core has its own set of vector registers.  Doing lots of vector arithmetic a the highest clock frequency will destroy the processor in a handful of milliseconds.  Intel processors (and a few others) monitor how much power is being used and how much heat is being generated.  As the processor's limit is reached, the firmware will slow down the processor.  As electrical and thermal headroom is restored, the firmware speeds the processor back up.  This dithering of clock speeds can happen dozens of times per second and is effectively nondeterministic.</p>

<p><strong>Meet a vector instruction</strong></p>

<p>Say hello to <code>vfmadd231pd</code>, a <strong>f</strong>used <strong>m</strong>ultiply-<strong>add</strong> <strong>v</strong>ector instruction that, according to  <a rel="nofollow" href="https://software.intel.com/sites/default/files/managed/a4/60/325383-sdm-vol-2abcd.pdf" title="https://software.intel.com/sites/default/files/managed/a4/60/325383-sdm-vol-2abcd.pdf">Volume 2</a> of Intel's software development manual, will allow the programmer to:</p>

<blockquote><div>
  <p>[m]ultiply packed double-precision floating-point values from [the register] xmm2 and xmm3/mem, add to xmm1 and put result in xmm1 (page 5-120)</p>
</div></blockquote>

<p>From a CCS perspective, we can now say something about a bit of actual code, say....</p>

<pre><code>vfmadd231pd %%zmm5, %%zmm0, %%zmm4
</code></pre>

<p>There's even a <a rel="nofollow" href="https://en.wikipedia.org/wiki/Multiply%E2%80%93accumulate_operation#Fused_multiply%E2%80%93add" title="https://en.wikipedia.org/wiki/Multiply%E2%80%93accumulate_operation#Fused_multiply%E2%80%93add">Wikipedia page</a> devoted to this class of instructions (of course there is), where we learn that fused-multiply-accumulate instructions are useful for speeding up matrix multiplication, neural networks, blah blah blah.  In isolation, that's about as far as we can go.  So let's look at a bit of context.</p>

<p><strong>FIRESTARTER</strong></p>

<p>Here's a sliver of the hand-crafted assembly that comprises FIRESTARTER, a processor stress test created by another Real Programmer, Daniel Hackenberg at TU-Dresden.  The original code is written in Python, which generates C with inline assembly code (as there's no way of convincing a compiler that any pure-C code should result in this).  If you're not familar with assembly, no worries---just unfocus your eyes and look for patterns.  The more familiar you are with assembly, the stranger this code appears:  it looks very much like busywork.  The following code begins at line 587 of avx512_functions.c.</p>

<pre><code>        &quot;.align 64;&quot;     /* alignment in bytes */
        &quot;_work_loop_skl_xeonep_avx512_1t:&quot;
        /****************************************************************************************************
         decode 0                                 decode 1                                 decode 2             decode 3 */
        &quot;vmovapd %%zmm3, 64(%%r9);                vfmadd231pd %%zmm4, %%zmm0, %%zmm3;      shl $1, %%edi;       add %%r14, %%r9;    &quot; // RAM store
        &quot;vfmadd231pd %%zmm5, %%zmm0, %%zmm4;      vfmadd231pd %%zmm6, %%zmm1, %%zmm26;     shl $1, %%esi;       xor %%rdi, %%r13;   &quot; // REG ops only
        &quot;vfmadd231pd %%zmm6, %%zmm0, %%zmm5;      vbroadcastsd 64(%%rbx), %%zmm5;          shl $1, %%edx;       add %%r14, %%rbx;   &quot; // L1 packed single load
        &quot;vfmadd231pd %%zmm7, %%zmm0, %%zmm6;      vfmadd231pd %%zmm8, %%zmm1, %%zmm27;     shr $1, %%edi;       xor %%rdx, %%r13;   &quot; // REG ops only
        &quot;vfmadd231pd %%zmm8, %%zmm0, %%zmm7;      vfmadd231pd 64(%%rbx), %%zmm1, %%zmm7;   shr $1, %%esi;       add %%r14, %%rbx;   &quot; // L1 load
        &quot;vfmadd231pd %%zmm9, %%zmm0, %%zmm8;      vbroadcastsd 64(%%rbx), %%zmm8;          shr $1, %%edx;       add %%r14, %%rbx;   &quot; // L1 packed single load
        &quot;vfmadd231pd %%zmm10, %%zmm0, %%zmm9;     vfmadd231pd %%zmm11, %%zmm1, %%zmm28;    shl $1, %%edi;       xor %%rdx, %%r13;   &quot; // REG ops only
        &quot;vfmadd231pd %%zmm11, %%zmm0, %%zmm10;    vfmadd231pd 64(%%rcx), %%zmm1, %%zmm10;  shl $1, %%esi;       add %%r14, %%rcx;   &quot; // L2 load
        &quot;vfmadd231pd %%zmm12, %%zmm0, %%zmm11;    vfmadd231pd %%zmm13, %%zmm1, %%zmm29;    shl $1, %%edx;       xor %%rsi, %%r13;   &quot; // REG ops only
        &quot;vfmadd231pd %%zmm13, %%zmm0, %%zmm12;    vbroadcastsd 64(%%rbx), %%zmm12;         shr $1, %%edi; 
</code></pre>

<p>If you're a processor architect, what jumps out is how busy this processor is.  All four instruction decoders are in use, none of the instructions are conflicting with each other (meaning there are no stalls why the processor waits for results to complete or arrive), and.... it's all nonsense.</p>

<p>We're used to thinking of code in terms of symbolic language:  each variable and function is a symbol (representation, model, approximation, whatever term you like to use) of some other thing or action.  <strong>In the code above, FIRESTARTER has removed the symbolic meaning from code.</strong>  The instructions are being used exclusively to turn actual bits on and off as fast as possible, thus maximizing power and thermal load.  The actual mathematical results are overwritten and recalculated again and again---they don't have any meaning as math, they are just a vehicle for flipping bits.</p>

<p>(In terms of speech acts, FIRESTARTER performs a stream of phonetic and phatic acts (noises and words, respectively) which result in a perlocutionary act (the processor heats up) without reaching an illucutionary act (saying something understandable).  I'm far from an expert, though, so I'd be happy to hear other opinions.)</p>

<p><strong>Misreading code</strong></p>

<p>What Hackenberg has accomplished is a deliberate, careful misreading of code (more specifically, the instruction set architecture).  The intent of the processor architects at Intel was to create specialized instructions for matrix-related mathematics, but the fact that this intent exists does not preclude additional readings.  By taking into account the environment in which the intent was realized, Hackeberg can misread these instructions in order to control secondary effects like power consumption and heat generation.</p>

<p>This kind of misreading is most common in security programming (<a rel="nofollow" href="https://en.wikipedia.org/wiki/Spectre_(security_vulnerability)" title="https://en.wikipedia.org/wiki/Spectre_(security_vulnerability)">Spectre</a>/<a rel="nofollow" href="https://en.wikipedia.org/wiki/Meltdown_(security_vulnerability)" title="https://en.wikipedia.org/wiki/Meltdown_(security_vulnerability)">Meltdown</a>, <a rel="nofollow" href="https://en.wikipedia.org/wiki/Row_hammer" title="https://en.wikipedia.org/wiki/Row_hammer">Rowhammer</a>, <a rel="nofollow" href="https://plundervolt.com/" title="https://plundervolt.com/">Plundervolt</a>).  In each case, the externalities of the running code allow for privilege escalation.</p>

<p><strong>Misreading FIRESTARTER</strong></p>

<p>So far I've described FIRESTARTER as a program that maximizes the power and thermal response of a processor.  That was certainly the intent of the authors.  Part of the information it reports is how many iterations of its main loop have executed.  These are relatively small loops, so the count tends to be quite large.  Here is an example of the output from running on my i9-9900K workstation at home.  (Note that FIRESTARTER isn't optimized for this processor.)</p>

<p>My machine starts off at 28C with the water pump fans off.  Within a couple second after starting the program, the processor temperature has peaked at 99C and the pump fans are spinning up.  (The clock frequency will be dropping here.)  One those fans are up to speed the processor stays at a reasonable 65C until the run completes.  Here's a portion of what FIRESTARTER reports.</p>

<pre><code>performance report:

Thread 0: 118513178 iterations, tsc_delta: 216052936842
Thread 1: 117377514 iterations, tsc_delta: 215995301932
Thread 2: 118972471 iterations, tsc_delta: 215995301370
Thread 3: 116601636 iterations, tsc_delta: 215995301040
Thread 4: 117583482 iterations, tsc_delta: 215995300430
Thread 5: 118341824 iterations, tsc_delta: 215995300118
Thread 6: 116436094 iterations, tsc_delta: 215995298734
Thread 7: 116491650 iterations, tsc_delta: 215995298446
Thread 8: 120026957 iterations, tsc_delta: 215995299742
Thread 9: 119539717 iterations, tsc_delta: 215995297710
Thread 10: 118192628 iterations, tsc_delta: 215995296440
Thread 11: 116883387 iterations, tsc_delta: 215995296062
Thread 12: 117503542 iterations, tsc_delta: 215995294898
Thread 13: 117667925 iterations, tsc_delta: 215995294150
Thread 14: 119323114 iterations, tsc_delta: 215995293560
Thread 15: 116124503 iterations, tsc_delta: 215995291304

total iterations: 1885579622
runtime: 60.02 seconds (216052936842 cycles)

estimated floating point performance: 233.73 GFLOPS
estimated memory bandwidth*: 20.11 GB/s

* this estimate is highly unreliable if --function is used in order to select
  a function that is not optimized for your architecture, or if FIRESTARTER is
  executed on an unsupported architecture!
</code></pre>

<p>Note that the Time Stamp Counter difference (aka tsc_delta) is accurate well within 0.1%; Linux knows how to start and stop execution in the time requested (here, 60 seconds).</p>

<p>But also note that the number of iterations varies quite a bit more than that from thread to thread, from a max of 120026957 to a min of 116124503 iterations completed.</p>

<p>What happens if I run FIRESTARTER 350 times?  There is a fair amount of run-to-run variation, but it occurs within a band.</p>

<p>What happens if I run FIRESTARTER 350 on 4,200 ostensibly identical processors (the Quartz supercomputer at LLNL)?</p>

<p>Recall that I mentioned the clock frequency (and thus the number of iterations) depends on the thermal and power load, and that makes deterministic performance more or less impossible.  It turns out that the major source of that variation is the variation within the silicon of individual processors.  More efficient processors use less power to push bits down their wires, so they can run faster without getting as hot.  Less-efficient processors heat up more when running slowly and often can't reach theoretical maximum frequencies at all.</p>

<p>What does that look like?  Rather than show you all 4,200 processors, here's the best, worst and median one out of the bunch.</p>

<p><img src="http://wg20.criticalcodestudies.com/uploads/editor/it/kopp03xlk9vs.png" alt="" title="" /></p>

<p>Each box-and-whisker plot shows run-to-run variation (thanks, Linux).  There are two hyperthreads per core; there is both core-to-core and hyperthread-to-hyperthread variation (hyperthread 0 is consistently a bit worse than hyperthread 1, and core 12 is consistently better than core 13).</p>

<p>But the processor-to-processor variation dominates.  There are the same model and stepping, yet there's an easy 10% difference between the median of the best and the median of the worst processor.  (This is known as the "silicon lottery.")</p>

<p>Ok, so what?</p>

<p>Using a bit of undergrad statistics (not shown here), you could run FIRESTARTER for a minute on a random processor and, despite all the variation going on, I'd be able to identify which processor you chose.</p>

<p><em>In short, I have misread FIRESTARTER to get to the externalities that provide a unique signature for each of 4,200  processors.</em>  The FIRESTARTER authors didn't anticipate this.  By misreading what they've done, I've gained access to physical information we didn't have before.  And <em>that</em> leads to some really gnarly security issues that I'll leave for another time.</p>

<p><strong>Why this matters to CCS</strong></p>

<p>When I was a wee Theater undergrad I had it drilled into my head how the performance consisted of not only actors performing, but the audience and their expectations, the architecture of the theater, subtleties of lighting, sound, costume, gesture, facial expression.... and we have vocabulary and frameworks to discuss how those choices will affect what the audiences takes home.  We don't ask whether we can or should misread Shakespeare---that's done as a matter of course.  We can do things like stage the first act of Strinberg's <em>Dream Play</em> in the parking lot of an abandoned funeral home in the middle of San Diego where the actors are all mute and their lines have been pre-recorded and are played over loudspeakers (thank you, Sledgehammer Theater).  The kind of curiosity and creativity required for that staging feels similar to what's needed for Mel spattering instructions all over his drum memory or Daniel Hackenberg jacking up processor power by executing nonsense fused-multiply-add instructions.  We know how to teach those skills to theater students.  We're nowhere close to doing that for CS students.</p>

<p>As a computer scientist, I don't have either the vocabulary or frameworks to explain how I go about my misreadings (and I've built my career on them).  I would like to give my students and interns an apparatus (or several) that allows them to think about code like their colleagues in the theater department think about performance.  I suppose you could say that I want them to read code critically.  I'm hoping that CCS can eventually provide that scaffolding.</p>

<p><strong>Questions for Discussion</strong></p>

<ol>
<li>You made it this far?  You badass!</li>
<li>Where in the above did your eyes begin to glaze over?</li>
<li>What are your experiences with deliberate misreading of code?</li>
<li>How do you teach your students how to be creative, and how would you apply that to teaching CS students?</li>
</ol>
]]>
        </description>
    </item>
   <language>en</language>
   </channel>
</rss>
