Robust Physical Computation 491/591

Table of Contents

Class Notes

2009-08-24 Mon

2009-08-31 Mon

reading discussion

moles not tens

robust for machines, but no good math for analysis
study of automata
would be more like thermodynamics, enough unreliable digital components that they'd be treated statistically

Transfer from digital to analytic

  1. how complicated are the nodes
  2. how many nodes
  3. how do they interact


  • what is an error in a system (maybe natural) where the goal is continuity rather than to output the correct answer
  • how do programmers handle errors, if you're passed an impossible input then what do you do?
    • raise exception
    • try to translate the input to make it usable (mod, safest, etc…)

in actuality these chips will blink out error codes, flags can be used to control what happens after the blink (rebirth, code-from-neighbor, etc…)


pin out


2009-09-14 Mon

ixm design goals

  • fungibility, uniformity, interchangeability
    • avoids privileges points in space/time
  • bidirectional scalability
    • make appropriate use of of as much/little hardware as is available
  • respond to stresses
  • better default behaviors than doing nothing


(email earlier this week?)

  • in time synchronization
  • in space
    • where neighbors
    • what shape is my connection
    • nearest source of 'g' packets

networking example

addressing options

  • unique address (ip address)
    • carries routing information (and no other information on addressee)
  • relative address (NNWSSSE…)
  • routing based on need. Once you have set of issues that are universally agreed upon, it is possible to address by most recent citing of that goal…
    • services can broadcast degrading signals to their neighbors

2D geometry

  • each board is it's own origin
  • address it's neighbors as

2009-09-21 Mon

  • new power supplies available tomorrow ( 2009-09-22 Tue) night
  • Wednesday we can re-make our power supplies

hardwariness 1 (power supply)

  • power supplies may be killing our chips
  • power supplies are switch mode meaning the voltage can spike when the load changes
  • we're now switching down to a 9V supply (which should be inside our tolerance even when it spikes)

hardwariness 2 (CDD oddities)

  • it will occasionally space out and lose mapping
  • resetting (CDDing boards will randomly reset)
    general purpose input/output pin
    in the API, can be used to set GPIOs to be either inputs or outputs. by default all pins are input pins (burns no power)
    floating gate
    when an input is open, meaning it is just tasting the air in it's vicinity, like a radio antenna
    pullup resistor
    connected to a floating gate in order to provide some constant voltage and keep the default value set to high. these shouldn't be too strong or they will turn into a short circuit when the floating pin is connected to ground (should be just enough power to overcome the ambient noise)
    pulldown resistor
    opposite of the above
    series resistor
    a fatter resister which still allows signals to flow, but keeps people from short-circuiting themselves when they say HIGH while saying LOW

    Arduino API

    • output pin
      pinMode(somePin, OUTPUT);    // make GPIO an output
      digitalWrite(somePin, HIGH); // set it's value to high
      digitalWrite(somePin, LOW);  // set it's value to low
    • input pin
      pinMode(somePin, INPUT);     // make GPIO an output
      digitalWrite(somePin, HIGH); // make GPIO pullup resistor
      digitalWrite(somePin, LOW);  // *disables* GPIO pullup resistor

    how CDD determines if boards are inverted

    • using D1, D2, D3, D0
    • to break symmetry and allow these GPIOs to have one talking while the other listens we put each into a long listen, short talk
    • if we listen through a whole period w/no pulse, then we wait for a random interval
    • once notices the single falling edge it aligns with it's neighbor so they can hear each other
    • CDD uses the alarm system to sample it's neighbors every couple of micro-seconds
      • this means CDD never grabs the CPU
      • this means that if you are packet spamming you can get CDD out of sync restarting the whole process

    Electrical problem

    • if one GPIO says HIGH, while another says LOW to each other, then you will short-circuit
    • we are saved from this issue by the series resister
    • however when something like CDD causes too many of these short circuits the drain on the system could be lowering the circuit to the point that boards were thinking that they had lost power and would then reset

    CDD Functions

    connects to and recognizes position of the neighbor

