Tierra Tutorial

Download Report

Transcript Tierra Tutorial

Tierra Tutorial
Tom Ray - ATR, OU
Joseph Hart - ATR
GECCO-99
July 13-17, 1999
Orlando, Florida
Web Pages
 This presentation:
http://www.hip.atr.co.jp/~ray/pubs/pubs.html
http://www.hip.atr.co.jp/~ray/pubs/tutorial/Tutorial.ppt
 Tierra Home Page:
http://www.hip.atr.co.jp/~ray/tierra/tierra.html
 Tom Ray: [email protected]
http://www.hip.atr.co.jp/~ray/
 Joseph Hart: [email protected]
http://www.hip.atr.co.jp/~jhart/
Tierra Tutorial Outline








Concept - Motivation
The Virtual Machine
Using Tierra
Tools
The Ancestor
Results
Network Tierra
Future Directions
Tierra Tutorial Outline








Concept - Motivation
The Virtual Machine
Using Tierra
Tools
The Ancestor
Results
Network Tierra
Future Directions
Concept - Motivation
 Biological - original motivations
 Computational - later motivations
Concept - Motivation
 Biological - original motivations
 Computational - later motivations
Biological - original motivations
 Life on Earth is a single instance of
evolution (sample size of one)
 Create and observe a new and independent
instance of evolution
 Broaden our perspective of evolution (and
therefore of life) by increasing the sample
size (to more than one)
 Observe the properties of evolution in a new
and radically different medium (digital
rather than organic)
Evolution in the Organic Medium
 Evolution by natural selection on Earth has
organized the form and process of matter
and energy from the molecular level up
through the ecosystem level
~ 12 Orders of Magnitude
 The organization generated by evolution
spans about twelve orders of magnitude of
scale
 from the molecular to the ecosystem level
Each Level of Scale
 At each level of scale, there are richly
organized structures and processes
Hierarchical
 At each level of scale, the structures are
built hierarchically from the structures of
the level below
Built by Evolution
 All of this rich hierarchically organized
structure through twelve orders of
magnitude of scale,
 was built by the process of evolution by
natural selection embedded in the medium
of carbon chemistry.
Evolution in Other Contexts
 Life on Earth is the product of evolution by
natural selection operating in the medium of
carbon chemistry.
 However, in theory, the process of evolution
is neither limited to occurring on the Earth,
nor in carbon chemistry.
 Just as it may occur on other planets, it may
also operate in other media, such as the
medium of digital computation.
 And just as evolution on other planets is not
a model of life on Earth, nor is natural
evolution in the digital medium.
A Different Physics
 The digital medium is not a material
medium.
 It is a logical, informational medium.
 The digital medium does not exhibit the
laws of thermodynamics.
 Cyberspace is not a 3D Euclidean space.
 We are not constrained by the same laws of
physics, unless we impose them upon
ourselves.
Evolution Sees the Medium
 Evolutions sees the medium that it is
embedded in.
 In the organic medium, evolutions sees the
laws of conventional chemistry and physics.
 In the digital medium, evolution sees the
logic of the machine code, the rules of the
operating system, and the structure of
memory,
 as a surrogate physics and chemistry.
The Hardware is Invisible
 Embedded within the digital medium,
evolution can not see the hardware from
which the computer is constructed.
 Mechanical switches, vacuum tubes,
transistors, integrated circuits,
 all look the same to evolution if they
implement the same logic.
 Evolution only sees the logic.
Digital Time
 A computer built from integrated circuits
will be faster than one built from
mechanical switches.
 But the unit of time is the CPU clock cycle.
 From within the digital medium, evolution
can not tell if it is a second or a nanosecond
Topology of Cyberspace
 Cyberspace is not a Euclidean space.
 There is no obvious distance metric.
 How can we analyze the topology?
Time is Distance?
 The time that it takes to move data between
two points might serve as a distance metric.
 Within the (flat) RAM memory of a single
computer, all pairs of points are equidistant.
 Points in cache memory are closer together.
 Points on disk memory are farther apart.
 Distances between machines depend on
network topology and traffic conditions.
Concept - Motivation
 Biological - original motivations
 Computational - later motivations
Computational - later motivations
 Digital evolution produced dramatic
optimizations of machine code
 Evolution might be used to:




Optimize useful software
Create new software
Create software of greater complexity than
human programmers can write
Find the true nature of the digital medium by
“becoming one” with it, the Zen of digital life
Thought Experiment
 We are all robots
 Our bodies are made of metal and our
brains of silicon chips
 We have no experience or knowledge of
carbon based life,
 not even in our science fiction
This Stuff?
 Now one of us robots comes to our
academic gathering with a flask of methane,
ammonia, hydrogen, water, and some
dissolved minerals.
 The robot asks: “Do you suppose we could
build a computer from this stuff?”
The Engineers Solution
 The engineers among us might propose
nano-molecular devices with fullerene
switches, or even DNA-like computers.
 But I am sure that they would never think of
neurons.
 Neurons are astronomically large structures
compared to the molecules we are starting
with
The Carbon Medium
 Faced with the raw medium of carbon
chemistry, and no knowledge of organic
life,
 we would never think of brains built of
neurons,
 supported by circulatory and digestive
systems,
 in bodies with limbs for mobility,
 bodies which can only exist in the context
of the ecological community that feeds
them.
The Digital Medium
 We are in a similar position today as we
face the raw medium of digital computation
and communications.
 The preconceptions and limited
imaginations deriving from our organiconly experience of life and intelligence,
 make it difficult for us to understand the
nature of this new medium, and the forms of
life and intelligence that might inhabit it
Going Beyond?
 How can we go beyond our conceptual
