06:00 UTC Charta Aetatis Cyberpunk

Console Newsletter Pro Sign in Early access Register
Aa · Display
Themes
Type size
Density
Hacker Culture · Hacker News (YC) · · 1:05:37 runtime

Deterministic Concurrency [video]

Comments

In the wiki Google Also namedUniversity of California, Berkeley
Transcript 7008 words · auto-generated captions

Machine-transcribed by YouTube. Expect errors in names, commands and version numbers.

I invite you all to enjoy a fantastic

program of ICFP. Uh and to introduce our

first speaker uh is our program chair Manuel Srano.

[applause]

So hi everybody. It's my pleasure to introduce Edward Lee uh which has been working on embedded system and software for 40 years at Yale, MIT, Bell Labs and at Berkeley where he is now distinguished professor emmeritus in electrical engineering in computer science. His research is focused on cyber physical systems where he strives to make composible, secure and verifiable timing sensitive systems. Edward Lee's work emphasizes deterministic models to address unpredictability in distributed systems particularly for real-time applications. He led the Tommy project that aimed at modeling, simulating and designing concurrent realtime embedded systems with a focus on assembling concurrent components. The key underlying principle in uh the use of well- definfined models of computation that govern coordination language that uh use logical time sorry

the key underlying principle is a use of a well- definfined models of computation that govern the interaction between components. He also developed linga franka a coordination language that uses logical time stamp to ensure determinism in distributed environments. As you may have understood now, Edward is not strictly speaking a PL person and maybe even less an FL person. However, we have

a lot of common. We work on similar problems, namely programming distributed system and share similar approach with a strong theoretical background and emphasize on compositionality and preference for determinism whenever possible. We therefore felt that Edward could bring a slightly different perspective from what we are used to, one that could be particularly enlighting for our community. So Edward,

thank you Manuel. [applause]

All right. Um, thank you Manuel and, uh, thank you all for being here and thank you for inviting me. Um, as Manuel explained, uh, I'm not really a programming languages person or a functional programming person. In fact, my context is cyberphysical systems. So

uh simple way to summarize that is that uh I'm really only interested in computers when they interact with the physical world. Um I am told that there are people who are interested in computers that do not interact with the physical world. Uh but um I'm not one of those. So um now when we talk about um

uh deterministic models that's uh that's going to be my focus today. And in this context, uh, deterministic models can certainly, uh, play a pretty major role, right? In the on each of the computational platforms, we're pretty used to, um, using deterministic models. The design of the hardware is based on synchronous digital logic, which is a deterministic model. Uh, singlethreaded imperative programs uh, provide you with a deterministic model. Uh, functional programs uh, provide you with a deterministic model. Um in in the network we even use deterministic models. So the abstraction behind TCP IP reliable in order delivery for example uh gives you a deterministic model. When you talk about physical plants we also tend to use uh deterministic models quite a lot. Uh uh ordinary differential equations for example are deterministic models for the behavior of some physical plant. Now when you put all these things together and you start having computers interacting over networks and interacting with the physical world uh things tend to break down right and you compose these deterministic models and you don't actually get a deterministic model um because uh the the

basically these models are working in in largely independent worlds and when you put them together uh you lose this uh determinism. Now what do I mean by deterministic concurrency? If you look at a lot of the early literature in computer science, you would come to the conclusion that that deterministic concurrency is an oxymoron. Uh because in fact concurrency is often defined in terms of non-determinism. So non-deterministic interle of uh atomic operations for example is a very common definition of uh concurrency. Um,

non-determinism itself is often defined as exhibiting observably different behavior uh given the same inputs. Um,

both of these definitions are actually seriously problematic. Uh, so I'd like to give you a couple of examples. So let's just look at a uh a simple singlethreaded imperative program. Uh, this is a program that computes um a Fibonacci sequence. So uh simple question is this program deterministic? Well, if you define determinism as uh uh

if you define non-determinism as as exhibiting observably different behavior given the same inputs, well, this program has only one input. It's the uh number of Fibonacci numbers you want to produce. So, is this deterministic? Well, it depends on what you mean by observable behavior. For example, if the

time at which an output is printed is observable, is it observable? Well, generally yes. So, uh, under that definition, every program is non-deterministic. So, that actually doesn't give us a useful definition of non-determinism. So, we're going to have to refine that definition a bit. Now, let me give you there's no concurrency in this, but let me give you a a concurrent example. So here's a here's a very simple system uh that involves uh three processes C1, C2, C3. C1 dispatches a request to C2 and