Dave's tic-tac-toe

see lecture notes and sttt2/sketch.pde code

very good for improving c++

  • uses structures to track the status of neighborhood
  • uses alarms to periodically check the world model for global state changes (winner or draw)
  • uses per-neighbor packet enums to track (and discard) repeat packets from a neighbor

2009-09-28 Mon

  • be careful when handling the boards (static electricity)

software update (timers)

4 hardware timers (counters)

  • 32 bit
  • can tell it what to do at different counts
  • timers 1-3 are for our use

timer parameters

  1. microseconds per tic
  2. ticks per lap (API adds a lap counter)
  3. bool to start immediately
Timer1.setSplitHandler(3, 100, onRed); // with the third split timer call `onRed' at count 100
// from inside the split handler can call

hardware interrupts on lap, so our lapHandler code is called in interrupt mode, meaning nothing else is happening

  • make it fast
  • make it short

[robust] bridge collapse

  • galloping girdy

what system level properties move the bar from a system that tends to being more robust or more efficient

2009-10-05 Mon


second board death was same as the first (fried processor)

software update 0.9.7

  • SFBPower
    powerOut(face, bool)
    existing turn faces off
    voltage available at a face
    voltage available in the board
  • new baudrate switch, 500000 is the highest that they will negotiate for, next stop down is 230400
    • note that bits-per-sec is roughly baud-rate / 10

robustness Mathew Domain Name System (DNS)

layered hierarchy with caching at every level

2009-10-12 Mon

wiki now lives on (see the link from the class web page)

robustness (Jeff)

centipedes are scary

2009-10-19 Mon

voltage calibration
we will be calibrating our boards today

new in software update 0.9.7

sprintf type functionality

  • can create a buffer and then print to it using the face-print functions (using makePacketPrinter)
  • packets printed to this buffer will then have a packet source
  • could then trigger resources on these temp/fake packets
  • see the lecture notes for example usage
  • gp4ixm this could be useful for incorporating new individuals in a uniform manner

robustness spotlight (Taylor)

seeds are more robust than spores

2009-10-26 Mon

  • soon we will receive the mid-semester "your class progress/performance" emails
  • we are going to continue to calibrate boards and try to put together an in-class "uphill" sketch
  • sfb-0.9.9 release, featuring a nicer packetScanf

collector through new exposed abstract face

to really get full on printf functionality to the collector script it would be best to implement a new "face printer", with remove first char and append end-of-packet implemented, and the users can use any print function passing in the abstract face number.

2009-11-02 Mon

0.9.10 code release

  • packet equality (just on contents)
  • 'log' functions default to all faces
  • packetRead to read packets from buffers
  • getCurrentStackSpace
  • getMinimumStackSpace
  • will also remove the need to drop the "baud-rate 5000" option when compiling on the mac

2009-11-09 Mon

software update 0.9.11 in progress

  • isPinMode
  • isPowerOut
  • SFBSerial::end
    • can be used to turn off a face so it won't be "ready"
  • SFBSerial::setPreferredBaudCode
  • pprintf/packetScanf variable width support: "%*d", "%*x"

NOTE: only call delay from inside of the main loop

subpacket support with…

u8 * subpacket;
packetScanf(packet, "%P", &subpacket);

2009-11-16 Mon

  • the ARM architecture consists of a bunch of addresses which point to defined ARM functions, so in the interrupt table the address of 0 points to the reboot function
    • calling a null function pointer reboots the board
    • so if you write to a null pointer then you are writing to the interrupt table (just for that one session)
  • about 32k in ram
  • it takes about 400 ms to erase a sector of flash
  • interrupts are disabled during writes to flash because many use code located in flash which is inaccessible during a write
  • Jeff's code is on the wiki
  • ensure I'm not delaying from inside of alarms

2009-11-23 Mon

what is a hardware "data abort"? basically a segfault