limits,
 find the natural form of intelligent processes
in the digital medium,
 and work with the medium to bring it to its
full potential,
 rather than just imposing the world we
know upon it by forcing it to run a
simulation of our physics, chemistry, and
biology?
Evolution
 In the carbon medium it was evolution that
explored the possibilities inherent in the
medium, and created the human mind.
 Evolution listens to the medium that it is
embedded in.
 It has the advantage of being mindless,
 and therefore devoid of preconceptions,
 and not limited by imagination.
Digital Nature
 I propose the creation of a digital nature.
 A system of wildlife reserves in cyberspace
 in the interstices between human
colonizations,
 feeding off of unused CPU-cycles
 and permitted a share of our bandwidth
Spontaneous Digital Evolution
 This would be a place where evolution can
spontaneously generate complex
information processes,
 free from the demands of human engineers
and market analysts telling it what the target
applications are.
 A place for a digital Cambrian explosion of
diversity and complexity
Prospecting Digital Nature
 Digital naturalists can then explore this
cyber-nature in search of applications for
the products of digital evolution,
 in the same way that our ancestors found
applications among the products of organic
nature, such as: rice, wheat, corn, chickens,
cows, pharmaceuticals, silk, mahogany.
 But, of course, the applications that we
might find in the living digital world would
not be material, they would be information
processes.
The Emergence of a “Natural”
Artificial Intelligence




It is possible that out of this digital nature,
there might emerge a digital intelligence,
truly rooted in the nature of the medium,
rather than brutishly copied and
downloaded from organic nature.
 It would be a fundamentally alien
intelligence,
 but one which would complement rather
than duplicate our talents and abilities
Tierra Tutorial Outline








Concept - Motivation
The Virtual Machine
Using Tierra
Tools
The Ancestor
Results
Network Tierra
Future Directions
The Virtual Machine
 The virtual machine was named “Tierra”,
Spanish for “Earth”
 Originally, the only design criteria was that
it should be able to support the evolution of
self-replicating machine code
 It may have been the first Von Neuman
computer designed for evolvability
Conditions for Darwinian Evolution




Self-replicating entities
Turn-over of generations
Genetic inheritance
Genetic variation
The Virtual Machine





Darwinian Operating System
Soup (RAM)
CPU Structure
Instruction Set
Genetic Operations
The Virtual Machine





Darwinian Operating System
Soup (RAM)
CPU Structure
Instruction Set
Genetic Operations
Darwinian Operating System
 Manages a population of processes in a
Darwinian fashion
 Includes the following elements:





Slicer
Reaper
Memory Allocation
Genetic Operations
Disturbances
Darwinian Operating System





Slicer
Reaper
Memory Allocation
Genetic Operations
Disturbances
Slicer
 The Slicer is a circular queue of processes
 The Slicer allocates slices of CPU time to
each process in the queue, in succession
 The size of the time slice determines the
number of machine instructions that a
process will execute in its turn
 The slice size may be fixed, or a uniform
random variate, or dependent on the size of
the process
 When a new process is born, it enters the
queue behind its mother
Darwinian Operating System





Slicer
Reaper
Memory Allocation
Genetic Operations
Disturbances
Reaper
 The Reaper is a linear queue of processes
 At birth, processes enter the bottom of the
queue
 When the memory is full, the Reaper kills
processes at the top of the queue
 The Reaper removes the dead process from
both the Reaper and the Slicer queues
 Memory allocated to the dead process is
freed
 The code of the dead process is not
removed from the soup
Reaper (continued)
 In the first approximation, the oldest
process dies first
 The Reaper may kill:


The process at the top of the queue
A process randomly selected from the top X%
of the queue (death may be partially or fully
random)
 When a process generates an error, it moves
one position up the Reaper queue
 Successful execution of divide or mal
moves the process one position down
Darwinian Operating System





Slicer
Reaper
Memory Allocation
Genetic Operations
Disturbances
Memory Allocation
 Processes are born with a block of memory
 The memory may have read, write, or
execute protection
 Default is only write protection, such that
other processes may not write to the block
 Processes may request a second memory
block, but no more
 A third memory request re-allocates the
second block (data not copied)
Memory Allocator (continued)
 The memory allocator provides several
options for placing the memory block:





first fit
better fit
random preference
near mother’s address
suggested address
Memory Allocator (continued 2)
 The memory allocator is connected to the
Reaper
 When a memory request cannot be fulfilled
because a block of the requested size is not
available,
 The Reaper kills processes until a block of
the requested size becomes available
 The size of memory requests are limited to
N times the size of the first block (N = 3)
Darwinian Operating System





Slicer
Reaper
Memory Allocation
Genetic Operations
Disturbances
Genetic Operations
 There are three broad classes of genetic
operations:



Mutations
Gene Splicing
Flaws
 Genetic operations are applied at:


The moment of birth of a new process, or
Any time during the life of the process
 Genetic Operations in Tierra are
documented at: http://www.hip.atr.co.jp/
~ray/tierra/netreport/netreport.html#Genops
Genetic Operations
 Mutations
 Gene Splicing
 Flaws
Mutations
 There are two kinds of mutations of
machine instructions:


bit flips - a single bit of the instruction is
flipped (original Tierra 5 bits, Network 6 bits)
random replacements - the affected instruction
is replaced by one of the 32 (or 64) instructions
in the set, chosen at random
 Mutations occur when:



a process is born
code is copied from place to place
any time at random (cosmic ray)
Genetic Operations
 Mutations
 Gene Splicing
 Flaws
Gene Splicing
 There are three classes of splicing:



Crossover
Insertion
Deletion
 Each class can occur in two ways:


Anywhere in the genome
Only at “segment boundaries”, marked by
templates
 Gene splicing is applied to a daughter
process at the time of birth
Crossover
 A “mate” is chosen at random for our
“daughter” about to be born
 A crossover point in the daughter genome is
chosen at random
 The smaller part of the daughter is replaced
with the corresponding part of the mate
 Crossover can occur in two forms:


preserving the size of the daughter
potentially changing the size of the daughter
Insertion
 Like crossover, insertion involves the
selection of a mate for our daughter
 Unlike crossover, the code to be inserted
does not replace code already in the
daughter
 The code may be inserted an any location
within the daughter’s genome
 Any proportion of the mate’s genome may
be inserted into the daughter
Deletion
 Up to one-half of the genome may be
deleted.
 First the size of the segment to be deleted is
chosen at random (0 to 1/2)
 Next the offset of the segment is determined
within the genome
 The segment is removed from the genome
Gene Splicing
 Each class of gene splicing can occur in two
ways:


Anywhere in the genome
Only at “segment boundaries”, marked by
templates
Segment Boundary Gene Splicing
 Is an attempt to make splicing a little bit
smart, by splicing functionally coherent
chunks of code
 It is based on the recognition that in Tierra,
control-flow (jump) points are marked by
templates
 Segment boundary splicing cuts only at the
location of templates
Genetic Operations
 Mutations
 Gene Splicing
 Flaws
Flaws
 Flaws are not genetic operations, because
they do not alter the genetic code
 Flaws were originally conceived of as being
analogous to metabolic reactions gone
wrong, or producing side products
 Flaws are “intentional” errors in the
operations of the machine instructions
 Most flaws are errors of magnitude + or - 1
 Flaws are non-genetic noise in the system
Flaws (continued)
 Flaws have been implemented for almost all
of the machine instructions, e.g.:
 add adds the values of the data in two CPU
registers
 the result may be flawed by + or - 1
 The results of all arithmetic operations may
be incorrect by the amount + or - 1
Flaws (continued 2)
 Instructions moving data to or from CPU
registers may use an incorrect register,
always a neighboring register
 Instructions shifting or rotating bits in
registers may shift the bits one place too
much or too little
 Instructions manipulating (e.g. flipping) bits
may manipulate the wrong (neighboring) bit
Darwinian Operating System





Slicer
Reaper
Memory Allocation
Genetic Operations
Disturbances
Disturbances
 The operating system may optionally kill a
proportion of the population of processes at
regular or irregular intervals
 The user can define the proportion killed,
and the temporal pattern of the disturbances
The Virtual Machine





Darwinian Operating System
Soup (RAM)
CPU Structure
Instruction Set
Genetic Operations
Soup (RAM)
 Memory is circular
 The size of the memory is set at startup, and
can not change during a run
The Virtual Machine





Darwinian Operating System
Soup (RAM)
CPU Structure
Instruction Set
Genetic Operations
CPU Structure
 Instruction Pointer
 Registers
 Stack
 Stack Pointer
 Flags
CPU structure
typedef struct // structure for registers of
// virtual cpu
{
int re[ALOC_REG];
// array of registers
int ip;
// instruction pointer
int sp;
// stack pointer
int st[STACK_SIZE]; // stack
Flags fl;
// flags
CRflags cf;
// CPU Register flags
} Cpu;
 There are four registers in original Tierra,
six in Network Tierra
 The (10 word) stack is circular, repeated
pushes wrap around and overwrite data.
CPU flags
typedef struct
{
int E:1; //
//
int S:1; //
//
int Z:1; //
//
int B:2; //
int D:1; //
} Flags;
Error : 1 = error condition has occurred
0 = no error condition occurred
Sign : resulting sign of arithmetic
operation, 0 = +, 1 = Zero : result of arithmetic or compare
operation, 0 = nonzero, 1 = zero
Bits: 00 = 32, 01 = 16, 10 = 8
Direction: for shift, rotate, move, search
typedef struct
{
TRind Se; //
TRind De; //
TRind So; //
} CRflags;
//
current segment register
current destination register
current source register
CPU register flags
Multiple CPUs
typedef struct
{
TSignal sig;
int
ib;
int
ac;
Cpu
*c;
int
n;
Cpu
*ar;
SyncA
sy;
InstDef
*d;
//
//
//
//
//
//
//
//
//
//
int threadct; //
} CpuA;
structure for cpu array
signal buffer for this cell
instruction bank
number of this active cpu
pointer to active cpu
number of allocated cpus
pointer to array of cpus
sync group array
pointer to current InstDef
structure for parsing
cell thread count
The Virtual Machine





Darwinian Operating System
Soup (RAM)
CPU Structure
Instruction Set
Genetic Operations
Instruction Set





Graceful Error Handling
Small (no numeric operands)
Template Addressing
(almost) No Syntax
Otherwise Normal
Instruction Set





Graceful Error Handling
Small (no numeric operands)
Template Addressing
(almost) No Syntax
Otherwise Normal
Graceful Error Handling
 No instruction can generate an error that
would crash the virtual machine
 Serious errors cause the instruction to fail to
have any effect,
 and the instruction pointer moves on to the
next instruction
Instruction Set





Graceful Error Handling
Small (no numeric operands)
Template Addressing
(almost) No Syntax
Otherwise Normal
Small Instruction Set
No Numeric Operands
 “Normal” machine codes permit
instructions to include numeric operands
 The bit pattern that specifies the instruction
must include bits to specify:


which operation
the numeric operands
 Most of the bits in machine instructions are
used to specify the numeric operands.
Small Instruction Set (continued)
 The size of the instruction set collapses to a
very small number if numeric operands are
not allowed
 The instructions can still operate on
