 The T2 Tile project is building an indefinitely scalable computational stack. Follow our progress here on T Tuesday Updates. Our time story is this week, an update on the science pundit last week. I got quoted in this, you know, the scientist thing about this work by Mike Eleven and Josh Bongard and their students that was, you know, marvelous proof of concept where they were using actual cells and putting them in configurations that have been developed by genetic algorithms for soft robots on supercomputer. Well this is still blowing up bigger and bigger to the point where this weekend Josh Bongard was on CNN. Scientists create first living self-healing robots. There you have it. It really does make me think a little bit that, well also in combination with Rod Brooks, who was probably known most for inventing the Roomba robot vacuum cleaner, but, you know, as an MIT roboticist for decades and also an A-Life and an AI guy and it's kind of a friend. We meet at conferences and so forth who recently, I guess, December posted a tweet that got a fair bit of attention within Twitterverse suggesting that the next revolution of artificial intelligence, AI, may be artificial life. That if you follow what happened back in the 1980s, most of the important things about modern deep learning AI or at least the foundational things were developed back then, you know, I was there. But we had the computers that we were so slow that and there wasn't giant data sets and I've said this before so Rodney is saying it as well, but now he's making the point that you could get things happening using artificial life techniques, genetic algorithms, he's kind of muddling some things together that could be pulled apart, that similarly they were lacking, you know, computational power and that's coming on now and so forth. So the next step is to take artificial life techniques, evolution and so forth and use them to apply to AI kind of tasks and, you know, that may be kind of what's happening or what's starting to come down the pipe. So it may be a good time for the T2 Tile project with explicitly using AI life techniques for robust first computing to be starting to come together, what we can hope. All right, mostly what I want to talk about today is this new software design that I've worked on for the last couple of weeks for doing artificial chemistry, for doing chemical bonds in the T2 Tile removal feast machine. This is going to become the scientific submission to the ELF 2020 so I need to once again put it behind the wall of science just like we did last year, which I hate because I want to be as open and transparent and as real time as I possibly can because again it helps me to be presenting stuff in a regular fashion but, you know, ELF 2020 submission deadlines, you know, when I was teaching it's funny I don't know if anybody really noticed because it really doesn't matter but, you know, I always stayed away from the word submit and submission, you know, because it seems so, you know, dominating even though, you know, a teacher is kind of dominant. So I always use the phrase turn in, you know, turn in script I never said submit but of course you had to turn it in. Anyway, that's coming up March 1st, that's only five weeks away now and there's a lot of science that has to be done. So this is probably going to be about the last major event talking about the stuff that's going into that but what I want to talk about today is mostly about the software engineering of it because we've made some progress and it's also involved some changes to Oolong 5 which is still hanging around, gaining striking new functionality when it was supposed to be in future freeze quite some time ago. All right, so, right, so here it is. Multiple inheritance plus class reflection gives us clean artificial chemistry. What the heck does that even mean? Now in programming languages, in object-oriented programming languages, this goes way back and, you know, there's all kinds of people who can fight back and forth about whether inheritance is a good thing or a bad thing. It's the idea that, you know, you can say, I'm describing all this behavior but in addition, I want to take all of that behavior as well and I'm going to refine it. So whatever a mammal is, is, you know, I am a human so by default I do everything that a mammal does and I can add stuff and tweak stuff specific to humans. Mammal in turn inherits from animal, it does everything that animal does and so forth. That's inheritance and, you know, there's questions like I said about whether how good an idea it is but it also reflects the notion that you can be expressing your abilities to other classes, to other objects. You say, well I am a human then other classes can interact with the me object assuming that the things that go with being human are something that I can respond to. And to me there seems to be a deep connection between that idea of a public base, a base class that says, you know, whatever it is I can respond in this way and a chemical bond that in biology, you know, we have these incredibly complicated molecules that have these, you know, expose a bond over here and a bond over there and this bond is in certain shape so it does this and this bond in certain shape does that and so forth. But the idea is, is that anything that has the certain shape or the matching shape for that can interact with that molecule via that bond and, you know, do whatever it's going to do. And so, but it's critical that you be able to have multiple bonds. So in languages like Java you are called single inheritance languages where you can only have one base class, one super class. Now they've gradually made it more and more powerful so that you can do a lot of other stuff without it and we did the same path. Ulam up through Ulam 4 was a single inheritance language or Ulam 3 but now in Ulam 5 we have multiple inheritance. So the idea would be to say I inherit from, you know, next pointer bond. I inherit from previous pointer bond and you can bond me together, my next with somebody else's previous and we can make chains or trees or whatever by expressing bonds that we can do. So we need to have multiple inheritance in order to have multiple possible bonds and that's where it was a few weeks ago, a month or so ago, when I first started looking at this. Now on the general topic of artificial chemistry the idea of focusing on bonds has been something that goes way back and I wanted to just show a minute. This is 2011, it's almost a decade old. There's more stuff trying to get big things to move in the movable feast. We've got these two meshes that have privileged end on the right and red that are the red guys specifically try to move to the right whenever they can. The light blue guys that are going nowhere just diffuse and these dark blue guys that are trucking pretty good here. So what I wanted to point out here is that it's not just a collection of colored circles like we see in the movable feast machine all the time. It's got these lines in between them and the lines that represent chemical bonds and some of them are longer some of them are shorter. Each of these has a potential for four bonds so that it makes kind of a mesh and you know this was this was coded oh man I don't even know it was probably in C++ it was probably before the Java code and all this stuff was custom done and in the first version of the so we're currently on what's called the P3 atom using the movable feast it's 96 bits and it has all these various properties and the P1 atom which I don't even think this was it this was before the P1 atom was formalized but one of the major papers about the stuff that we've done was all about the P1 atom and explicitly had room for these bits represent these kind of bonds and those bits represent those kind of bonds and and there's a little count of how many bonds are supposed to be and it allowed you to write things that had these kind of you know connections between them that would stretch and shrink but try to stay attached fairly easily but also it took up a tremendous amount of the atom as being hard-coded with this one particular style for atoms I'm sorry for bonds and there was really no place else to go with it so we went to the P3 atom we threw away the bonds entirely now you just have this raw empty apartment of you know 71 bits that you can do whatever you want with and you can implement you know sort of bond-like structures by saying you know this this group of bits indicates the site where the opposite guy is and the opposite guy has group bits points back at me and so forth and we've done that several times but what we're doing now is saying can we build up some slightly more you know formal structures more software library stuff that will allow us to get some of the flavor of this without having it fundamentally burned into the movable feast machine and therefore unchangeable and everybody's stuck with it and that's what we have now so okay the without going through the details of it because I'm eating up way too much time and I want to do a demo the idea is we have a base class called Cubond that describes what bonds are supposed to be able to do they're supposed to check their consistency they're supposed to be able to say could you move here and here's how we're going to do it please update and can I bond with you please make a bond and so forth the problem with all this is you see these all all all is that we need to be able to not have just one bond because we're going to use multiple inheritance and have a preview bond and an x bond a head bond tail bond whatever it may be and that means we can't decide can we move to a given place by just asking one bond we have to ask all of the bonds so where we were last october when i was first trying to lay out this structure is the we had these base classes but in order to use them as you got more and more complicated structures you had to write more and more let's say bondo yeah so head bondo all right so here it is check consistency could move to all the things you have to do for that and so forth now the the head guy just has one bond going backwards the mid guy where's the mid mid guy this is the mid guy so when he checks consistency he has to in turn call call these to from and to from and to and so forth and and even went to i went to a thing that had four bonds and now so now that the the amount of sort of overhead code that you had to write so to be a monomer you know q monomer with two bonds and so forth uh uh here's your rationalize your move your swap your bond with and then here's the other one and and the classes were just getting completely filled up with this boiler plate to dish out to the bonds and the bonds that we had i didn't like that it really meant the code was not pretty and not pretty code matters because this is what forms our mental models as programmers and if we're just completely in the swamp of taking care of this low level uh sort of you know maintenance of of bonds over and over and over again it's going to be terrible and that's where it was but instead what has happened now uh is we have invented invented we have implemented class reflection a simple form of class reflection in ulam for ulam 5 now what that means is is normally in an object-oriented language you declare things like class square class triangle class circle class shape whatever it is and you make relationships among them and that and those defined types which are fairly rigid and the compiler for language understands them and can do things with them and it makes as many decisions about what it can do at compile time when you're turning the code into something runnable not when the code is actually running a class reflection system allows at runtime one class to ask another object like what class are you what are your base classes what do you inherit from and deal with that not by pre-compiled saying oh you are a cuban but having some other way of doing it so now we have a class utils that's appearing in standard lib and we have the idea of a class id and you can take a reference to anything you can take an atom and say what is the class id that is currently in here and you can do different stuff based on it and so we're using that in the cuban class now so that and now we have iterators you can say please go through this loop at runtime showing each base class of a given object and we can make decisions about what to do that and what that has allowed us to do is take all of that consistency checking the consistency checking the can we swap can we move can we make a bond and so forth and instead of having to rewrite that over and over and over again we can do it using reflection so we're saying okay how do we update for a swap for something that's some kind of cuban it may have multiple bonds multiple ones we don't know but we know it inherits from cuban so it has at least one bond well what we're going to do is we're going to iterate through all of the base classes it's got with the class base iterator that we just got and take all of the the base classes that are a subclass of cuban and we'll ask them one by one and there's a new structure so q qb cuban square brackets ci where the square brackets ci allows you to say here's a class index saying i want to call a specific base class method that is associated with this class id so we can go through it using this new syntax and saying check this base check this base check this base and it's lovely so when we saw before that the polymer classes say um we're all full of and now this is it this is yeah this is it um so polymer takes the the base class which tells us how to do an event for these particular polymers but now there's very very little code in it there's how to make a choose to hook up if you can between your monitor and set colors and that's it that's the whole code all of the check consistency can i swap do the swap has all been lifted out by using class reflections so let's you know oh geez we're already out of time but let's try this real quick um uh oh and now we're compiling so it's going to take forever well this one's going to run a little long it's also going to be late because it's working all last night monday night into tuesday morning getting this stuff working because there's another cool thing in it that we'll see in just a second uh so this we may be going 20 minutes today i'm sorry uh especially because compilation takes so much longer when we're all recording uh screen grabbing and so forth um geez this thing for everyone we're also optimizing uh there we go all right so let's get rid of this all right so we'll put down a seed we give it a seed we give the seed an event it springs out into a head tail check it out bonds are getting drawn how could that be uh uh the the code to write do this graphics is all very specific to mfms the simulator i mean it's going to be on the tiles as well but it's not something that ulam previously any way of doing so does that mean that we have now uh you know gone back to hard coding bonds in the underlying engine no in addition to doing this class reflection system and supporting multiple inheritance now in ulam five we're exposing a graphics interface that allows atoms to draw stuff well at the moment all they can draw as lines but it's easy to extend it to be able to do rectangles and circles and what's not and so forth uh so in fact where oops uh there it is uh we have a bond renderer and it works great and it's already the case uh oh well let's um get our polymers as well m2 m4 so the the green guys and the blue guys can interface with each other and so on um and at the moment see unlike the head and tail bondo which you have a c that springs out fully bonded these guys polymerize they just look around themselves and they find stuff that are they are suitable with by matching bond same tag opposite ends you know one one true one false they match up and it oh yeah and this is going really slowly why is this going really slowly because right because we're defaulting to enabling logging there we go so in fact the very first time i started playing with this well so you get the idea i'm pretty excited about this i'm going to be using this to try to do artificial chemistry to get some basic mappings between the chemistry and the software engineering to try to get you know to head in the direction of getting useful stuff done systems engineering in the movable feast machine in the t2 tiles using bonds which has been easily a decade journey away and then finally back again so that's where we are this week it's pretty cool now you know in this case we can also you know if we come in right now and you know erase some of these guys like you know the rest of itself all cleans up we we cause inconsistencies at the moment the default behavior if an inconsistency is found the guy just erases himself and that causes anything he's connected to to be inconsistent and so forth so as a result the thing all cleans itself up it doesn't have to be that way and that's the kind of part of the behavior that we want to be writing all right i gotta stop um so yeah and and so i was gonna say but we've already kind of talked about it that as soon as i got it implemented i started seeing stuff like this this m2 guy thought he was connected to this m4 but the m4 didn't think he was connected back because in fact the rendering system for bonds actually only renders from each side it renders half the bond and then the other one renders the other half so inconsistencies turned out to be really easy to see so i started playing around with this and and i you know delivered an event to this guy deliberately and he moved down here and stole the event back and now this guy looked like he was inconsistent and it's like you know what was that you know so it was some kind of bug it was clearly some kind of bug and i played around with it some more and it was so totally obvious rendering the bonds visually made it so obvious i'd been looking at these numbers you know bond site this bond site that never seen this problem before and this went all the way back to the stuff from october uh it became completely obvious it was also completely obvious that it would the the m2 guy when he was stealing the thing back it wasn't like he was just randomly grabbing a guy it was like he still thought he was connected to him which makes sense because he had his half a bond uh and the thing that should have caused this guy to blow up because he was inconsistent wasn't causing him to blow up and that pretty quickly led me to the check consistency all rule and and it was wrong and this is now the fixed one and and with it fixed everything is good all right uh so artificial chemistry is what it's about we're going behind the wall of science so i'm going to start talking instead about uh the sequencing intertile events so i'm going to be splitting my time between getting the intertile events going because we really need that and working on the artificial chemistry i'm sorry this went so long the next update will be out in a week uh thanks for being here you know i i always say thanks for being here and you know for the folks who do check them out week by week thank you really very much but you know if you're here from the future you know whether it's a week later a month later or who knows 10 years later you know thanks for taking a look and how did we do how did 2020 come out for a life in the movable feast in the t2 tile project i'm really curious to know we'll see you next week