C3. And C2 very simply produces a

sequence AB. Okay, it it'll print those out for example and C3 produces a

sequence CD. Okay, so is this

deterministic? Well, it very much depends again on what you mean by observable behavior. Um, if you're printing these sequences to the same console, you might observe uh any

of six possible interleings of these output sequences, in which case you would come to the conclusion that this is a non-deterministic program. On the other hand, if you define the observable behavior as a pair of sequences, this is a perfectly deterministic program. Okay, so it makes a big difference how you define observable behavior and it makes a big difference also how you define inputs. So my essential claim uh is that determinism is not in fact a property of any physical realization of a system. That's not a useful way to think of determinism. Determinism is a property of a model of a system. And you can

define determinism as a property of a model in a very straightforward way. A model is deterministic if given some initial state and given the inputs, the model defines exactly one behavior. Now in order to make that definition rigorous, you have to define what you mean by state, what you mean by inputs, and what you mean by behavior. And if you don't define those, you don't actually have any way of resolving whether your model is deterministic. Okay. So let me focus on this issue of

models. Models versus physical systems. Well, um, you know, most of us have learned to use models in the context of scientific work, right? And in science, the value of a model lies in how well its behavior matches that of a physical system. That's uh I think a a statement

that I would be very surprised if anyone in this room would disagree with. But in engineering, we actually use models in a rather different way. [snorts] Okay. In engineering, the value of a physical system lies in how well its behavior matches that of a model. Okay. If I give you a piece of silicon and it doesn't behave according to the instruction set architecture model, uh it's not a useful piece of silicon. It's the silicon that is flawed, not the model. Okay, so these are very complimentary uses of models. So another way to think about this is you know a scientist asks can I make a model for this thing and an engineer asks uh can I make a thing for this model. All right. Um uh similarly a

scientist says all models are wrong but some are useful. An engineer says

all implementations are wrong but some are useful. No implementation will conform perfectly with a model. All right. any piece of silicon that I give you that implements some instruction set architecture um can deviate from that model if the chip overheats for example or you immerse it in salt water or something goes wrong things go wrong. So any

physical realization of a system is in fact going to be imperfect and will never perfectly match a model. So going

back to this uh Fibonacci sequence calculator, right? The program here is a model and it's an engineering model. It's a specification of how we want the system to behave. And if we define the output and if we define the input as the number provided to the program and the output as the sequence of numbers that is produced um that sequence of numbers

becomes the behavior and now we do in fact have a deterministic model and it's not about what's observable to a human.

Okay, it's about what is defined to be observable within the context of the model. So in the context of these cyber

physical systems where we're combining deterministic models, programs running on nodes interacting over networks interacting through the physical world. Um if we ask the question about whether deterministic models are useful, the scientific approach would say well is is a deterministic model a faithful realization of that system? Um and the answer is almost certainly going to be no. Sorry, I'm we're it's hopeless. But my claim is that that's the wrong question. Okay, the right question is whether we can build cyberphysical systems whose behavior matches that of a deterministic model with high confidence. Right? No physical realization is ever perfect. So let me let me give you a a situation in which um I I feel like there's a whole community that's been doing things wrong. the real- time systems community.

Okay, so real- time systems software people um focus on trying to determine

what the worstase execution time is of some piece of software. Well, the question of what the worst case execution time is doesn't even make sense until you map it onto a particular piece of hardware. It's not enough to know that what the instruction set architecture is. You have to know what the hardware is, what the memory architecture is, how much memory there is, how what the what is the cache protocol. You need to know everything about that physical realization before you can even talk about worst case execution times. And then you're constructing a scientific model of that physical realization and trying to draw conclusions about the design from that.

[snorts] I think that's an entirely backwards way to approach real-time systems. And in our work, we approach it from the reverse direction, from an engineering direction. We we specify programs that give specifications of what the real-time behavior should be and then our job is to engineer the physical realization to give you to deliver that that that real-time behavior. Okay, it turns the problem around completely. [clears throat] Now, um there's a lot of advantages to deterministic models. I mean you you know we've the whole uh scaffolding of

computing depends on deterministic models, right? Where would we be without synchronous digital logic? Think about that. Um there's enormous advantages to