numbers stored in the CPU registers
 “Fixed” numbers can be created in the
registers through bit manipulations, e.g.,
set-to-zero, flip low order bit, shift left
Instruction Set





Graceful Error Handling
Small (no numeric operands)
Template Addressing
(almost) No Syntax
Otherwise Normal
Template Addressing
 Numeric operands would normally be used
to specify addresses, such as absolute or
relative addresses for the jump instruction.
 Because numeric operands can not be used
for this purpose, another method is needed.
 In Tierra, the jump instruction uses a
template rather than an absolute or relative
address.
Template Addressing
 Templates are an idea borrowed from
molecular biology.
 Molecules “address” one another by having
complementary shapes.
 Templates are complementary patterns of
ones and zeros.
 Templates are built from two kinds of nop
instructions: nop0 and nop1
Template Addressing
 The instruction sequence:
jmp nop0 nop0 nop1
 causes execution of the program to jump to
the nearest occurrence of the instruction
sequence:
nop1 nop1 nop0
 Complementarity insures that the
instruction sequence will not find a copy of
itself.
Instruction Set





Graceful Error Handling
Small (no numeric operands)
Template Addressing
(almost) No Syntax
Otherwise Normal
(almost) No Syntax
 Except for instructions which use templates:
adrb adrf adro call jmpb jmpf jmpo
 all instructions are “atomic”, they do not
require a context in relation to neighboring
instructions.
Instruction Set





Graceful Error Handling
Small (no numeric operands)
Template Addressing
(almost) No Syntax
Otherwise Normal
Otherwise Normal Instruction Set
 The instructions in the virtual machine code
are mostly conventional:
nop add and call clrflag
dec div halt ifzero inc jmp
join (threads) mal mov mul
not ior pop push rand ret shl
shr split (thread) sub xor
zero get put
 Register usage of instructions is configured
at run-time
Tierra Tutorial Outline








Concept - Motivation
The Virtual Machine
Using Tierra
Tools
The Ancestor
Results
Network Tierra
Future Directions
Using Tierra
 Obtaining Tierra
 Setting up Tierra
 Running Tierra
Using Tierra
 Obtaining Tierra
 Setting up Tierra
 Running Tierra
Obtaining Tierra
Information homepage:
http://www.hip.atr.co.jp/~ray/tierra/tierra.html
ftp distribution:
ftp://alife.santafe.edu/pub/SOFTWARE/Tierra/
Distribution Contents
README - notes
source.tar.gz - Tierra source code
tierra.html - preliminary documentation
Binaries
tierraAmiga.tar.gz - Amiga
tierraLinux.tar.gz - Linux (Slackware)
tierraWin95.tar.gz - Win95/98
tierraWinNT.tar.gz - WinNT
tierrdos.tar.gz - DOS
Using Tierra
 Obtaining Tierra
 Setting up Tierra
 Running Tierra
Setting up Tierra
 copy the compressed archive into an empty
directory
 gunzip tierraLinux.tar.gz
 tar xf tierraLinux.tar
 rm *.tar
Using Tierra
 Obtaining Tierra
 Setting up Tierra
 Running Tierra
Running Tierra
 Run Parameters
 Start Run
 Exit Run
Running Tierra
 Run Parameters
 Start Run
 Exit Run
Soup_in File
# tierra core: 14-12-93 INST == 0
# observational parameters:
BrkupSiz = 1024
size of output file in K, named break.1, break.2 ...
CumGeneBnk = 0
Use cumulative gene files, or overwrite
debug = 0
0 = off, 1 = on, printf statements for debugging
DiskBank = 0
turn disk-genebanker on and off
DiskOut = 1
output data to disk (1 = on, 0 = off)
FindTimeM = 0
to set trap at a certain InstExe time, for debugging
FindTimeI = 0
to set trap at a certain InstExe time, for debugging
GeneBnker = 1
turn genebanker on and off
GenebankPath = gb0/ path for genebanker output
hangup = 0
0 = exit on error, 1 = hangup on error for debugging
MaxFreeBlocks = 800
initial number of structures for memory allocation
SaveFreq = 100
frequency of saving core_out, soup_out and list
SavRenewMem = 0
free and renew dynamic memory after saving to disk
SavMinNum = 1
minimum number of individuals to save genotype
SavThrMem = .0000001 threshold memory occupancy to save genotype
SavThrPop = .0000001 threshold population proportion to save genotype
TierraLog = 0 0 = no log file, 1 = write log file
TierraNice = 1
set Tierra to low priority (in Win98)
WatchExe = 0
mark executed instructions in genome in genebank
WatchMov = 0
set mov bits in genome in genebank
WatchTem = 0
set template bits in genome in genebank
# environmental variables:
alive = 2000
how long will we run, 0 = infinite
AliveGen = 0
0 = InstExe.m, 1 = Generations
DistFreq = -.3
frequency of disturbance, factor of recovery time
DistProp = .2
proportion of population affected by distrubance
DivSameGen = 0 cells must produce offspring of same genotype, to stop evolution
Parameters
 GeneBnker = <flag>


0 = gene banker off
1 = gene banker on
 GenebankPath = <path>/

path to gene bank directory (include ending “/”)
 SaveFreq = <integer>

frequency of automatic save (millions of
instructions)
Parameters
 TierraLog =< flag >


0 = logging off
1 = logging on
 alive = <integer>




how many generations/instructions the run will
continue
0 = no limit
AliveGen = 0 (count instructions)
AliveGen = 1 (count generations)
Parameters
 DropDead = <integer>


stop system if no reproduction in the last
<integer> million instructions
0 =no limit
 NumCells = <integer>