2009-11-30 Mon

  • 0.9.12 release tonight
    • now with non-delay blinking lights, granularity of 12-2032 ms
      • QLED.on(BODYRGBBLUEPIN, 250)
      •, 250)
      • setup with QLED.begin();
      • QLED.whenIdle(BODY_RGB_RED_PIN, QLED_IDLE_OFF) mean that we only have to schedule the on events and will turn off when the queue expires
      • see lecture notes for details
  • ixm boards at colloquia this Friday

2009-12-07 Mon

  • neural spike train analog and digital, particle and wave
  • Intel single-chip Cloud Chip has 48 cores in 24 tiles
  • Taylor
    • how does he send strings of digits back through the collector?
  • weekly research meeting re:boards and this would be for like ~1 credit
  • possibility to grab cheaper boards
  • Ackley super-deal of keeping 1 board and connectors
  • email ackley about participation
  • final is Wed. 3-5
  • Sunday 12-8

2009-12-16 Wed

Reading Notes

The General And Logical Theory Of Automata

Notes on: The General And Logical Theory Of Automata

Investigation of the points of similarity and difference between automata and organisms, with respect to their approaches to the processing of information and also to their own reproduction.

Preliminary considerations

Dichotomy of the problem: in analyzing complex organisms that can be broken into regular parts there are two parts to the analysis

  1. the analysis of the parts (more physical/chemical/biological)
  2. the analysis of the combination of idealized notions of the parts (more theoretical)

The Axiomatic Procedure: black box the elements and proceed with an idealized functional analysis of their interactions

Significant orders of magnitude: to reach the numbers of these parts as present in natural systems, like the human body (1010 to 1018), we will need computers

Relevant Traits of Computing Machines

Typical Operations: 109 steps in sequence even for fairly simple multiplication

Precision and Reliability: Each of these billions of steps actually matters for the end result. In most other situations when there are that many steps each step only affects the result in proportion to it's fraction over the number of steps. This is not true in computers.

All automata are either analog or digital

Analogy Principle: Those which exploit physical analogies of the concepts/information being computed (rotating discs or electric currents to represent numbers). In any case the important factor is the signal to noise ratio.

Digital Principle: Representing numbers as aggregates of digits. As long as each component functions inside it's tolerance then precision is absolute. Noise in digital machines is the result of rounding errors.

The Role of the Digital Procedure in Reducing the Noise Level: In a digital machine it is possible to arbitrarily reduce noise (by adding decimal places).

Comparison between digital machines and living organisms

Mixed Character of Living Organisms: Neurons for instance have many analog inputs but ultimately the firing is digital. For now only considering the digital component of living systems.

Affixed Character of each element: While there are no real all or none organs in our experience, we can treat organs in this manner when this is how they operate under normal conditions.

The Concept of a Switching: Responds to a set of stimuli by an energetically independent response.

Comparison of the Size of Large Computing Machine and Organisms: 104 switching organs seems to be the proper size for a computing machine. ~1010 computing organs (neurons) seems to be the proper size for a nervous system. Why is the nervous system so much larger than any existing computing machines?

Determination of the Significant Ratio of Sizes for the Elements: The size and energy dispensation of a vacuum tube to a neuron are both roughly 1-billion:1. The speed of actuation of a vacuum tube to neuron is something like 1:2000. Discussion of linear size differences of 1:1000 resulting in the massive volume/energy differences.

Technological Interpretation of these Reasons: Our size/energy losses explained by the self healing nature of natural materials as compared to the brittle nature of man-made artifacts.

The Future Logical Theory of Automata

Further Discussion of Factors Limiting Size of Artificial Automata: In addition to the large size and limited reliability of artificial automata there is an intellectual distinction.

Limitation Due to the Lack of a Logical Theory of Automata: We are very far from a proper Mathematical/Logical theory of automata. Formal logic is one of the most refractory parts of mathematics. This is because it is cut off from the most successful parts of mathematics continuous real analysis. Since automata are discrete and not continuous they will have to be combinatorial and not analytical.