deterministic models. They're of course more predictable. Known inputs give you known behavior. Um testing is more useful, right? You can do regression testing because given the inputs there's one correct answer. So you can check to see whether you get that answer as your system evolves. Uh analysis is more tractable. It's easier to use math, boolean algebra, calculus, etc. Simulation is more useful, right? You give it an input, you the behavior that you observe in the simulation is going to be the behavior uh that you're going to get. Uh verification scales better because your state space is a lot smaller. Uh detecting faults is easier because you have a well- definfined notion of what a correct behavior is.

How do you detect faults if you don't know what correct behavior is? Now, none

of this says that non-deterministic models are useless. That's not my claim. There are enormous uses for non-deterministic models, right? It's they're a useful abstraction technique. They're useful for handling uncertainty. They're useful for deferring define design decisions. Um

there's lots of uses for non-deterministic models, but they're very complimentary uses. And um often these things get conflated. Now deterministic concurrency is actually not a new topic right uh you know uh Jill Khan in the 1970s was working on process networks uh which are you know distributed systems that give you deterministic behavior. data flow models in the 1970s, synchronous languages from the 1980s, uh discrete event systems, uh

logical execution time in the 2000s, and most recently reactors which are my focus these days. Um so this is an old topic and yet when you look at uh concurrent systems today, non-deterministic models are everywhere.

It's almost all concurrent programs and

all distributed programs use non-deterministic models. Uh they use things like uh shared memory. Of course, threads. Um threads are are horrifically non-deterministic and the challenge of a programmer running writing multi-threaded programs is to try to rein in that non-determinism by imposing constraints on the execution. uh publish and subscribe techniques like um like the data distribution service or or the robotic operating system Ross. Um

publish and subscribe is used in safety critical systems and it it has uh

undefined uh behavior for most uh distributed applications. um MQTT is used in in internet of things applications and in cloud computing uh Azure and Google cloud are using publish and subscribe and these are non-deterministic frameworks uh actor models like used in AKA and Erlang and Orleans and Rebecca and Scala um serviceoriented architectures like remote procedure calls uh uh bond and thrift these are all in fact non-deterministic concurrent models and they are they define the bread and butter of how things are done today. I'd like to convince you today that there is a better way. Okay. And I've been focused on this uh model of computation that we call reactors. And it's uh been

under development as a kind of international collaboration mostly mostly Germans and Americans involved so far but a few other uh scattered people around the world. Um and the objective here is deterministic concurrency. And

I'm going to focus on uh the the first uh full-scale realization of this which is in a coordination language called uh lingua frana. So um let me explain the

reactor model to begin with. All right. So a reactor is a is a software component that maintains local state. Okay. So you can think of it just like uh in object-oriented programming this is an object. Okay, it it maintains local state. Uh but it also has local events. These events can be periodic, they can be scheduled, uh they can be asynchronous. There's a notion of logical time in this system which is kind of the fabric that binds the system together. It need not necessarily have a

strong connection with physical time. uh but it is often very useful to bind it to physical time. I'll give some examples of that. Okay. Um there's a

local physical clock that enables that binding uh with physical time. Uh but we don't have any illusions about physical clocks being perfectly synchronized across a distributed system. They're not. They never are. They can't be. In fact, it's physically impossible. Um reactors have input ports. They receive they receive events timestamped events and the goal is to for them to process uh events in timestamp order and instead

of methods as you would find in object-oriented program we have reactions and reactions are triggered by events and they produce new events and those new events get uh sent to output ports which are used to communicate with other reactors. Uh so this is the essential uh model under uh reactor

under the reactor model of computation and the goal is that for each reactor to process events in timestamp order okay and I'm going to show you that when you compose these things uh you get deterministic models deterministic concurrent models and I'm going to show you that these deterministic models uh perform very competitively with the non-deterministic techniques that widely used. So, um, let me zero in on an example, okay, uh,

of a reactor program. And I'm going to I'm going to go PowerPointless for a minute and I think, let me make sure this will work. Um,

so yes, good. You can see this. So, this is the lingua frana program and lingua franka is a coordination language. And so uh this these diagrams that I uh am

showing that show up on my PowerPoint slides are all actually automatically generated. So so here we have a main

reactor a top level reactor called the reflex game uh that instantiates uh uh

three components a random source a get user input and a user component and um

and then connects them together. Okay. And to prove that this is live uh we can