number of creatures used to inoculate new soup
includes directives <ex: center, space>
Parameters
 seed = <integer>


seed for random number generator
0 = random seed
 SoupSize = <integer> size of soup in
instructions
Parameters
 directives


space <integer> - skip <integer> locations
before injecting next creature
center - skip one-half of the soup size before
injecting next creature
 genotype to be loaded (ex: 0080aaa)
Running Tierra
 Run Parameters
 Start Run
 Exit Run
Start Run
 new run

tierra1 [soup_in]
• default is “soup_in” if “soup_in” file name is not specified

tierra1 <soup_in> x
• stop at main menu before commencing run
 resume saved run

tierra1 <gene bank dir>/soup_out
A Run In Progress
Main Menu
The Info Menu
A selection of display modes and histograms
Size Query Parameter Entry
Size Query Display
Size Histogram Selection
The size class histogram may be sorted by creature size or frequency
of occurrence.
Size Histogram Display Mode
This is continuously updated as the run proceeds. Notice the
ocurrence of 45 byte organisms underneath the 80 byte ancestral size.
This is evidence of a “parasitic infestation” just beginning.
Gene Histogram Display Mode
Note the organisms of genotype “0045aaa” beneath those of the
ancestral genotype (0080aaa). Organisms of genotype 0045aaa are
primarily responsible for the “infestation”. The most probable hosts
are organisms of the ancestral genotype (0080aaa).
Preparing to Trap Samples
Variable Menu
Press “a” to alter a parameter
Parameter Alteration
This particular parameter change tells Tierra to begin collecting “life
cycle” data on creatures living in the “soup”.
Break Menu
Setting A Break Trap
Break Trap Type Selection
Thread analysis break trap is to be set
Thread Analysis Break Trap
Break when “life cycle” data is ready for selected genotype
Selected Genotype to Trap
Trapping a creature of genotype 0045aaa
Debug Window
An organism of type 0045aaa is trapped. Note that this particular
creature is actually parasitic on the daughter of another type which
itself is also probably parasitic.
Disassembly Menu
Getting a listing of the genome of the trapped creature
Trapped Creature Disassembly
This creature has evolved to have
no copy procedure of its own,
making it smaller and thus faster to
replicate than its ancestors. It uses
the copy procedure in a host
creature to replicate itself.
Life Cycle of Trapped Creature
Count of Instructions executed
Count of Instructions copied
Reproductive Efficiency
Sections Copied to Daughter
Sections Executed
Significant Events in Life Cycle
Life Cycle of Trapped Creature
Note that the final host of this
creature has a defective copy
function that does not return
control to the main program
which called it, and has taken
control of the parasite.
“Hyperparasites” occasionally
evolve this method of using
parasites as extra “CPUs”.
This allows “hyperparasites” to
replicate far more quickly
using the time slice of the
“parasite” in addition to their
own.
Life Cycle Comparison
Parasite
Ancestor (also host)
Debugger Register Display
Default
Debugger Soup Display
Running Tierra
 Run Parameters
 Start Run
 Exit Run
Exit Run
 Quit
 Save and Quit
Tierra Tutorial Outline








Concept - Motivation
The Virtual Machine
Using Tierra
Tools
The Ancestor
Results
Network Tierra
Future Directions
Tools





Live Beagle Explorer
Paleo Beagle Explorer
Evolvability
Tieout
Probe
Beagle Explorer
 The Beagle tools are named after Darwin’s
exploratory vessel, the HMS Beagle.
 The concept is that this is the vehicle that
takes us into the world of Tierra, and
permits us to observe the evolution there.
 The Beagle tools can be divided into two
classes:


Live - which allow us to observe evolution in
Tierra while it is running
Paleo - which allow us to examine the data left
by Tierra after it has finished running
Tools





Live Beagle Explorer
Paleo Beagle Explorer
Evolvability
Tieout
Probe
Using Beagle Explorer
 Main Window





File
Connect
Window
Misc
Option
Using Beagle Explorer
 Main Window - File Menu
 Save Soup
 Save Soup and
Quit Tierra
 Quit Tierra
 Exit Beagle
Using Beagle Explorer
 Main Window - Connection Menu
 Create New
Connection
 Close
Connection
Using Beagle Explorer
 By Script
 By Host Name
Using Beagle Explorer
 Create New Connection - By Host Name
Using Beagle Explorer
Window Menu










Status
Plan
Histogram
Size Query
Tping information
Variable
Overview
Debug
Migration
Messages
Using Beagle Explorer
 Status Window
Gene Banker Off
Gene Banker On
Using Beagle Explorer
 Plan Window
Using Beagle Explorer
 Histograms
Using Beagle Explorer
 Variables
Using Beagle Explorer
 Overview
Soup Display
Color Legend
Instruction Set
Using Beagle Explorer
 Overview - Disassembly from Soup
Using Beagle Explorer
 Debug Window - Break Point
Using Beagle Explorer
 Debug Window - Run Mode
Toggles Between
Free Running <->Delay<->Step Mode
Using Beagle Explorer
 Debug - Step Mode
Using Beagle Explorer
 Messages
Using Beagle Explorer
Using Beagle Explorer
 Main Window - Misc Menu





Inject
Hist logging on/off
Suspend Life Loop
Resume Life Loop
Continue
Using Beagle Explorer
 Misc Menu - Injection
Using Beagle Explorer
Option Menu
 Ack wait
timeout
 Polling
interval time
 Migration
tracking time
out
Tools





Live Beagle Explorer
Paleo Beagle Explorer
Evolvability
Tieout
Probe
Paleo Beagle Explorer
 Paleo Beagle Explorer was the first
observational tool developed for Tierra
 Beagle was developed in DOS
 Beagle used the Greenleaf DataWindows