Probable Characteristics of such a Study: Rather than being concerned only with the finite/infinite distinction (as is the case in much of modern logic) automata are concerned with the size of finite (large sizes being as bad as infinite). Two big differences…

  1. length of reasoning chains will matter
  2. each operation will have to admit some non-zero probability of error – leading to a much more analytic study than modern logic

These issues will bring theory of automata much closer to thermodynamics than modern logic as from Boltzmann. The part of physics which comes nearest to manipulating and measuring information. We will have to move towards such an analytic theory for automata.

Effect of the lack of a Logical Theory of Automata on the Procedure in Dealing with Errors: In a living organism errors are detected and handled (from the inside). In an automata errors are

  1. detected as quickly and automatically as possible (inside or outside)
  2. an attempt is made to isolate the faulty component (outside)
  3. faulty component is replaced or corrected (outside)

In nature the effects of errors are unimportant, and the correctives are applied lazily if at all. In automatons errors are detected and fixed as quickly as possible, so errors are made as conspicuous as possible.

The Single Error Principle: An effect of this is the assumption that there is at most one error at a time. This motivates the catastrophic errors approach, in that it makes it more likely that we will detect the first error before the second.

Principles of Digitization

Digitization of Continuous Quantities: in the nervous systems we transmit digital signals at a frequency proportional to the continuous quantity. very different from a decimal expansion of the continuous quantity. the frequency method (unlike decimal expansion) is robust to failures.

You can increase the safety from error by a reduction of the efficiency of the notation, or, to say it positively, by allowing redundancy of notation. – Von Neumann

it is curious that nature doesn't use decimal expansion given that it is certainly willing to deal with much more complex systems…

The McCulloch-Pitts Theory of Formal Neural Networks: an axiomatic construction of formal neural networks. They proved that anything which can be unambiguously put into words can be realized within a finite neural network.

Interpretations of This Result: it seems that for complicated behaviors (e.g. the process of visual analogy) the simplest complete description in words is the physical description of the neurons themselves.