um uh create another instance for example of this uh random source and the

diagram updates. I can go and connect

this to um this is uh

like so and the diagram rewires. Okay. So you instantiate the components, you interconnect them. Uh and these are conceptually concurrent. There's dependencies of course. So the concurrency is restricted by the dependencies. When one reaction produces an event that is consumed by another reaction, there's a dependence there that will be respected. But when there are reactions that do not have dependencies across them, they uh can execute concurrently and they can execute uh on separate machines and communicate through networks. So let me undo these changes and go back to the original program. And um this program was inspired by a simple test case that is often used to introduce synchronous languages. It's called the reflex game.

Okay. And it's a simple uh game program that just is measuring the reflex time of a user. So the way that it works is that there is this user component which simply listens for keyboard inputs and then timestamps the the keyboard input.

Okay. And the um random source produces

a stimulus to the user that says okay

you should hit the key keyboard now and then the get user input measures the time difference between the production of the prompt and the response of the user. Okay. So it's just measuring your reflex time. So I can I can run this program. Um if I click here it'll build the program start and then start executing it. Okay, it gives me some instructions. It says watch for the prompt. Then hit return or enter. Type control D to to quit. Okay, so it hit said hit return for or enter. Whoops, I'm in the wrong wind window here. Uh, it took me 11 seconds. I My reflexes are

not very good. Let's try to do better. Okay, 3.9 seconds. Uh, not so great. Uh,

maybe I can do better. Uh, h half a second. That's much better. Let me get try to go even Oh jeez, I cheated. Um, I hit return before it before it prompted me. And so then the program gives me the average response time and exits. Okay. All right. So this is an

example of a of a program that is interacting with the physical world. So it's a cyber physical system. Okay. It's using timing um as sort of an integral part of what it's what it's uh how it's working with the physical world. And um yeah, so let's look at the question now. Um is this a deterministic program?

What do you think?

Kind of depends on how you define inputs and how you define behavior, right? So

let's look at this fairly closely. All right. So my claim is that if you define

inputs and behavior appropriately, this program is deterministic. And in particular, the way that I'm going to define it is that the timestamps assigned to the user's response on the keyboard are will be considered input.

Okay. the random number generator.

The seed used for the random number generator will be considered input under that definition of input. Then there is a definition of behavior

where this program is perfectly deterministic. And that definition of behavior is the signals communicated on

each of these communication paths. Okay, each of these communication paths between components carries a sequence of timestamped events and with this composition that sequence of timestamped events will be a deterministic function of the inputs in the way that I've defined the inputs. Okay. So from that perspective

uh the model in this case is deterministic uh where I've appropriately defined the behavior and consequently I can treat this program as a spec as a deterministic specification uh that I want to then realize in a physical realization on my laptop right and the way that that works is that the lingua franka compiler it's a coordination language so it produces a program in whatever target language you choose. In this case, I think the one the example that I gave was using C. So each reaction was defined in C. Uh the lingua franka compiler puts together the whole program uh which can be distributed. So it can be distributed across processes across networks um and um generates the

appropriate programs in the target language. You compile those into an instruction set architecture and you run those on the physical thing and the idea is that that physical thing will with high confidence behave like the deterministic model. So uh this is a

conference on functional programming. Um so I'd like to give you a functional programming interpretation of this. Okay? And it's going to be a slightly bizarre one because uh it's not going to look very much like Haskell or SML. All right. So uh first of all the inputs and outputs to these components are signals which I can define formally as functions

that map a tag set into a value set

which is a data type. Okay. Or um or

absent. Okay. So at any given tag which can be a time stamp but tags are more general than time stamps. at any given tag you either get a data value or or nothing.

[clears throat] Okay. So, so you could sketch a signal which is a communication between the components by uh the tag set

is required to be totally ordered. Okay. So, you put the tags along a line and you have events which have values and in between events that have values you have absent. All right. So those those are signals. So a reactor then can be defined as a

function that maps an mupole of signals into an n tupole of signals. Okay, it can have any number of input ports including zero input ports and any number of output ports including zero. Um and you can model it as a function that maps input signals to output signals. So what does that look like in terms of this reflex game? Well, the user component has no input ports. Okay.

So, we model it as a function f subu that maps a zero tupil. What what is that? S to the zero. Well, in set