text-mode windowing system,
 and therefore eventually became frozen, and
difficult to maintain (can only be compiled
with the Turbo C V2.0 compiler)
 Paleo Beagle is currently being ported to
Visual C++
Paleo Beagle Explorer (contd.)
 Includes several observational tools:






Bar
Trace
Diversity
Template
Probe
Prepare
Paleo Beagle Explorer (contd.)
 Includes several observational tools:






Bar - reads break.# files and displays a moving
histogram of size or genotype frequencies over
time
Trace
Diversity
Template
Probe
Prepare
Beagle Bars Output
Paleo Beagle Explorer (contd.)
 Includes several observational tools:






Bar
Trace - reads break.# files and displays the
relative frequency over time of two size or
genotype classes in a 2D x-y plot
Diversity
Template
Probe
Prepare
Beagle Trace Output
Paleo Beagle Explorer (contd.)
 Includes several observational tools:






Bar
Trace
Diversity - reads break.# files and calculates
and displays graphically a diversity index over
time
Template
Probe
Prepare
Beagle Diversity Output
Paleo Beagle Explorer (contd.)
 Includes several observational tools:



Template - reads ####.gen files and displays
template usage of programs, give a rough
overview of the control flow of the algorithm
Probe - reads ####.gen files and compares the
alignment of two genomes, allows quick
comparison of evolutionary relationships and
genetic change
Prepare - prepares data for use with bar and
trace, by previewing the range of the data
Tools





Live Beagle Explorer
Paleo Beagle Explorer
Evolvability
Tieout
Probe
Evolvability
 Evolvability is a descendant of the diversity
tool originally developed for Paleo Beagle
 Evolvability is currently under development
as the primary analytical tool for an
empirical study of evolvability in Tierra
 Evolvability is built in Visual C++
Evolvability Output
GenMaxProp 990629T
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0
200
400
600
Time in Millions
800
1000
Tools





Live Beagle Explorer
Paleo Beagle Explorer
Evolvability
Tieout
Probe
Tieout
 Tieout reads the tierra.log file, and outputs
two columns of values for any pair of data
fields chosen from the tierra.log file.
 I use it primarily to show the change in size
over time.
 Tieout is currently developed under Visual
C++, and provides a 2D image of the
output, as well as saving the output to a file
Tieout Output
Size 990629T
100
90
80
70
60
50
40
30
20
10
0
0
200
400
600
Time in Millions
800
1000
Tools





Live Beagle Explorer
Paleo Beagle Explorer
Evolvability
Tieout
Probe
Probe
 The independent Probe tool is unrelated to
the Paleo Beagle Probe tool
 Probe reads the ####.gen files
 Probe scans all .gen files in a genebank
selecting genomes that match any set of
criteria that you specify
Probe
Interface
TIERRA Genebank Probe
by Daniel Pirone
1 - Size
(-1)
2 - Label
( -1)
3 - MaxPropPop threshold [0-100]%
(-1)
4 - MaxPropInst threshold [0-100]%
(-1)
5 - Begin Time of MaxPropPop threshold cross (-1,-1)
6 - End
Time of MaxPropPop threshold cross (-1,-1)
7 - Begin Time of Origin
(-1,-1)
8 - End
Time of Origin
(-1,-1)
9 - Watch Bit String [0,1,?]
(????????????????????????????????)
Watch Bit String (EXsdofh TCsdofh TPsdofh MFsdofh
MTsdofh MBsdofh )
f - Toggle file type
(gen)
i - Genebank Input directory
(gb0)
o - Match
Output directory
(td)
m - Opcode - Instruction Map file
(opcode.map)
v - Set Gene Output viewer
(more < )
G - Begin Probe
PROBE | (1-9) = edit param, 0 = init params, G=go <ESC> =
quit
->
Tool Convergence
 Evolvability, Tieout, and Probe are being
folded into the Paleo Beagle Explorer
 Next, Live Beagle and Paleo Beagle will be
merged into a single too.
Tierra Tutorial Outline








Concept - Motivation
The Virtual Machine
Using Tierra
Tools
The Ancestor
Results
Network Tierra
Future Directions
Ancestor
Self-exam
1111
find 0000 (start) -> bx
find 0001 (end) -> ax
calculate size
-> cx
Reproduction Loop
1101
allocate daughter -> ax
call 0011 (copy procedure)
cell division
jump 0010
1100
Copy Procedure
save registers to stack
1010
move [bx] -> [ax]
decrement cx
if cx == 0 jump 0100
increment ax & bx
jump 0101
1011
restore registers
return
1110
Tierra Tutorial Outline








Concept - Motivation
The Virtual Machine
Using Tierra
Tools
The Ancestor
Results
Network Tierra
Future Directions
Results
 Emergence of Ecology
 Optimization


Size decrease
Loop unrolling
 Instruction Set Sensitivity
Results
 Emergence of Ecology
 Optimization


Size decrease
Loop unrolling
 Instruction Set Sensitivity