still Von Neumann believes that a new breed of logic is required for the study of complicated automata and the nervous system (even if this logic doesn't look like ordinary logic).

The Concept of Complication: Self-Reproduction (Turing maGenes)

The Concept of Complication: when an automata performs an act it must somehow be less complicated than the automata itself.

if A creates B then A must include a complete specification for B as well as means of production, thus B must be less than A in some real way.

Turing's Theory of Computing Automata: good description of a universal automaton.

The Main Result of the Turing Theory: a universal automaton could then if furnished with a description of any specific automaton be able to imitate it precisely.

what about an automata which creates any other automata.

Given the following components

  • a is an automata which when supplied with the description of any other automata can construct said (given the requisite elementary pieces)
  • b is an automata which can copy any instruction given to it
  • c controls a and b in the following way. given an instruction, c
    1. has a create an automata
    2. has b copy the instruction
    3. places the copy into the automata
    4. sets the automata lose in the world
  • d is the aggregate of a, b, and c
  • let Id be the instruction which when passed to a generates d
  • pass Id to d and call the result e

e is self-reproductive and the instruction Id is very similar to a gene. In fact the entire aggregate is similar to genes and enzymes.

d above could be enhanced with the instructions to build both itself and another automata f. This would also be a stable scheme (generating infinite copies of d and f), and it would have the nice result where mutations in the f instruction could lead to changes in f while keeping the reproduction mechanism d in tact.


  • q: how can a machine foresee and guard against the infinity of possible errors.
  • a: you need not gaurd against each one, general guards exist. for example a metal plate can guard against any variety of novel projectile devices

Fireflies and the Inevitability of Sync

given an oscillator whose timing adjusts automatically in response to other synchronicity will always occur

synchronization seems to be the norm in biological, chemical, and physical systems (e.g. menstrual cycles in groups of collocated women, lasers, and the mooon/tides respectively).

example: the heart's natural pacemaker ~10,000 cells called the sinoatrial node, when isolated in a petri dish their voltage rises and falls regularly

modeling the heart with discharging registers with curves which level out at the top. when one discharges it boosts the others. they sync.

developed a relatively simple mathematical proof that in such systems sync will occur (or rather the possibility of sync not occurring is infinitely impossible)


how to pass a function as an argument

can we get random numbers?

yes the Arduino has three random number functions

  • randomseed(seed)
  • random(max)
  • random(min, max)

does a x-mach know where it has neighbors?

yes it is possible to iterate through the neighbors (read API)

can you recommend any reading/literature?

how would one implement a file system over many X-machs?

The goal being to fairly reliably maintain copies of data with a fairly high turnover of x-machs.


Maybe something like…


  • levels of reliability: but probably everything would be set to the highest level. nobody wants to lose any file.
  • each file everywhere: store parts of every file on every X-mach, but maybe not have the whole file anywhere. This somehow seems like the most natural approach. This way even with machine loss you wouldn't lose all of any file, maybe just parts. Although it's not clear that part of a file is of any use.
    • reconstruction maybe something like raid where it uses a parity bit so that if any one part goes down then the rest, plus parity can be used to put it back up.
    • if some x-machs are vital, then they can just be duplicated in their entirety… with enough of them you will be able to trust that you won't lose anything

is there a synchronous call/response mechanism?

it could be implemented

are there any examples of non-evolved robust distributed computation?

threading and preemption

threading is not really possible inside of a single chip

when messages come in hardware interrupts put the bytes into big buffers, but these buffers will not be accessed by the main program until the main loop cycles, or delay is called

do I have active neighbors, and which ones are they

call in ready on the face to see if it can be used

for (u32 f = NORTH; f <= WEST; ++f) {
  if (Faces[f].ready()) { ... }

Ideas / Topics

(robustness idea) parasite populations

actor networks (as supporting virtual machine)

can be used to build up something below a virtual machine, targeting functional languages

neural nets

could put x many on a single x-mach and then have connections between x-machs as well.

ants as a metaphor for intelligent processing


  • are the ixms the ants or the landscape?
  • are all natural systems like this essentially equilibrium maintaining feedback loops (priorities of any colonies/bees don't really change over time)


  • ants collecting files
  • ants fighting off hostile ixm board add-ons
  • ants as units of processing?
    • regulation-of-foraging-activities
    • task-allocation-in-ant-colonies
      • decisions on the allocation of resources aren't made by a central unit with global knowledge but are made by individuals with local knowledge.
      • relevant aspects of local interaction patterns are
        • rate of interaction (frequency)
        • interval between interaction
        • total number of interactions
      • foraging bees are more likely to actively forage when they get back and they immediately meet an unloader bee

Distributed Hash Tables

DHT attacks

malicious nodes assume a large number of identities
malicious nodes re-route traffic from honest nodes to themselves

robust DHTs

one issue with DHTs is, is there a provable way to make them robust if nodes disappear w/o notice.


  • if nodes disappear then
    • we lose the data they contained
    • nearby nodes can no longer decide what is theirs and what isn't


duplicate all information
robust to loss of any 1 node

pitch for frequency/analog communication

ixm boards / code

ruby library for interfacing with the IXM

this just looks like a wrapper for the sfbprog command line

my serial numbers

  • 0134
  • 0068
  • 0149

packet types

everything but capital letters are reserved for sketches

R packet

see today's lecture notes 2009-09-14 Mon

pins reserved for GPIO

four of the pins can be used as general purpose I/O (GPIO)

can be set as output/input and set/read as either on/off

relevant for detecting if chips are connected inverted

API code stuff

checksum on packets

end the pprintf with %, so

pprintf("t stuff %d %\n", val);

if there's an error then packetScanf won't match the percent your handler and it's up to you to handle the error

if(packetScanf("t stuff %d %", %val) != 10)


can be used to force a reboot every so often if the main root doesn't complete


this is the reboot


when hit an error, try to report it to the northface
if you get a blink code (breaks) it will kill the sketch so the next is loaded as normal from a neighbor