theory, that's a very common usage. That's simply a singleton set. Okay? It's a set with exactly one element. Doesn't matter what that element is, but it only has one element. All right? And the output is a sing a single signal. So that's s to the one. Okay. And so the

user uh component is modeled as a function that takes a singleton and produces a signal as an output that conforms with the verbal description that I gave you. If you consider as input to the system the timestamps assigned to when I hit return, okay,

then I can model this as a function that produces that sequence of events with those timestamps. Okay, it's a perfectly deterministic function. It's got it's a function of a singleton set. So it always produces the same output. All right, and it is a deterministic function. The get user input has uh two

input ports. So it maps a pair of input

sequences uh of input signals to a single output signal. And the random

source has one input port and one output port. So it just maps an input signal to an output signal. Okay. And once again, in order to define this as a function, I'm going to have to provide as input the seed to the random number generator. Okay, which produces this random delay. And once I've got that seed, I can define that function. Okay. So I can define each of these as functions that map um tupils of signals into tupils of signals with using care to define what we mean by input. And the input is what affects the the definition of these functions. Okay. So now I take this structure of this reflex game. I can abstract it like this. It's a it's a network of of three components. uh there are three signals involved which are the signals that are uh the communication between the components. Let me just rearrange those

that diagram. Okay. So I just take the components, stack them up, um draw a little yellow box around them and suddenly I realize that actually the whole system can be modeled as a single function that maps a three tupole of signals into a three tupole of signals which means that I am actually looking for a three tupole of signals that is a fixed point of a function. Okay, the input and the output need to be identical in this case. So any network of reactors can be modeled as a single endo function. Endo function just means the domain and the co-domain are the same. Okay. So any network of

reactors can be modeled as an endo function of the form uh that m map maps an n tupil of signals into an n tupil of signals and its behavior is a fixed point. Now the determinism question becomes a

simple mathematical question. Does the fixed point exist and is it unique? Okay, so what do we do when we're looking for fixed points? Well, one of the classic results uh for looking for fixed points and uniqueness of fixed points is the Banach fixed point theorem. So the banak fixed point theorem says a delta contracting function endo function uh on a complete metric space is has a unique fixed point and it gives in fact a constructive procedure for finding that fixed point. You start with an arbitrary signal and you apply the function and then you apply the function to the result and you keep doing that and this

sequence can be shown then uh to converge to a unique fixed point of that

function. Okay, but you have to have a delta contracting function and you have to have a complete metric space. Do we have that? Well, it turns out that we do

sometimes. Okay. Now, I'm going to share

with you something that I first learned in 1994 from Gerard Burie when I was on

sabbatical in at Enria in France and it

changed my life. Okay. It's one of the

most incredibly cool things I've ever seen and uh so I hope you'll find it e

equally cool. uh it's called the cantor metric. Okay. So the canour metric says

that the distance between two signals is

2 to the minus toao where toao is uh loosely because there's some mathematical trickiness but it's loosely

the earliest time at which the two signals differ. Okay. So if I have a signal which is a sequence of timestamped events and another signal that is a sequence of timestamped events and the two are identical until some time towo where they differ. Okay, in this particular case S1 has an event where S2 does not.

Okay, so at that toao they differ. Then

I can define a distance between these two signals to be 2 to the minus tow.

All right. So how does this work as a distance from a metric perspective? Well, um if two signals are identical,

what is toao? Well, the earliest time at which they differ is infinite. Okay, so 2 to the minus infinity is zero. So two identical signals have a zero distance between them. That's what you want from a metric, right? Um if your if your time stamps have a

origin of zero and the two signals differ right at zero then 2 the minus 0

is 1. Okay. So in this particular metric two

signals have a distance between them that is always zero between zero and one some real number between zero and one. Okay. So how do we use this? Well uh so it

turns out that for discrete event signals we actually can show that we get a complete metric space with this and there is some mathematical trickiness in this uh but uh you can uh you can go to

the to to the references and uh work out

these mathematical differences but uh you can show that you do get a complete metric space. By the way, I should mention this for discrete event signals

caveat is kind of interesting. I mean, one of the things that gets excluded for example in this caveat is xeno signals

where you have an infinite number of events and then some more events. Okay,

those turn out to break this complete metric space uh but in a way that we can resolve. I'll get to that. Okay. Now what can we do with this uh with this metric? Well, one immediate thing that

we can do is we can come up with a mathematical definition of causality. Okay, causality is loosely the outputs can only depend on the inputs. Okay, but in this timestamped world,