Ancestor
Self-exam
1111
find 0000 (start) -> bx
find 0001 (end) -> ax
calculate size
-> cx
Reproduction Loop
1101
allocate daughter -> ax
call 0011 (copy procedure)
cell division
jump 0010
1100
Copy Procedure
save registers to stack
1010
move [bx] -> [ax]
decrement cx
if cx == 0 jump 0100
increment ax & bx
jump 0101
1011
restore registers
return
1110
Ancestor
Self-exam
1111
find 0000 (start) -> bx
find 0001 (end) -> ax
calculate size
-> cx
Reproduction Loop
1101
allocate daughter -> ax
call 0011 (copy procedure)
cell division
jump 0010
1100
Copy Procedure
save registers to stack
1010
move [bx] -> [ax]
decrement cx
if cx == 0 jump 0100
increment ax & bx
jump 0101
1011
restore registers
return
1110
Ancestor
Self-exam
1111
find 0000 (start) -> bx
find 0001 (end) -> ax
calculate size
-> cx
Reproduction Loop
1101
allocate daughter -> ax
call 0011 (copy procedure)
cell division
jump 0010
1110
Copy Procedure
save registers to stack
1010
move [bx] -> [ax]
decrement cx
if cx == 0 jump 0100
increment ax & bx
jump 0101
1011
restore registers
return
1110
Parasite
Self-exam
1111
find 0000 (start) -> bx
find 0001 (end) -> ax
calculate size
-> cx
Reproduction Loop
1101
allocate daughter -> ax
call 0011 (copy procedure)
cell division
jump 0010
1110
Ancestor
Parasite
Self-exam
Self-exam
1111
find 0000 (start) -> bx
find 0001 (end) -> ax
calculate size
-> cx
1111
find 0000 (start) -> bx
find 0001 (end) -> ax
calculate size
-> cx
Reproduction Loop
Reproduction Loop
1101
allocate daughter -> ax
call 0011 (copy procedure)
cell division
jump 0010
1100
1101
allocate daughter -> ax
call 0011 (copy procedure)
cell division
jump 0010
1110
Copy Procedure
save registers to stack
1010
move [bx] -> [ax]
decrement cx
if cx == 0 jump 0100
increment ax & bx
jump 0101
1011
restore registers
return
1110
Parasite
Hyper-parasite
Self-exam
Self-exam
1111
find 0000 (start) -> bx
find 0001 (end) -> ax
calculate size
-> cx
1111
find 0000 (start) -> bx
find 0001 (end) -> ax
calculate size
-> cx
Reproduction Loop
Reproduction Loop
1101
allocate daughter -> ax
call 0011 (copy procedure)
cell division
jump 0010
1110
allocate daughter -> ax
call 0011 (copy procedure)
cell division
jumpb 0000
1100
Copy Procedure
1010
move [bx] -> [ax]
decrement cx
if cx == 0 jumpb 1100
increment ax & bx
jumpb 0101
1110
Social Hyper-parasite
1010
move [bx] -> [ax]
decrement cx
if cx == 0 jumpb 110
increment ax & bx
jumpb 0101
111
Self-exam
110
find 001 (start) -> bx
find 000 (end) -> ax
calculate size
-> cx
Reproduction Loop
allocate daughter -> ax
call 001 (copy procedure)
cell division
jumpb 010
1100
Copy Procedure
1010
move [bx] -> [ax]
decrement cx
if cx == 0 jumpb 110
increment ax & bx
jumpb 0101
111
Results
 Emergence of Ecology
 Optimization


Size decrease
Loop unrolling
 Instruction Set Sensitivity
Results
 Emergence of Ecology
 Optimization


Size decrease
Loop unrolling
 Instruction Set Sensitivity
Results
 Emergence of Ecology
 Optimization


Size decrease
Loop unrolling
 Instruction Set Sensitivity
Size, Efficiency, & Complexity
Run
R6
R4
R3
R5
R2
R1
R7
R0
RX
Genotype
43crg
35bfj
26ayz
24aah
23awn
23api
23aod
26abk
82aaa
Efficiency
3.33
3.49
3.73
3.96
4.96
5.04
5.09
5.19
8.39
Unrolling
3
3
2
2
1
1
1
1
1
Copy loop of 80aaa
10 instructions executed per loop
nop_1
nop_0
nop_1
nop_0
mov_iab
dec_c
if_cz
jmp
nop_0
nop_1
nop_0
nop_0
inc_a
inc_b
jmp
nop_0
nop_1
nop_0
nop_1
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
copy loop template
copy loop template
copy loop template
copy loop template
copy from [bx] to [ax]
decrement cx
if cx != 0 skip next instruction
jump to template below (exit)
copy procedure exit compliment
copy procedure exit compliment
copy procedure exit compliment
copy procedure exit compliment
increment ax (in daughter)
increment bx (in mother)
jump to template below (copy loop)
copy loop compliment
copy loop compliment
copy loop compliment
copy loop compliment
Copy loop of 72etq
6 instructions per copy, 18 per loop
shl
mal
nop_0
mov_iab
dec_c
dec_c
jmpb
dec_c
inc_a
inc_b
mov_iab
dec_c
inc_a
inc_b
mov_iab
dec_c
or1
if_cz
ret
inc_a
inc_b
jmpb
nop_1
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
shift left cx
allocate daughter cell
top of loop
copy instruction
decrement cx
decrement cx
junk
decrement cx
increment ax
increment bx
copy instruction
decrement cx
increment ax
increment bx
copy instruction
decrement cx
flip low order bit of cx
if cx != 0 skip next instruction
exit loop
increment ax
increment bx
go to top of loop
bottom of loop
Results
 Emergence of Ecology
 Optimization


Size decrease
Loop unrolling
 Instruction Set Sensitivity
Comparison of Optimizations in
four Instruction Sets
Set
I1
I2
I3
I4
Ancestor
73
94
93
82
R0
27
54
54
26
R1
27
57
37
23
R2
26
54
34
23
R3
22
55
36
26
R4
R5
R6
R7
60
49
35
56
53
24
57
54
43
55
40
23
Avg. Opt.
.35
.60
.48
.34
Max. Opt
.30
.57
.37
.28
Tierra Tutorial Outline








Concept - Motivation
The Virtual Machine
Using Tierra
Tools
The Ancestor
Results
Network Tierra
Future Directions
Network Tierra





Motivation
The Network Environment
The Sensory System
Transport Mechanisms
Differentiated Multi-cellularity
Network Tierra





Motivation
The Network Environment
The Sensory System
Transport Mechanisms
Differentiated Multi-cellularity
complexity
3
2
1
billion years before present
0
Network Tierra





Motivation
The Network Environment
The Sensory System
Transport Mechanisms
Differentiated Multi-cellularity
Banff Canada
UDEL USA
Cogs UK
Aizu Japan
VUB Belgium
ATR Japan
Chemnitz Germany
SFI USA
EPFL Switzerland
Network Tierra





Motivation
The Network Environment
The Sensory System
Transport Mechanisms
Differentiated Multi-cellularity
Tping Sensory Data
struct TPingData
{ Int FecundityAvg;
Int Speed;
Int NumCells;
Int AgeAvg;
Int SoupSize;
Int TransitTime;
Int Fresh;
Int Time;
Int InstExec;
Int InstExecConnect;
Int OS;
};
Network Tierra





Motivation
The Network Environment
The Sensory System
Transport Mechanisms
Differentiated Multi-cellularity
Transport Mechanisms
 Processes are able to move to other
machines on the network
 When a process moves to an other machine,
it is removed from the first machine
 A mother may send her daughter at birth
 A process may move at any time in its life
Network Tierra





Motivation
The Network Environment
The Sensory System
Transport Mechanisms
Differentiated Multi-cellularity
cell lineage of network ancestor
R
reproductive
tissue
S
sensory tissue
Development of Ancestor
sel dif
21
18
12
17
copL
senO
13
43
22
12
36
12
52
22
repS
repL
copS
copC
senS
senY
senA
senR
rep
cop
dev
sen
56
46
13
139
27
sel dif
21
18
12
17
copL
senO
13
43
22
12
36
12
52
22
repS
repL
copS
copC
senS
senY
senA
senR
rep
cop
dev
sen
56
46
13
139
27
cell lineage of network ancestor
R
reproductive
tissue
S
sensory tissue
Evolution of Multi-Celled
Digital Organisms, Old
evolution
Evolution of Multi-Celled
Digital Organisms, New
evolution
cell lineage of new evolved network organism
R
reproductive tissue
S
sensory tissue
cell lineage of new evolved network organism
R
reproductive tissue
S
sensory tissue
sel dif
rep
cop
dev
sen
duplication of
cop gene
sel dif
rep
copA
copB
dev
sen
differential expression of duplicated genes
Development of Ancestor
Tierra Tutorial Outline








Concept - Motivation
The Virtual Machine
Using Tierra
Tools
The Ancestor
Results
Network Tierra
Future Directions
Future Directions





MS Windows Environment
Broadband Network Tierra
Public Release of Network Tierra
Large Scale Tests
Wildlife Reserve in Cyberspace
Future Directions





MS Windows Environment
Broadband Network Tierra
Public Release of Network Tierra
Large Scale Tests
Wildlife Reserve in Cyberspace
MS Windows Environment
 Tierra was originally developed as a 16 bit
DOS application using Turbo C V1.0
 Tierra was then converted to a 32 bit
application for both DOS and UNIX
 Eventually Tierra came to be supported on a
wide variety of platforms: DOS, Amiga,
Win95, WinNT, every flavor of UNIX,
VMS, intermittent Mac support
MS Windows Environment
 As a research project, Tierra has been
developed primarily under UNIX
 Now the notebook PC on my desk runs ten
times as fast as the Sparc station on my desk
 Thus we are shifting our emphasis to the
WIntel environment
 Tierra and all tools are being ported to
Visual C++ and fully supported under
WIntel
Future Directions





MS Windows Environment
Broadband Network Tierra
Public Release of Network Tierra
Large Scale Tests
Wildlife Reserve in Cyberspace
Broadband Network Tierra
 The greatest technical problem in the
development of Network Tierra has been
the limitation of network bandwidth
 We have had to make many design
compromises and modifications in the face
of this reality
 It appears that broadband network service
will become widely available in the next
few years
 This will permit a more natural
development of Network Tierra
Future Directions





MS Windows Environment
Broadband Network Tierra
Public Release of Network Tierra
Large Scale Tests
Wildlife Reserve in Cyberspace
Public Release of Network Tierra
 Network Tierra has not been released
because of:


bandwidth limitations
the need for a mechanism to control entry into
the network during development and testing
 We hope to overcome both of these
obstacles and release Network Tierra by the
summer of 2000
Future Directions





MS Windows Environment
Broadband Network Tierra
Public Release of Network Tierra
Large Scale Tests
Wildlife Reserve in Cyberspace
Large Scale Tests
 The public release of Network Tierra will
permit large scale tests involving thousands
of participating machines joined into large
experiments
Future Directions





MS Windows Environment
Broadband Network Tierra
Public Release of Network Tierra
Large Scale Tests
Wildlife Reserve in Cyberspace
Wildlife Reserve in Cyberspace
 The ultimate goal of Network Tierra is to
become a permanent wildlife reserve for
digital organisms in cyberspace
 It will be a place where evolution in the
digital medium can spontaneously generate
diversity and complexity of digital
organisms without human interference
Web Pages
 This presentation:
http://www.hip.atr.co.jp/~ray/pubs/pubs.html
http://www.hip.atr.co.jp/~ray/pubs/tutorial/Tutorial.ppt
 Tierra Home Page:
http://www.hip.atr.co.jp/~ray/tierra/tierra.html
 Tom Ray: [email protected]
http://www.hip.atr.co.jp/~ray/
 Joseph Hart: [email protected]
http://www.hip.atr.co.jp/~jhart/