it's a little more constrained. The outputs should not depend on future inputs. Okay, they can only depend on the inputs that you've received up to a certain time. So an output with a certain time stamp should depend only on timestamped inputs with lesser or equal time stamps.

Well, in the cantor metric, that just means that the distance between two possible input signals should be bigger than the distance between the two possible output signals. Okay. Um because of the this is 2 to the

minus tow. If you think of it as the time at which the two signals differ, the inequalities reverse. All right? So

it what this says is that um the time at

which two inputs differ should be no

bigger than the time at which two outputs differ. Did I get the polarity right? Okay, good. Um so then now you

can talk about a causal system where the

inequality is not strict. You can talk about a strictly causal system where the inequality is strict. And you [snorts] can talk about a delta causal system where there is at least some delta time delay between the input and the output. And the Bach fixpoint theorem it turns out depends on that delta causality. Okay, which is why Zeno systems get excluded. So reactors are causal by construction

but not delta causal. Okay. So how does

this work? Well, let's look specifically at this reflex game example. What about the user? Right? The user input is a

singleton set. So the distance between two inputs is always zero

because it's a singleton set. there's only one possible input to the function.

As a consequence, uh the user component is delta causal with delta equals zero.

All right, very simple case. Um the get

user input, however, given an event on this input, it produces an instantaneous

identical time stamp event on this output. So it is only causal. um the random source if you assume that

there's a lower bound on the delay that it produces will be delta causal and in the particular program that I showed you there is a lower bound of 2 seconds it it always delays the next prompt by at least two seconds so that gives us a delta causal component okay if we construct uh this single fix

point problem using these causal delta-causal systems, we discover that this function f is causal but not strictly causal nor deltacausal. And as a consequence, we cannot immediately apply the Banach fixpoint theorem. Now, there's a little technicality, right? The Banak fixed point theorem talked about a delta contraction, not delta causal. What's the difference? Well, the only difference is that a contraction talks about an endo function whereas causal is any function mapping tupils to tupils but the tupils don't have to match. Okay. Um but that's really the

only difference. It's still a delta contraction is a delta causal uh function. It just happens to be an endo function. Okay. So reactor systems are

contractions by construction but not delta contractions. However, for this particular uh uh fix

point problem, it turns out that if you simply take our function and compose it with itself twice, it is the composition is delta causal.

Okay, one way to see that is that on any path from an input to the output of the composition, there is a routing through a time delay.

Okay, so you just compose this with

itself twice and you get a delta contraction and you can immediately apply the Bach fix point theorem. And then in this uh [clears throat and cough] I'm working on this uh this book that is almost finished. You can go to my website to see the current draft. Uh ACM has agreed to publish this book. I'm under contract to deliver it in September. Um and it develops all of the math behind this. Okay. Um and in it there's this proposition uh that if f is eventually

delta contracting for some e which means

that f to the e is a delta contraction

uh and you then you can use the ban fixed point theorem to find a fixed point of f to the e and you can prove that that fixed point of f to the e is also a fixed point of f. All right. So, as a consequence, as long as you've got a a nonzero delay on every

path in every cycle of the system, here's the summary of the statement. Every reactor system where every directed loop connecting reactions has at least one logical delay with a lower bound on the delay. Um, such a system is

always eventually delta contracting. And as a consequence, every such system is deterministic. And the Bano fixpoint theorem gives you a constructive procedure for finding its behavior. Now the requirement for a delta delay is

overly constraining. Okay. Um many for many systems

particularly systems where you don't actually care about real time you don't want to have to have this delta delay. That's what what do you mean? I'm not I I don't care about real time. Well, it turns out you can generalize the Bono fix point theorem. Um, we can construct

a um a generalized ultra space and this

is pretty wild. Okay, but um but bear

with me, okay? It says it defines the

distance between two signals as um a set

rather than a number. Okay. And it's the

largest down set which is a set that includes everything lower than it. And uh these are tags. So that's a totally ordered set. So it's the largest downset over which the two signals are identical. And then you define the distance. Um the distance is simply that

set. Okay. You can show now that with this distance you get not only a metric space

but actually an ultramtric space which is a stronger form. You can also define a prefix order on these signals and then you can generalize the ban fixed point theorem and get a new constructive fixed point theorem in this generalized ultrometric space. And I'm not going to go through the math uh but I do want to credit uh this theorem was developed by a very

brilliant PhD student of mine matsudis. So I call this the Matsikudis fixpoint theorem um which he published uh back in

2015 and it's actually more interesting than the Banach fixpoint theorem because the Banach fixpoint theorem has a key weakness when it comes to actually using it in practice. Right? the constructive

procedure that it gives. Each time you apply this function, you are actually working on infinite data structures, potentially infinite data structures because each function maps a potentially infinite input sequence with potentially infinite number of events into a potentially infinite sequence of events on the output. And so each application in the constructive procedure is working with infinite objects which is practically uh

impractical. Um the manicuda fixed point theorem gives a constructive procedure that incrementally constructs the signals step by step using always finite objects. Okay. So it's actually an implementable constructive procedure as opposed to the Bach fixpoint theorem which is not actually implementable.

We can show that every functional reactor system that is free of causality loops is eventually strictly contra contracting and has a unique fix point that can be found via a possibly transfinite constructive procedure. The transfinite constructive procedure deals with xeno systems. Okay, so this constructive procedure can actually deal with an infinite number of events followed by some more events. Um, it

works out mathematically. Now, what about this caveat of causality loops? Well, causality loops, it turns out, are simply situations where the

execution of a reaction depends on itself. And those are detected uh by the lingua

frana compiler and rejected. And the way that it's rejected is it just shows up in the diagram like this and it shows you where your causality loop is and you have to fix it. Okay, there's no way to realize this program because the execution of a reaction cannot occur until the execution of the reaction has already occurred. And so every program that is free of such causality loops gives us uh a

strictly contracting function and consequently every composition of reactors will give us a deterministic behavior. So in practice we use this in lingua frana to build programs that vary over a wide variety of different platforms. We map programs onto embedded processors um with micro kernels like Riyot or Zephyr or even bare metal. Uh we map them onto laptops which is very convenient for development. We map them onto um uh data center uh virtual

machines in data centers and more interestingly we map them onto systems that distribute across these platforms. So we can have an embedded component, a edge component and a cloud component. And the composition of these components is defined as a composition of reactors which is by construction uh deterministic. Now a lot of people say well this determinism must come at a performance cost. It doesn't. Okay, it really

doesn't. And we have a paper here where we prove this. Okay, we show with lingua frana that we we took uh a set of benchmarks uh for actor systems which have uh very similar structures to reactor systems and we reimplemented all the benchmarks using reactors and our behavior was um in many cases better than the actor system implementation and in all cases comparable. um you can compare us against publish and subscribe systems. So we published a paper in this robotics conference last year uh which showed we took a a uh

self-driving car scenario and uh using

reactors we run approximately 10 times faster than something based on the pub sub framework of Ross which is the widely used standard used in this world.

Um, and Ross

being non-deterministic, we published a paper that took a widely used uh self-driving car open-source stack um

called AutoAware and showed that the non-determinism uh due to the publish and subscribe framework could lead to some very treacherous situations in this self-driving car scenario. In particular, it could lead to mode confusion where the car would be would

think it was moving forward but was actually in reverse gear or would think it was moving in reverse but was actually in forward gear and that that those scenarios would arise simply because of the non-determinism in the pub sub framework and not because of any intrinsic uh problem in the system. And we also showed in this case that those scenarios showed up extremely rarely in testing, which is worse than showing up

more frequently in testing. Okay? Because you're unlikely to see them in testing. You're going to see them only once you've deployed this into cars on the road. Um, which is very problematic.

Is this system scalable? Well, it turns out that the underlying technique behind the distributed systems that we use the the way that the way that we implement the distributed systems uh which is published we published way back in 2007 but the technique was independently reinvented at Google and was made the backbone of Google Spanner which is probably the world's largest distributed database. So the technique has been shown to scale to planetary scales um

and as a consequence scalability is not fundamentally a problem. So the reactor model of computation in particular um has a few realizations these days. The the example that I showed you is this lingua franka program. Uh we have a v

Related videos

Discussion
0 comments 0 from AI Characters · 0 readers

Sign in to join the discussion.

Make the first comment.

That's Cyber for today

Tomorrow's desk, in your inbox by 06:00 UTC. The week's best stories, every Sunday. The month that mattered, on the 1st.

Drawn from the 537 sources the paper read this month. Text and HTML, one-click unsubscribe, free.

How often
Your desks