It's a great pleasure here to be here and to give actually the first talk in the celebration of my good friend Samson's 60th birthday. I first met Samson, I think it was 1989, and this was in a very interesting different universe, so to speak. It was a time where we had the Soviet Union and he was one of the delegations of the Soviet Union string theorists was visiting the US and they were visiting in a few sites and Harvard we were lucky as one of those and he came with a few other very good string theorists, young string theorists describing the work they were doing and it was quite interesting to get to know them at that time and that was the beginning of my knowing Samson. I even remember roughly what his talk was about the WZW and some aspects of the WZW models which actually is somewhat related to the talk I'm going to give today as well, some aspect of it and then I met him more and longer and actually collaborated with him on a couple projects and this was in 1994 when I was a visitor I guess on sabbatical leave in the Institute for Advanced Study. So at that time Samson and I I mean he's always great pleasure talking with him and we always had fun talking about various things in physics, nothing necessarily focused but just general discussion and I always find it inspiring to talk with him. He had always open mind about all these different aspects of physics and always bring some interesting insights with discussions we had and so we began discussing things we found interesting and gradually went to a particular direction I still don't know why we started working on exceptional conformal theories and then particular spin seven and G2 which almost nobody was interested in so it was kind of a bizarre subject we just find it fascinating that there are these kind of things that could be possibly true and nobody had studied it seriously in the context of string theory so we just said let's study it so again this is the open mind that he exhibited in terms of his interest as well as ability involved an amazing amount of talent which I certainly lacked and he had in terms of understanding amazing properties of this new algebra that we were finding in two dimensions and you know that was quite a fun collaboration I was was happy to be part of and led to two papers and since then we have collaborated in not necessarily in papers but in discussions in different ways over different places and most most consistently during the summer workshops in the Simon center and so on we have been talking I have a great pleasure of continuing my interaction with Samson so on this occasion of of his 60th birthday celebration conference I'm going to talk about basically trying to do these two themes that I've also been interested in and Samson is a master in and one is the subject of anomalies and this is going to be a overarching theme in my talk as well as some aspects having to do with supersymmetry which is again another domain of his expertise named in particular equal to supersymmetry and his work with Nikita on this area has impacted quite tremendously this subject especially in the connection with integrability and integral models the deep insights that they found in connecting these two fields so that's the basic introduction and I want to then get a bit more focused I'm going to talk about works which is related to some joint work I've done with Hichio Kim and Gary Shu and Hori Tarazi as well as if I get a chance I hope with my student Jacob McNamara and a different work so my main focus is going to be these series of works and if I get the chance I'll briefly also mention this other work so to set this stage I have to tell you the basic basic kind of a place where what I'm going to talk about fits and this is the idea basically about what constitutes a good quantum gravity and you know there was this belief that you take a you take a quantum field theory and you just put a metric couple it to the metric and make the metric dynamical integrate over metric and then you have quantum gravity and this was good in terms on paper it sounded good and the problem was when already long ago Feynman and others started looking at this it gave infinities and nobody could make sense out of it so the conclusion then was you know we don't know how to do it of course it should be possible because we live in a theory with quantum gravity so they didn't figure out but there should have been a solution and string theory of course came up with a solution somehow it works now in the context of quantum gravity and so we celebrated in string theory that quantum gravity is great and we can solve it it's finite or it makes sense there's no problem and we're done well actually not so fast and in fact what we didn't appreciate so much in string theory especially early days is how special string theory ends up being and in some sense Feynman and others were essentially correct that quantum field theories cannot be coupled to quantum gravity consistently that was the message that Feynman and others originally drove and that's almost correct there are a few exceptions and those are the exceptions that string theory comes up with so in some sense we should view string theory as providing loopholes to this idea that quantum field theories can cannot be covered to quantum gravity so I'll try to illustrate this point in my talk so so I start with I first focus on supersymmetric theories so supersymmetric theories coupled to gravity are of course the better chance of understanding because in the supersymmetric theories we have less quantum corrections at these certain quantities are protected so we have a backbone of the theories forced and it's protected so we have a better understanding of what we are doing so it's the best place to start understanding coupling to gravity start with a more restricted case which is more symmetric so what we found what we seem to find is that in the context of supersymmetric theories we have when you couple them to conduct gravity if you try to see which kind of supersymmetric system you get you start with a quantum gravity theory coupled to some matter you go to low energy and then you ask what quantum field theory you get so there's a projection from quantum gravity by taking the low energy limit to space of quantum field theories and you can ask what kind of map this is is it onto is it what what how big how much how much do you cover the space of quantum field theories of course we believe the space of quantum field theory is infinitely big especially even supersymmetric ones we have a huge number of them for example n equals to four yang-mills and four dimensions is a finite theory for every gauge group for every group you choose is a unique theory so we think it's it's the huge infinite infinite many possibilities but it's not clear what the image of this map is in fact what we have been learning at least in the context of supersymmetric theories that this image is finite not only it's not onto anything is far from it it's just a finite image so this is what I want to basically point out that we really have just a bunch of points in this infinite space of possibilities that are consistent with quantum gravity and this point that essentially everything we are doing in the space of would be quantum field theories have only a lot of very tiny subset which is this what we call the string landscape compared to the infinitely many other possibilities which are not realizable in quantum gravity so this is what what we call swamp land the swamp land even though it sounds like a the name which is just negative feature it's it is negative feature as far as gravity goes but as far as quantum field theory goes is perfectly fine so so these are good theories like n equals to four yang-mills for any gauge group is is good theory and as I will argue essentially all of them are in swamp land so the the ones that are the ones that are actually coupleable to gravity are very rare very rare so why do we have such an image well we don't have a full definition of the theory so i'm making a strong statement a very strong statement based on what well based on constructions and string theory now what are the constructions of string theory well we take if you're interested in their minkowski vacuum we start with with some higher dimensional theory 11 10 and so forth and you put it on a kalabia and you get the theory and depending on which kalabia dimension you choose in different dimensions well you can have different choices but no matter what you do if the number of kalabia is finite finite types then you will get fine number of possibilities in lower dimensional theory there is no proof mathematically that the number of kalabia is finite so if there if indeed that's infinite then that would be against what i'm saying so this finiteness is directly related in that class to the statement of their finite number of kalabia at least at least if this is not finite it will give you counter counter statement to what i'm saying there's no proof so this could be false and it will be interesting to try to start verifying or proving or disproving it in dimension one and two it's clearly finite is one in dimension one elliptic curve and dimension two is only k3 or t4 depending on how much autonomy we want kalabia three-fold already we think it's finite we don't have a proof yaw conjecture that many years ago and we have evidence for it uh what's the evidence well trying hard and not being able to that's one evidence but there's better evidence if you take elliptic kalabia three-fold it has been proven to be finite so we have further evidence that at least in the elliptic class it is finite and it seems from all the experiments people have done and trying to construct it that essentially not all but most of kalabias are elliptic anyhow in the context of elliptic three-fold so therefore it's a good guide we believe so this finiteness criteria seems to be a deep deep idea so in some sense gravity is finite now i don't want to mislead you by my by my drawing just three or four points it could be 10 to the 10 points my main points that's finite not necessarily small number but but finite is finite is compared to the infinite set is measure zero so that's already quite a remarkable statement okay um now i have to contrast this just to make sure that i'm not misleading you when we talk about uh particular gravity theory we also have defects like brains membrane and this and that and on those objects we could have arbitrary number of interest in interesting structures for example in 10 dimensions type 2b we can have arbitrary number of d3 brains which you stack them on each other and you get n equals to four yang mills if you have n d3 brains you get un gang mill theory on it there's no bound on n you can have arbitrary big n instantly many possibilities so that sounds like a contradiction with what i'm saying here so just let me make clear what i mean when i say finite i mean finite number of theories for which the objects coupled to gravity in that same dimension so if you take n equals to four yang mills on d3 brains with infinitely many d3 brains they couple to 10 dimensional gravity but not to 4d gravity gravity is not localized to 4d okay so the gravity can go back from the brain and back to itself that's fine so so what we are what i'm talking about there's the finite number of gravity types of a given theory of course there are infinitely many defect types that i'm not talking about so that should be that should be clarified so indeed it should be because we believe in some sense all quantum field theory should be observable or constructable in string theory and since they're infinite you should be getting it through defects in string theory that's all but if you want to get a quantum field in a given dimension you better start with gravity in a higher dimension in order to do that not in that same dimension if it's in the same dimension you're going to run into trouble okay um good so that's i think a basic point now um so so how do we how do we assess this program you see the the program of trying to use string theory to come up with with this principle is a little bit is a little bit strange because and it's subject to criticism in the following way we don't have a principle of what quantum gravity has to be we just have learned some some basic facts but we don't have an overarching definition of what quantum gravity is so if we just study string theory then you're subject to the criticism like you can only understand things which string theory can construct not the general quantum gravity it's a valid criticism and that's that's the lamppost principle the lamppost problem you only study what you can and string theory might be just a tiny little corner of what is possible and the whole vast thing you cannot and so yeah maybe maybe we are just being misled by string theory giving us these few points but the whole thing is actually constructable in some other way okay that's a valid criticism if we want to actually understand whether or not it's true or not we have to use some principles that we have learned and understand it beyond string theory and use those principles to actually get insight about what is allowed on what's not allowed and see whether with those principles you would you still get these only these points or there's more more more to the story so in other words we should be able to assess the principle of lamppost principle based on principles we are learning from string theory but can be derived with the ways more general than string theory that's I think the the basic aim of this program to try to connect connect this to a more more basic idea of consistency and what do I mean by more general or more basic principles things like consistency of black holes things like uniterity of the theory things like things which we believe has to be true in any quantum gravity not not specifically about string theory so using those facts to see if we can say anything which is which is beyond beyond these um good um so let me start then with with the supersymmetries so the highest amount of supersymmetry is we should always start with the highest one is is a theory in various dimensions which have 32 super charges there are different not there are different types in different dimensions but but the biggest number of supersymmetry you can have are 32 supersymmetries and the highest dimension is 11 for this but you can have this and you can you can go down of course you can take the the moment 11 uh dimension which is the usual m theory construct uh definition and you you compact phi and torii and you still get the same amount of supersymmetry but there's also another class so there so the non chiral ones are just you can obtain them by by a toroidal compactification of the highest one so this gives you the d less than 11 ones but there's also a chiral one in 10 dimensions which has a 2 comma 0 supersymmetry so these are basically classification nothing to do per se with super string theory or anything like that it's just a super gravity statement representation theory okay so so if you don't know anything about string theory and if you just study super gravity theory you find well there are only two possibilities either the one which is in 11 and the other ones which could be related to circle compactification or something in 10 dimensions it could have been that string theory got neither of them or one of them well string theory luckily gives you both of them so this is already the beginning of a good good situation that what is what seems to be consistent is constructible in string theory and it's one-to-one so we can check this off as saying okay so this set of possibilities with 32 supercharges is very limited and but nevertheless all of them are constructed in string theory so the string lamp post principle in this case succeeds to give you everything that is allowed okay good so we now begin to get confidence perhaps that everything which is allowed maybe can be obtained from string theory so let's go to the next case theories with 16 supercharges how many of them are they well this this again there are two classes is chiral and non-chiral theories the chiral theories only appear in dimension 10 and dimension 6 and actually there could be intermediate supersymmetries like 24 and so forth depending on how low a dimension you go I'm interested in higher dimensions for now so let me just restrict to to 16 dimension 10 you can have 1 comma 0 supersymmetry which is chiral and dimension 6 you can have again to a 1 comma 0 super 2 comma 0 what's called in 60 theory which is again has 16 supercharges and and non-chiral theories you can have anything with d less than 10 again I'm not using string theory here I'm just using classification of supersymmetric theories low energy description gives you these possibilities more than that anomaly cancellations this theory is an anomalous so anomaly cancellation will tell you the only possibilities for gauge symmetries in this theory is 8 cross e8 or so 32 or e8 cross u1 to the 248 or u1 to the 496 there are only four possibilities in this case in this case the theory is is a theory with certain number of tensor multiplets 21 tensor multiplets with a with a symmetry structure which is locally given by SO 21 over time 5 SO 21 comma 5 divided by SO 21 times SO 5 and this is an anomalies fix the structure of this tensor multiplets and so forth in this theory completely so these are the only possibilities here for d less than 10 you find this perfectly fine with arbitrary gauge group g for all g's looks fine possible an example of this d less than 10 is that in 4d n equals to 4 gang mills for example supersymmetric n equals to 4 supersymmetric gang mills is consistent with any g and in fact we believe it's finite theory so uv divergence is cancelled because of such a high supersymmetry in 4d so this is this is yeah this is the end and this is the curly end so so this is n is the total number of super charges and that is so it doesn't distinguish which dimension you're in and this is just assuming packages them in terms of the spinner of that dimension so four dimensional four of four dimensional spinner four four four times four is 16 okay so so that's basically the the structure okay good so now we can see whether the lamppost principle works luckily these two have been constructed the heterotic string constructs both one of them is actually also becoming constructed using type one but these two are not constructed so originally when green and short found this anomaly cancellation and found this example they believe that this is a good string theory they found this type one they didn't know at the time that they constructed there's this other one and they thought there must be a way to get this lo and behold heterotic string realized that so that was a beautiful confirmation of string lamppost principle it did not have to be constructable it was constructed but there were two other cases that was not constructable in any way and maybe they said maybe for some reason it doesn't it's not allowed or something okay so they conjectured or they asked whether or not these make sense so there has been work and I will I will mention the work we did which shows that these are inconsistent theories despite the fact that anomalies cancel so in other words with this much supersymmetry the only consistent theories are the ones that string theory gets again string lamppost principle is complete that that meaning anything which is consistent is realizable within string theory d equal to 6 this theory again it is complete because this is simply typed to be compactified on k3 and that's the only way you get in string theory well there's another way you can get in string theory which is m theory on t5 mod z2 but anyhow they give you the same theories they are dual to each other so there's a there's a unique theory with this much supersymmetry and that's it and and so this again is consistent and is constructible in string theory how about this class well let's start with the first one d equals to 9 d equals to 9 is the first puzzle case you see up to now I have been using such a high amount of supersymmetry or chirality anomalies which is one of the powerful tools in quantum field theories to restrict the possibilities and maybe I ruled out two boring funny cases as I would explain how but in d equals to 9 the dimension is odd and so the chirality and so on is not there to help us and in fact naively you would think there are infinitely many g's possible can you get every g there is no problem with quantum gravity at least naively when you write it down it seems to make sense for r3g now you ask okay can string theory give me everything unfortunately not it only gives you theories with rank the rank of the groups being 17 9 and 1 only three possibilities so so if the rank of the group is one of these three ones in principle you can get them in string theory I'm not saying everything with these ranks you can get but at least it has to have this property but naively the theory seems to be okay with arbitrary ranks so what happened what are these theories rank 17 is obtained by simply taking these theories I'm putting it on a circle you get an extra u1 by the circle so that gives you the rank 17 the rank 9 theories can be obtained from this e8 cross e8 theory if you put it on a circle and exchange the two e8s as you go around the circle and that gives you rank 9 by the outer automorphism of this of this theory this is what's called the chl string and the rank 1 theories cannot be obtained from hederotic string so you might have thought that this is bizarre why do you get rank one this you get from compactification of m-theorem climb bottle so you have to use all these ways and somehow you can get them so you get all these trees but you don't get arbitrary rank that's the only three you get so the question is are we missing something is string theory missing something or indeed that's the list if this is indeed the list or there's some restriction like this then you begin to feel that uh-huh maybe there is there's we should be just studying string theory and there's nothing else and therefore we can trust the lessons we are learning from string compactification and trying to draw general lessons about quantum gravity I will talk about these cases in a second but before I do that I will also want to talk about the next case the n equal to 8 case and this n equal to 8 case which is in four dimension it leads to n equal to two supersymmetry in particular so this is the same class of theories we're talking about and that's the class that samson has worked quite quite extensively on various aspects of it so this is the next case and in the n equals to 8 again you can have a chiral ones and non chiral ones chiral one starts in 60 well it isn't 60 and it has supersymmetry which is 1 comma 0 supersymmetry and non chiral ones can be for example viewed as compactivation of this on the circle so we can five four etc you can just compactify this on a circle and you get theories with eight super chargers this is one of the well-studied cases for example in 4d or 5d by compactifying m theory on kalabia threefolds and so on this is this class so it's very well studied and so forth and the 60 ones can be can be obtained again by kalabia threefolds in this case you use f theory on elliptic threefolds and again you get the same class uh of of this type now again again this theory this part is that has anomalies in it and again anomalies play a key role in trying to constrain the theories but unlike the 10d case and unlike the 60 case with two zero anomalies are not nearly as powerful in fact you get infinitely many possibilities which cancel anomalies as was studied by taylor and collaborators so there's a huge number of possibilities but only a finite number of them can be obtained in string theory this one actually has been proven in the sense that elliptic kalabia threefolds which is the way we get these theories in string theory using f theory have been proven mathematically to be finite so we know there's no more than that we can get in string theory is finite but anomalies give you an infinite set so if anomalies is the only guide you get you get infinitely many possibilities and yet we get only a finite number of them okay so so these are the things i want to basically focus on but um so let me start with the with the with the 10d story first let me see where oh there's a board behind this okay good so let's do the 10d case sorry oh i see very good thank you excellent thank you okay so let's talk about the equals to 10 case and in this case the anomaly cancellation actually came up with an extra equation which is the fact that dh is not zero but given by trace of r with r minus trace of f where j with some specific coefficients and so on where h is the field strength corresponding to the b field and this is quite interesting because of the following fact so this is comes from a b field and this telling you that there is some some source for the b field the field strength of it and usually the right hand side should have been zero fb is equal to dh but there is these terms that come up in the definition of the of the h which gives you the d of it is not zero and you can compute these statements the fact that there's a b mean new field means in the context of a quantum field theory that if you have a two form you could have a one plus one dimensional object which couples to it a string now in the context of whether or not this is fundamental string or what's the i don't even have to talk about it we know there is a string how do we know there is a string there could be a one plus one dimensional one plus the two form but nothing couples to it that's not possible in quantum gravitational theories every charge that's available is occupied the spectrum is complete so this is how do i know that how do i know that in a in a quantum gravity theory the spectrum is complete so for example if you have a u1 gauge theory you can have a Maxwell theory with nothing charged that's fine as a quantum field theory but as a quantum gravity you cannot have a u1 with no nothing coupled to it why do we know this this is basically Hawking's black hole computation you take a black hole of a given charge you compute the entropy you find this not zero for any charge and therefore for every charge it's occupied now you might say well this is only applied to big black holes and so on only for big charges but you can take a big charge and a big negative charge minus one and you put them together you get something to charge one so therefore every charge is occupied in a quantum theory of gravity so that's a very strong statement without doing anything this is not because of string theory this is again consistency of interpretation of the black hole and the black hole entropy so if it's complete there's some string coupled to this and in fact you can get an idea about what kind of strings you can have and in this particular case you can actually preserve supersymmetry you can have super gravity solutions with which preserve half of this supersymmetry so we expect there to be a string with one plus one dimension another one plus one dimensional defect with 0 comma 8 supersymmetry on this defect so this should exist i am not using string theory i want to emphasize this is not using string theory this is simply using the fact that there should be completeness of spectrum okay so if there's a theory with 0 comma 8 supersymmetry what does this tell you well as is well known and this is the kind of things that is this domain of expertise of samson is the anomaly info and in fact we will hear something later after my talk i'm rooming about the the similar story for them five brains this equation tells you the anomalies that have to live on this string just from this equation so this equation is smart enough to know something has to live on the string what does it tell you well from this term you learned something about c left minus c right on the point in class of this of the string so you learn c left minus c right is 12 after you take into canon normalizations correctly i haven't put numbers there but if you check it you find it's this but there's something else you learn from here you see if you look at the a string the transfers to the string is an s o a degree of freedom there's a rotation degree of freedom on the string uh transfers to the string but there's also the tangent to the string so you can decompose the tangent to the tangent along the worksheet of the string and the tangent bundle normal to the string and from this you find in other words if you decompose this to something like the punch egg glass of the worksheet plus the second churn class of the s o eight related to it from this you learn the fact that there's a zero comma eight supersymmetry and the fact that the s o eight is related to that same s o eight symmetry you learn the central charge of the right movers because there's a relation between the anomaly coefficients in the current of the s o eight and the central charge so you learn c right basically using that you find c right is 12 and therefore this equation simply gives you c left is 24 now you use the uniterity now you use the fact that this coefficient here is not zero which means that every gauge group in the bulk should be giving you a current algebra with a non vanishing level on the worksheet and you can find this left mover so you find that the the central charge due to the current algebra should be less than or equal to what can it be should be less than or equal to um to the to the dimensions that correspond to the uniterity of the conformal theory now the left movers has 24 there are eight transverse motions that you can put the strings on so you can have to yeah if you subtract and see how much central charge you have at your disposal you find 16 so you find the central charge of the group should be less than 16 but w c w construction tell you that the central charge is always bigger than or equal to the rank of the group namely the u once and therefore you learn learn that the rank of the group is less than or equal to 16 you look at your list and indeed you find there are two rank 16s and these are out because they are more than rank 16 you're done so this is telling you that simple ideas having to do with anomaly inflows uniterity and the existence of a this object is putting you strong restrictions on quantity of gravity something which would have not been obvious if you just studied the low energy supergravity okay completely from anomalies but but the anomalies in this case involves the anomaly inflow on an object you may not have studied a priory you may have said in other words you could have said this object may not exist in which case there's nothing to talk about so i'm using a little more than anomaly i'm using the fact that this object exists that has this pulver symmetry and then there's anomaly inflow on this and uniterity on it if there's not unitary there's no problem and so on so i'm using a few more ingredients uniterity existence so it's more a few more steps but all reasonable so so that's what i mean so we're going to beyond just assumptions of string theory but assumption which are reasonable uniterity and completeness again so we learned that string theory does not miss anything in this case either um let me just i think this is i think probably the up one is what i want to bring down i like this this gets stuck here with the finesse yes i see let me see if i want to push this up or not oh better not i was about to jump up there yeah it's very nice you do your exercise here it's actually interesting if somebody has a hard question today no no not today don't worry today you're okay okay um oh i think i should go a bit faster let's see so um okay so now we come to the next case which is d equals to nine and theory has 16 super charges how about this there's no anomaly nothing there's nothing you have no choice what can you use well you still have a be me new field and in fact this is true for eight seven etc so for all of these i'm not saying just nine eight seven etc there are all these cases and you can study what happens in this in these cases well before we before we study what happened in these cases let's continue our geography of what we get in string theory i said over there that you get in nine dimension ranks 17 you got ranks 17 nine or one for the rank of the gauge group these are constructable in string theory in eight dimensions you get ranks 18 10 and 2 in seven dimensions you get ranks 19 11 7 5 and 3 and so on in d equals to 4 which is the n equals to 4 case i don't know the full list but it starts with 22 and goes down so this is what examples of the ranks we know and naively quantum n equals to n in theory with 16 super charges predicts that you should have arbitrary gauge group nevertheless these are the only ones you realize in string theory and these especially these odd ones clearly there's no anomaly and these even the even ones don't have it so therefore there is a bizarre situation they have no control anomalies don't seem to be useful anymore but actually anomalies again run the show as i'll try to explain here we need a few more ingredients so again there's a b field and therefore again there's a string but could the string be chiral yes it has to be chiral because the super symmetry on it is again the same amount 0 comma 8 these follow from this from just studying the bps string conditions of bps supersymmetry you find that there's left and right supersymmetry 0 comma 8 on the on the string what about the anomaly inflow well now if you look at the equation that you had before you find that the coefficient of r wjr term is not fixed anymore by supergravity but the but but the coefficient of f wjr term is fixed by supersymmetry so super gravity tells you that all the gauge field should give rise to current output with some level but we don't know anything about the c left and c right a priory because there's a coefficient there is not fixed gravity supergravity is not smart enough or strong enough to fix this so this we don't know about so here you see for the theory is the 987 etc even though the theory is not chiral there is a chiral object and therefore it does see anomalies in principle but we don't know what the anomaly has to be unlike the situation in tendy where the coefficient here was was fixed to be one well in this case what you find again doing the same exercise as I did before you find that c right is 12k or kappa whatever i call there and uh c left minus c right again is 12k so k equals to one was the case we had before and now we have this situation and in principle k can be arbitrarily large and so therefore if k is arbitrary large there is no restriction on here and so we would not be able to restrict anything except now here i want to use a principle which is one of the things that has emerged from swampland which is called the distance conjecture distance conjecture in the swampland states that if you take any theory of quantum gravity which has some scalars fields coupled to it which gives rise to some kind of a modular space if you go far enough in the field space you will get a tower of light states so for large enough phi you get a tower of light states emerging exponentially fast so the mass the tower comes down to zero mass and what are the meaning of these light states is a dual description of the theory in other words the distance conjecture basically quantifies what we mean by duality that is no matter what you do you always whichever corner you go you get a different description at the infinite far away a new description which is weekly coupled in a not necessarily the same form in a dual language so i'm going to assume this is still the case that is that anytime you have a parameter in your theory if you go to infinite distance away you get some dual description i won't assume what dual description just some dual description so i will use this fact so this fact is an extra ingredient i need to get going in these cases assumption that there is a duality okay so if you do this how does this help you well the idea is the following if you take a theory in d dimension and if you look at the marginalized space of these theories with 16 supercharges you get some theory which has something some kind of a some kind of an Orion lattice of some kind with charges as well as the marginalized space so you have something s o m plus k times k okay with some particular n's and k's this is what we know this structure follows from supersymmetry not string theory so supersymmetry tells you it's like this okay the scalar moduli that you have is like this but then what i'm going to do is i'm going to compactify this on an extra circle i compactify the theory on an extra circle and again you get an extra again by super gravity you find that this extra circle at least gives you an s o one one piece of course if you turn on wilson lines we'll mix with these as we well know but again i'm not using string theory i'm just using super gravity i'm not assuming no t duality i'm just assuming that you compactified on a circle this the fact that there's an s o one one comes is just follows from super gravity description now i'm going to use the distance conjecture to argue there must be t duality so i will explain it in this form so if you use this there's a moduli for s o one one which is the radius of the circle if you go to the zero radius this is infinite distance away and there must be a dual description the dual description should have 16 super charges and it must have this is d by the way it must have at least this d s o symmetry and therefore it must be a theory which has a supersymmetry of a higher type of the same form because of this moduli space so therefore you learn that there must be a theory in the same dimension d which has an equal to 16 super charges which compactifies to give you this one in other words there is a t duality namely the momentum modes of this of this new theory is is related to something related to this other theory as the radius goes to zero which descriptions are they there are strings in this theory as i explained there's a bimian rule still therefore there are strings and you can show by this much supersymmetry they don't get any correction to their mass and all that you can compute it exactly what their mass is and their tension so as you shrink the circle the string wand around this which is the bps string becomes massless our fairly light state and that must be the dual description of this other theory that's what we call t duality t duality is exactly the fact that the winding modes become the momentum modes of the dual theory so therefore we learn that there must be some dual description we don't know what it may be its same theory it might be a new theory but there must be a dual state such that the winding modes of this string get exchanged with the momentum modes of this other string okay so this is part of the distance conjecture but does that help us how does that help us it helps us for the following reason you see this theory which has this k here and the right move which has a central charge given by 12k gives you a bound on the spin of the states namely as is well known for example in the super conformal theories with n equal to 2 supersymmetry there's a maximum charge which comes from the spectral flow of the theory and we know that there's an upper bound for the spin of the states of the u1 in the in the conformal theory which is given by c over in the roman sector is given by c over 6 and in this case using the integrality or in this case the half integrality of the spin because you can argue that this j symmetry has to do with the lorenz symmetry in the target space so we know the integrality structure using the integrality we learned that the maximum state should be occupied so therefore we know what is the highest lorenz spin on the winding string but the winding string is dual to a graviton on the dual one and there cannot be any spin more than two for graviton so the very fact that the winding string becomes the momentum string and the spin cannot be more than two otherwise you get a massless mode which spin bigger than two and that's not allowed we have the same spin you get a bound on k and you learn k is less than or equal to one so this is coming from t duality together with the fact that the highest state is has to be the graviton but the central charge is related to the level and you can get a bound on the higher charge and you're done so you find k is less than or equal to one k is less than or equal to one already implies c left is less than or equal to 24 again and c left less than 24 means what well in d dimension the degrees of the center of mass is d minus two so it's d minus two plus you can write it as whatever it is for example if you write 24 is d minus two plus 24 d minus uh d minus for 24 minus d so 26 minus yes thank you i wrote this correctly now okay 26 minus d you learned that this is the center of mass was 90 degrees of freedom and this should be the bound on the central charge of the group should be less than 26 minus d and indeed this is what we want namely this is always because i'm equal to the rank of the group and so we learned that the rank of the group is less than 26 minus d which is indeed consistent with what we have found there now of course it doesn't still finish the job to show you what which discrete ones appear and which ones don't but at least it gives you that all should be on the right of this and already shows that there should be only a finite list so already it is in the in the line of saying that infinitely many possibilities are not possible and they're gone the same kind of story applies to n equals to eight supercharges which gives you the one which for the n equal to super symmetry again you have infinitely many lists in that case we have we have not we use this uniterity argument on the strings again it has strings and using uniterity we are able to cut the numbers because there are some infinite families that what it Taylor and collaboratives found which we can show it cannot be realized by uniterity but they have other infinite families we have not ruled out yet so there should be other ideas which presumably ruled them out but we have been only able to rule out some of them so I think I'm running out of time so let me just conclude by giving you actually one more set of examples which I actually shows the power of anomalies in these swampland condition and this is related to a I think a very simple observation which has actually deep deep consequences in quantum theory of gravity so in the context of in the context of quantum field theories coupled to gravity for example we are familiar with the possibility of having gravitational anomalies and global and this local and so forth and one of the ingredients of anomalies are deep connection with cobaltism classes for example in d dimensions when you're studying it the fact that d plus one dimensional class of cobaltism can can host the gravitational gravitational anomaly is one of the key ingredients of their vanishing or their class being trivial is an important ingredient here I want to actually argue that a much much more general statement that the cobaltism class of a quantum gravity theory is zero in every dimension so quantum gravity is totally boring as far as cobaltism class goes this is actually one of the deep principles I think of connecting connecting deep ideas of topology to quantum gravity and it underlines a lot of these statements and you might think wait something being zero how could it be useful it's very useful for example in the gauge theories we have anomalies and if anomalies gauge anomalies don't vanish the theory doesn't make sense well so if you have discovered some particles which don't have a vanishing anomalies then you know you can predict there should be other ones which cancel it okay the same here if you define what do you mean by quantum gravity and if you find and compute the cobaltism classes and you find this not zero it means you have not defined the category correctly the categories should be correctly incorporating some other objects that you have missed and so therefore this is going to teach you about new objects in the theory for which this vanishing appears for example if you have a gauge bundle then you can define if you have for example a field strength then you you know you have this trivial statement that the f equals to zero and this statement actually translates to a conserved chart you can define a current which is star of f and indeed d star j is zero so you have a conserved current so this would have given you global charge and this would be a problem with cobaltism classes being non-trivial this can be this can this can give you a non-trivial class here if df is not zero name the churn classes of the of the bundle however we know that we don't want to go we are claiming this is not the case which means that this cannot be zero there must be some sources on this side things like monopole and so forth happens to do exactly that in other words the completeness of spectrum when you have gauge theory is related to triviality of the cobaltism class if you had the u1 theory with no charges you would have extra global symmetries that's not allowed global symmetry is not being allowed is consistent with the ideas of hocking with black holes evaporation that you can throw in charges inside the black hole and they evaporate and they should disappear and so for example in the context that we are talking about so suppose for example you look at spin manifolds the spin manifolds has a cobaltism class omega spin for example the fourth dimension is equal to z and this is generated by k3 so you can throw a k3 inside the black hole now what do i mean by that is that if you take a four-dimensional space and connect it some to it a k3 and and keep a black hole here and throw a k3 inside the black hole and wait till the black hole evaporates you get rid of this class so that means this class which is represented by differential form as the first pontriagin class proportion to the pontriagin class should actually the analog of the correct class should actually have a source contribution on the right side even though the pontriagin class is naively classically conserved which means that there must be some new singularities allowed in quantum gravity to kill this class so so the so there's so the power of anomalies is is all over the place and so this for example predicts the existence of five-dimensional trivialization of k3 something whose boundary is k3 and it's somehow allowed and what kind of singularities there are which does this we haven't figured out exactly but but anomaly predicts there is such a thing moreover this five-dimensional object is going to be non-super symmetric you can show that so the toolkit of supersymmetry is not smart enough to construct this answer but anomaly is smart enough to predict that there must be one so anomaly goes beyond supersymmetry in this case and that's quite elegant that anomaly actually takes over supersymmetry as the leading role in trying to predict some new features and indeed this is quite exciting because the triviality of any compactification in string theory if you look at the downsides if you take manifold and if it's trivial it simply means that any quantum gravity in lower dimension should allow a boundary that means in our universe right now with whatever structure of supersymmetry we have or we don't have we should be able to have a void we should have a boundary of the manifold including a bubble of what we call nothing so you can have a boundary with nothing in it so so this is quite remarkable and more than that you can connect any one to any other one you can put two bubbles together and so you should be able to go from any quantum gravity to any other one that you like if you like a kalabia compactification you should be able to create a bubble in our universe now to go to that one perhaps behind the horizon of a black hole again bubbles from the triviality of cobaltism classes and anomalies so there I start thank you so it's very wonderful if they have only finitely many possibilities but is there one that resembles nature we hope so so but it's not clear yet it's not proven yet no but i think that it's uh it's clear clear to string theory practice that there must be one but but that's not that's not good enough we have to construct common so your basic argument is based on the strength being part of the spectrum what you call the complete spectrum or something but if you assume this doesn't isn't the tantamount to say there's a fundamental string and then you are back to string theory well i'm using string theory as examples of consistent quantum gravities there could have been other ones yeah yeah but your anomaly argument use the string no no no i use the i use so so just to make it clear is that for i didn't get the chance to talk about the dance with eight super charges that's in 6d in that case you find that there are many strings not just one string there's a lattice of strings and i pick the right string for each one of them so there's not the fundamental string i'm not looking at fundamental string it happens in the context of so much higher super smith there's a canonical string but in the general case there is no canonical string and i was using that so so it's not a string theory the the argument i used was the existence of a string like a black brain if you want to think about it like that an existence of an solution to Einstein's equation yeah but if there's a regime in which you can quantize the string you think i never assume that so when i so let me be clear on that the anomalies on the string has nothing to do with whether the quantization of that will give you the fundamental theory all i'm saying is that there's some defect living on it which i can describe see if that's right and you can flow in the infrared of that defect and see whatever you get i'm not thinking that gravity is falling from interaction of that at all in fact it may have nothing to do with it and in some cases nothing to do with it like in 60 k's that i'm talking about it is not the interaction of these strings will tell you anything about the quantum gravity per se but it's smart enough to know that now this is just strings of course it's natural to talk about other defects three four-dimensional defects five-dimensional the system these are definitely worthwhile studying and we're just started that kind of program so the idea that defects cannot be forgotten and they're part of the ingredient kind of bootstraps the gravity super gravity to a bigger structure which must must be much more restrictive and that potentially could be fitting more along the lines of restrictions we see in string theory that's the idea actually i have followed up to to quote this question 10-dimensional is special here because once you have a string in 10-dimensional it flies in 10-dimensional right now the question is target is 10-dimensional the question is is that a critical thing because you have supersymmetry is right amount now it's a claw i mean it's difficult to i had some vapor with ruben and pyrrhorchop if it's close to it right it flies in 10 dimensions it has this many supersymmetry it has muscle spectrum in 10 dimensions and then you look what is the muscle spectrum 10 dimensions actually the same thing that you started is right because it's easily so suddenly if it's 10-dimensional it's because of critical you had in the beginning there was no string so then you have this tau string it flies in 10-dimensional and once you get the stuff back yeah so let me explain again more i'm not talking about quantization of the string in the sense of fundamental string no because what i'm trying to say is that c left and c right are not zero in string theory are zero i'm talking about infinitely long string it's a long string infinitely long string it's not it's not a it's not as usual tiny strings we usually do in string theory of course you could say what if i take fundamental string and stretch it like this that'd be more like the one i'm talking about that's why the same charge is not zero okay going back to your example with the brains and you know local life gauge theories on them so well presumably i can cancel ramo ramo charge i don't know why that's a question in a compactive line yes if that's possible then in low energies you would still have a consistent theory i suppose yes so so then the your statement about low energy quantum is actually a statement about the unicompletion yes exactly so exactly so so for example the that's a good way of asking for example d3 brain if you have this infinitely many d3 brains there's no problem in the in the bulk of the ramo ramo flux for them can go to the bulk but if you had compactified that would correspond to a charge in a compact space you cannot have it of course if you have orientafold you can have a finite number a few more you can add by your interval to cancel the orientafold charge and that's it but there's just a few of them so that's the bound so that's exactly the idea that is once you once you have a restriction based on compactification you get these restrictions and in fact that's a mathematical language compact versus non-compact non-compact things you get infinitely many possibilities compact is finite and that's the a quick mathematical summary of what this this kind of thing suggests questions a trick of some remark yes it's about uh fountimes of calabio it's also a very general idea of gromov about if you have bonds of direct diameter dimension and low bonds of ritchie curvature look at kind of compactness of the whole story and i think it's that's a real reason to believe that they're finding can they can not not just because you have kind of finite limited things you can do but is there is there some upper bound that you can actually give using this for example can you give it can you give it for example a bound on the olec axis of calabio three four no no it's it's more questions that's it's if you get kind of like singularity is it yeah it's it's not effective one but it's rough it's kind of a rough idea of compactness and which it's yeah it'll be great to quantify to better understand that principle mathematically first and then perhaps physically because we don't have a good understanding why i mean it's kind of come but this this is a key principle if if there are only finite number of quantum gravity things it's a great thing because we know we are blessed to be having a quantum gravity in our universe so therefore we are part of that finite set and that will actually be quite quite the opposite to saying oh there's this infinite landscape there's nothing this actually quite the opposite yes we do have non-super symmetric things and there are parts of the swamp land program which have to do discuss what happened to supersymmetry implications for cosmology and so on so it's very difficult and in fact we think it may even be impossible to get stable positive energy in the context of string theory people are still debating it so it's not settled yet but for example one thing we know is that if you if you take a space of this scalar fields the potential that you can get now since you break supersymmetry you can have potentials and far away in the distance of marginalized space the potential always vanishes and fast vanishes exponentially fast the distance why and so on we don't have a deep understanding we have understanding from string construction so people have conjectures about how how this exponential behavior comes about and so forth so there are people have come about with new ideas with breaking supersymmetry and so precisely those kind of questions are potentially very interesting for cosmology and that's one of the areas I'm most interested in applying these to cosmological setup I'm not using string theory I'm using principles I learned from string theory and examples from string theory guide us to what are the correct principles that's the way I look at it but then you could turn the argument around you could say if it doesn't fit our low energy theories then maybe the string theory was not the good setup to start well we don't know enough about low energy what what precise low energy we are in cosmology could be still have our debating what are the possibilities and I mean from all the evidence we are learning is that is the fact that string theory actually is the only game in town I mean I was trying to give you these examples I didn't have to work none of them had to work it's working so why and it's not because we this is just a fine fine a small set we were doing we're just using classification of supersymmetries and somehow string picks them exactly right in in in very non trivial ways can you give some example of a theory of quantum field theory which has completely broken supersymmetry but stays conformal stays con you mean with gravity there's nothing conformality of course on the gauge theory side well there are conformal theories for example in 2d which have no supersymmetry and they're even in 4d 4d people have arguments for example bank bank zaks kind of construction so just well so there are examples if you're asking if there are examples I'm saying there are if I know all the examples no I don't know all the examples or even more precise statement do you have it for in higher than four dimensions but with spontaneous symmetry breaking I mean this flat like a spontaneous symmetry for the gauge theories you're asking yeah you say quantum field theory but formal with well why is this related to this topic I'm not getting a connection to what I'm talking about it's an interesting question but what's the relation you classify the quantum field theories also quantum grab no I didn't play I didn't class of quantum field theories I was mainly talking about quantum gravity theories which which are consistent to ask which quantum field theories it leads to that was a different set the set of quantum field theories is infinite clearly and there are with or without supersymmetry it's infinite there's no doubt about that in my mind the question is which ones arise as good ones within gravity which ones can be coupled to gravity and that's the one I'm saying is only find number of them it could be that the we know with no supersymmetry we don't know which ones would be would even be a stable vacuum and it's possible and I suspect the answer is there are no stable there are no stable non supersymmetry ones so therefore this question becomes a bit a bit strange in the context of gravity what you exactly want so that's not quite well posed that's not the one he was asking about yes you could have you could have asked that question in which case I would say that there are some conjectures at least for the context of what do you mean by non supersymmetric ADS CFD type correspondence that we think that there might be some troubles with the weak gravity conjectures in that context if you take the weak gravity conjection strength thank you


All right. Welcome to the people who were notified about the room change. So yeah, this is like a snow day. So this will be good. So we can really explore things now and take questions, because it's not that many of us. So process management. We were talking about parents and children and that relationship. And today is how to maintain that and lots of fun stuff. But first, let's finish that example from last lecture with execvee. So we saw how to create a process. That was through fork, where you have an exact clone of the current running process. And then the only difference is the return value from fork. That's the only way to differentiate them. So the way to execute a different program and start running it is with the execvee system call. So there is a C function wrapper for it. So it'll do the system call for you. But yeah, it's essentially a one-to-one. So there's just an execvee function. First argument it takes is a path that is the entire directory to get to a program. That will be an l file, like we saw before, because we are on Linux. And then it takes some arguments. So the first argument it takes is argv. So you can think of it as this is what you get from main. If you have argc and argv, well, the way that gets populated is from an execvee system call. So your shell would have taken what you typed and converted it into this format. This format, it is an array of char stars. So it's an array of c strings. And the idea behind that is it's just supposed to end in null. So it's a null-terminated array of null-terminated character strings. So lots of fun. And then the other argument is environment variables called env. They're basically like global variables for processes. But we won't really get into them that much. Just they're passed as another argument. For our purposes, there are some wrappers. So execvee is like the actual system call. But there's a few C wrappers that will take care of passing environment variables and stuff for you. So you don't have to deal with it. But for this case, I'll just say it is null. Now, how execvee works that if it is successful, it will replace this process, load that new program, and start executing it instead. So if execvee is successful, this current process is no longer running this program. It is going to be running another program. In this case, it's going to be running ls. So that is one possibility. The other possibility is that it fails. If it fails and you read the documentation, it will return negative 1. So if it fails and returns negative 1, it would go into this if branch. Part of the spec of reading it is that it would also set this global variable called error-no. I save it here so I can keep track of the first error that happened. Because this pError function, if you read the documentation for it too, it also uses error-no. So there might be an error in printing as well. So I just want to save the first error that happens. This will take the current error-no and try and give you some more readable output with what the error actually is. And then it would return so this process will no longer exist. It will exit because returning from main is the same as just calling exit. So in that case, this line will never execute in either case. So either it will, execvee will be successful. This process will become ls. Or it will go in the error case. There is no case that this print f line will work. So if I go ahead and execute that, I see that I get my first print message. I'm going to become another process. And then I get the output of ls. So any questions about that? Yep. Yeah, so you might have noticed that even if you know, you strace, let's go way back because lecture two, I think. So even when we straced our little hello world example, the first line I told you to ignore from before was that line. But that's how the process started. So I didn't call that. But now we can kind of guess that our shell probably called it because our shell would have had to create a new process. It would have had to fork. And then it would have execveed. And that call is, yeah, from my shell. All right, any other questions about execvee? So we can kind of tell what our shell does now. It would have forked execveed. Anyone notice something a bit weird here too? Why is ls there twice? Yeah, well, this is the actual program to run. And then so for those of you that hopefully everyone that have written a main with argc and argv, does anyone want to tell me what the first argv always is? Or does anyone remember what it always is? Yeah, yeah, so argc is the number of arguments you have. And then argv is the list of the arguments. But specifically, what is argv at index 0, like the first thing? Yeah, yeah, so one guess is the path to the executable. But the answer to that is no. It's, well, in this case, it would be this. So ls would see this as arg0. You might see it as a path. Anyone else use it before and know what it says typically? So typically, it is just the name of whatever you type to run this process, which might not correspond with what the file is. So for instance, I could do that. So if I do this, so I can go ahead, do this. So I change the first argument. Still works. No problem, yep. Yeah, that's a good guess. So one guess is that, hey, is it an alias to run that program? So in this case, I don't have an alias called WTF. But there is a convention that that is supposed to represent what you type to run the program. So if it was an alias, your shell would set that to the alias. And it's meant to represent how you actually executed the program. Yeah. Yeah, so the question is, if I look at this in proc, will the name show up as whatever you have there? I believe so. So there's a few ways it gets names. So there's one way to set name. And then another way is that it looks at r0, in which case it would be this. So I think the default name would be this. But there's also a different name that's slightly different that's based off the path. So you might think this is a bit silly, but this is sometimes useful. For instance, there is just one executable that does CPLS and everything. And it just changes its behavior based off what this argument is. And so it actually reads arg0 and actually does something different to it. Again, typically I said this is a convention. So where it typically gets used is for help messages. So if I do something like this and look for the help message for ls, I see usage ls and then da, da, da, da, da. If I wanted to execute the same thing using execve, I could pass the argument here. And then I have a question. What does essentially this line do? This line just defines an array of characters supposed to represent the environment. I'm not going to define anything. So it's just a null terminated array. So if I just put a null pointer there, it means it's just size 0. So I'm not going to pass any arguments. So in this case, I will go ahead and do help. And then if I do execve this time, whoops. Wait, why did it say it wouldn't save? Overwrite, I don't care. So in this case, if I scroll up to the top and see its usage, it will actually follow the convention. Let's see. So there. So it uses that name there. Is this the name of ls? Not really. It's whatever I told it, I launched it as. So I could just set that to whatever I want. And one of the vulnerabilities is typically that's just a convention that's always set as the name of the program. Well, one day, so people have used sudo to access, become the root user to do something. And lo and behold, it assumed that you had arguments and someone did something like this to do sudo and just didn't pass anything. And sudo tries to access argument 0 without checking that there's at least one element. And that led to bad things where you could become root because you took over sudo because they didn't check the length of the argument. They just assumed it was always true. So that is a fun topic. My screen died. Cool. All right, so let us blast through some of the content because we're going to get into more fun, gruesome names. Oh, yep. Yeah, so the question, if you don't have an argc, you can't pass anything from the terminal. And yeah, so your terminal, whenever you type things into it, it will populate that arg, varray, and argc. And argc is just the number of arguments. So it could be 0 if you want it. So yeah, so it's a bit different. So this is like a go back. So the arguments for this is like a null terminated array of characters. For main, your argv is a bit different. It doesn't have a null pointer at the end. And the way it tells you how many elements there are is by argc. So it's a bit of a different format. But this will get translated into it by all the system calls and stuff like that. Yeah, so it gets translated. All right, so we saw that process state diagram before with the weighting state, which was also called ready, and the running state and blocked. So the Linux terminology is slightly different. The real technical details is it gets a little bit muddy. But in general, it kind of looks like this. You might have poked around in the PROC file system already for lab one. So in that, one of the things is called state. And it doesn't quite line up with our generic states we saw in the last lecture. And again, PROC, every directory there, that's a number. That's a processed ID or a PID. There's also a special one called self, which represents whatever process is currently accessing it, which is done by a bit of magic. But if you go off, read the states, you'll see something like this. There is a running and runnable state, which in our state diagram more or less corresponds to running and weighting slash ready. So Linux doesn't really differentiate between the two. And then it has two block states instead of one. So there is one block state called interruptable sleep, which we'll get into a bit more in the next lecture, which basically just means that that process could be woken up and it could do something, but it actually is waiting for something else to happen. And D, uninterruptable sleep, means that even if you poke and prod it, it can't execute no matter what. It's waiting for some network or something like that. So you can't wake it up whatsoever. And yeah, so you can tell going for the chat question, your shell would, whatever you type something to run, your shell would translate what you type, split it off into argv and then call execve for you. And that's how it runs your program. So now if you really want, you know how to write a shell. So your shell just takes some input, forks splits that input into strings, breaks it up into different string sections, and then calls execve to run that new program. You might notice two more states here that look a bit weird. So there is a stop state. So you can explicitly tell a process to stop executing and it will no longer be able to execute. We'll see how to do that later. And you might see this weird state called a zombie. That is a term the Linux kernel uses. And we will figure out how to create zombies today. It will be very exciting. So let's, there's another question of like, okay, if fork is the only way to create processes, how do you ever create the first process? So the Linux kernel as part of its process of starting, as soon as the kernel initializes all the hardware and everything, it launches one program and one program only and creates a single process. This process is special. It is called init. And by default it is in slash espin slash init. And it has the responsibility of launching every single other process on your machine. So every process on your machine, no matter what will be launched by init or a child of init and it could go on as deep as you want. But the ultimate grandparent or ancestor to every single process running on your machine is going to be init and it is special because it has process ID one. And what makes it really special is that, well, that's the only thing the kernel launches when it starts. And if init dies, well, guess what? Your machine is dead.     So there's lots of different things init could be. On Linux on your systems and your VMs it's something called system D. Some people get into religious wars over it but there's other options, the default one system D. For us it doesn't really matter. You could even write your own init if you really, really, really wanted. We'll see what an implementation of one is. One simple one would be okay. My init can just launch a shell and then I have one shell forever and that's the whole job of init. And then my shell can launch other stuff. So that could be a very, very, a very crude estimation of what init does. Some offering systems might also have an idle process that the scheduler can run to represent your CPU being idle. So you might see that on Windows. Yep, oh yeah. Yeah, the question is oh, well if init dies that means your computer's shutting down so that can that be used maliciously? The answer to that is it could way back in the day but nowadays it's protected. It will check access if you can actually kill it. If you can, you can probably also just type the shutdown command and just shut down the machine. So it's the same thing. So it wouldn't power off but your kernel would be like, okay, we're done here. Yeah, it would probably just get frozen. We'll figure out how to send things.  Yep, yeah. So when you first turn on, so for instance your VM, so because we're talking about Linux, after the kernel initializes all your hardware it will launch one user process and it will be process ID one and after that your kernel is like, you take care of it from here, I'm done. Yeah, so here we can see. So I have a slide for that. So here's like what a typical process tree looks like. So there is a child parent relationship between all of them. At the very top you'll see init. So init part of the things if you will see how to look around but it would launch something like these. These are system demons so they're just doing some background work for system stuff. Then eventually you would log into your machine so that would be a new process. So there is a user specific system D which is supposed to manage all the processes for your individual user you log in as. So this would be what it looks like after you've already logged in. So after you log in you get system D for your user. Then for your VM if you installed a desktop environment and you've logged into it you would also see a GNOME shell. This process represents your actual desktop environment what you see. And then through that you might go and click Firefox or something like that. Well guess what? That launches a process and that process would be Firefox. It would be a child of that GNOME shell that represents your desktop environment. And then Firefox or Chrome, every browser each of your tabs will be in its own process. So in this case it looks like I would have three tabs open and why would it do something like that? Well remember tabs are nice and independent and isolated from each other. So way back in the day Firefox did everything in a single process and if say you dereference the null pointer or something like that, that process dies your whole browser goes down, that's not good. So that's why they re-architected it so that each tab is a new process. So if something horrific happens to one of them it doesn't bring down your browser it just brings down an individual tab. Yeah, that means you have to power cycle it again and then it just restarts and then everything goes back. Like what you guys made me do when you fork-bomb me. All right, so yeah other things that it could look like. So I might launch a terminal and that would be its own process. Now a terminal that's responsible for taking what you type in on your keyboard translating it to bytes and doing the translating it to essentially standard in and then taking whatever bytes it reads from standard out and converting them to characters and drawing them so you can actually see them. And then as part of you interacting with it that terminal would launch a shell and that is what it looks like you're typing into that launches other processes. So our shell would be ZSH. In this case I'm running an application called Htop which I will now explain. So if you want to see this process tree you can run Htop. It's a nice little process manager which is going to be far more complicated than the one you're doing in lab one. And one of the other additional features it has is you can see the entire process tree. So if I go here and type Htop and look it will draw me a process tree. So at the top I see init process ID one and I can see all of its direct children. Then I can see this process also has a child. I could scroll down and see that there's a lot of processes running on the machine. Here I can see some SSH thing that has to do with me and that is running ZSH which is then running bash which is not what I'm currently doing. So that's kind of weird. There's a whole bunch of other processes that you are not expected to know what they do but eventually we can see, hey here's our good friend VS code server. So I can see that this represents the terminal I'm currently looking at. It is running ZSH and I am currently running Htop.  So you can go through, see the parent-child relationship for literally everything. All right, so with that, we will get into some gruesome fun. Oh yeah, and two before. So remember processes get assigned a process ID when they're created and it does not change as long as that process exists. It's just a number and it's unique for every active process and any kind of dying process that we'll see in a second. On most Linux systems, the PID goes up to 32,000. On Mac it's a bit different. I believe that limit is actually higher now on most systems on your VM. It's a configurable thing. So I think on your VM it's actually higher than that. Eventually you might see that the process IDs kind of go sequentially but they don't necessarily have to. It's just the way their algorithm works. Theoretically it could do whatever but computers just like doing things incrementally. So most of the time they'll be in sequential order. So whenever a process is completely dead and the kernel can recycle its process control block and process ID, another process can go ahead and take over that process ID. And also remember, think in this course, that each process has its own address space or independent view of memory and that's just another way of saying that each process has its own virtual memory. So you might hear the term address space. Yeah, so that's a question. Can I not have more processes running than the maximum PID and the answer that is, yeah, no.  And also like one of the defenses against the fork bomb if you try and run it on the ECF machines is they'll limit the number of processes you can create to something low, probably like 10. And then artificially you just can't create any processes. You won't get assigned any process IDs or anything like that. Yeah, so if you do exec VE, it just replaces the process and its process ID stays the same. So no matter if exec VE succeeded or failed doesn't matter, the process ID stays the same until it eventually calls exit. So yeah, it will stay the same. Yep, so yeah, this would be a limit of the number of Chrome tabs you were drawing but after 30,000 Chrome tabs you're probably just gonna run out of memory straight up instead of process IDs. So if that was like, if you were limited by the number of process IDs it's configurable so they would just say, okay, we'll just increase it until you run out of memory. So typically this would not be the limiting factor. Yep, yeah, that's a question. Does PID correspond to the memory that's actually accessible? And no, it's just a number. The refer to that process ID is nothing to do with anything special about it except for process ID one. That's the only thing that's any special whatsoever. And that's just the first thing that the kernel launches. Aside from that, they're just numbers. But yeah, it doesn't correspond to anything. Okay, so now we have to maintain parent-child relationships. So previously I kind of cheated a little bit and neglected to tell you things because I had that little sleep in my parent to make things easier. So I didn't have to explain this part but now we have to argue what happens when children and parents die in unintended orders. So for instance, what happens if my parent process exits first and no longer exists? So my process, which is a parent, has a child process and then I finish before my child. So in other words, the parent dies before the child. What happens to the child? It exists still, that's good, yeah. There's another, you could abort the process, the child. This child already exists so it's like, it's past that point.  Yeah, so the colonel knows which one dies, right? So someone knows and if the parent's dead, well what happens to the child? Does, there has to be a parent-child relationship yet? Yeah, another parent can take over, is that what you're gonna say? It's an orphan, that's actually the correct answer. Well they're both correct, so there's an orphan but that orphan needs someone to take care of it. So you can tell, this is the actual terminology by the way, I do not write letters, I did not make this up, da, da, da, da, da. Like this is the actual terminology. So that is true, so first we have to talk about, well why would it even need to be responsible? So remember when you exit a process, well you call exit and you return a number and that number's supposed to indicate what happened to that process. So zero if it was successful and an error number anyways. So whatever a process exits or terminates, you can't actually reuse its process ID yet because someone needs to read its exit status to see what actually happened to it. So even though a process terminates, it still needs a process control block. So it might not be able to ever run again but it has a process control block that stays around and one of the things that would be in it is something like its exit status. So the rule is that if a process exits, someone has to acknowledge it in order for its process ID to get recycled in order to completely clean up the resources and completely delete it. Otherwise you might get in the situation like you might think, well why don't I just, I have a child, I know it's process ID, why don't I just pull it over and over again to see if it's still alive? Well that doesn't quite work because what happens if my child has a process ID of 60 or something like that, I look to see if it's alive, it's alive and then before I recheck process ID 60 again, my child could exit and then if it was immediately cleaned up, well then the kernel could reuse process ID 60 for some completely unrelated process that is not my child and then I would read it again and be like, oh my child's still alive when really that process is completely unrelated to me. So that is why there's this acknowledgement step because that's the only way the offering system knows that you're completely done with the process, you acknowledge that this is actually your child, it is now exited and terminated, you saw what happened to it, now I can clean it up. So with that, there is two situations. So either you can have a child process and then it terminates first and what is that called? That's called a zombie process. Again, technical term, we saw it at the beginning and that is what it is. So a zombie process, why is it called a zombie? Because it's a process that's not quite alive, it's terminated, it can't execute anymore, it can't run, it can't do anything, but it's not quite dead because it has a process control block still. Someone needs to read its exit code, it's still consuming some type of resources so it's not completely alive, it's not completely dead. Zombie is a perfect word to describe it. So that just means it's still around, it's consuming some resources and we need to do something about it. And the other one is like we said before, the parent exits first, in which case we have an orphan process, that child is now parentless. So the system call to actually acknowledge something is called wait, it has the following API, it takes an address to an int and then as part of this system call, it will block by default until the first of your children has terminated and it would acknowledge them and then fill in that status with a bunch of information that you can query to see what actually happened to that child, how did it get terminated and what are things about it. So wait will return a few things, will return a few things, so it will return negative one if it fails, like all the functions will pretty much see. It will return zero, which is an invalid PID because by default it will actually wait for a child to die, but if you don't want to wait and you want to just pull it and see, hey, do I have a child that's dead? Well, then there's an option to make it just query it and not wait around and not block. So that will return zero in the case that we acknowledged it, we will get the process ID of the child that has terminated. So that wait status contains a bunch of information, we'll just look at the example, you have to use macros to kind of query it and you'll have to read the man page for wait to figure out what you have to do with it. So if we go look at our wait example here, let's move this to do. So in this case, if I run it, oops, sorry, I will move this down. So I have main, it forks immediately, so it creates the child process and we still have our parent process. Here, the child would get process ID zero. So in the child, I sleep for two seconds, it just goes to sleep for two seconds. In the parent, I print f that I'm calling wait, I create a local variable called w status, which is an int, which I will give it the address of and then it will write a number to there that you shouldn't look at directly, you have to access some macros, but eventually wait will return whenever my child has exited. So the child should exit after two seconds, it would come out of, it wouldn't go in the else branch, it would return zero, which would exit the child. So the child should exit after two seconds. And here, I call wait and then when wait returns my child has exited. So this hopefully will happen after two seconds and I will get the process ID of my child, which is now dead. And I can check, if you read the documentation, you can ask the w status it fills in, w if exited, so that will return true if the process exited normally. In our case, we'll just assume it can always exit normally for now and the next lecture we'll see other ways the process can exit. But if you read the documentation, if this is true, then you can read the exit status through this macro and it will tell you the number it returned. So if we go ahead and run this, we should see calling wait, it'll wait two seconds for the child to die and then it will say wait return for an exit process gives us the process ID, which since it called wait and acknowledged it, this process ID now no longer exists because it can get cleaned up because it was acknowledged and the status that we read. So any questions about that? Yep. If wait returns zero? Oh yeah, so this is a child process here. It just goes to sleep for two seconds. Yeah, so the parent waits until the child exits. Yeah, so in this case, because the child takes two seconds to exit, wait won't return until the child's dead. Yep, yeah, so wait will return. If I had multiple children, wait by default returns whenever the first one exits. So if I launch a bunch of processes, I don't know which one's gonna terminate first. The kernel will wake this up with whatever terminated first. Yeah, so that's a good question.  So if I had two, if I create two children, I need two waits. Yeah, they would each return the process ID of the child, right? And then you can query it. Yep, yeah, so that process ID is now, the kernel can reuse it for whatever it wants. Yep, yeah, and that was for the child process. And yeah, so in this case, wait won't return zero because that's like the non-blocking wait. You can, if you read the documentation for wait, you can just have wait, not wait until the first child to die and it can just be like return me the process ID of my terminated child if there is one, if there isn't return zero. So that's an option you can have. Okay, yep. Oh, yeah, so that's a good question. So what happens if the child calls wait here? Something like that. So without running it, because I think I have to go quick. So wait will return error code if you don't have any children because the kernel will be, the kernel knows all those relationships.  You don't have a child. So that would, I would get the same thing if I also called wait again here. So I create one child, I wait once, now I don't have any children.  So they'll do that. And the kernel takes care of it. But you're responsible for calling it. Right, so that's part of being a good parent for your operating system. So there's the wait, so yeah, what's the zombie process? So it's waiting, a zombie process again, that child is gone and it is waiting for its parent to read its exit status. So there's a few things that happen. So whenever your process, your child process exits, we'll see how it does this in the next lecture, but the kernel will poke you and say, hey, while your children has terminated, you need to acknowledge it and you're free to ignore that. You can be a neglectful parent if you want.  So yeah, and that is basically a form of an interrupt. So the kernel will generate an interrupt to your process and say, hey, while your children terminated, you should probably acknowledge it. And because it's an interrupt that you write, you can be like, yeah, no, I'm good. I don't need to. So yeah, in which case the operating system has to keep that process control block around. And that's where it gets into that zombie state that I talked about earlier, where it's neither alive nor dead, yep. Yeah, so that's the question.  So waiting, you can only wait on your direct children. So why you say direct is because, well, you're the only one that can create processes so you know how many you make, right? But still the user is interacting with your code. Your code's still making the processes. So yeah, if you lose track of the number of children you have, like in real life, that's probably not good, right? So yeah, if you have children and you need to keep track of your direct children and say you were the one giving birth to the child, you'd probably know how many you had, right? So yeah, that would not be a great case, yep. Yeah, so that's a question, the example from yesterday was I created a zombie process and the answer to that was yes. But they just kind of waste resources so it's not a good thing but my code was not great. So let's look at a zombie process, so zombie. So here's an example of a zombie process. So I'll do the same thing, I will fork again, let's assume it's successful, the child's gonna do the same thing where it just sleeps for two seconds and then it terminates. Now in the parent, I will go ahead and sleep for only one second and then I'll get woken up so I should be woken up while the child still has two seconds left before it terminates and I will print off the child state and then I wrote this little helper function that just accesses the proc file system and prints off the state that it finds in the status file. So I'll read the state, check for any error codes, hopefully I can program and I don't get any errors but always good to check. Then the parent's gonna sleep for an additional two seconds so it's gonna wake up from this after three total seconds have elapsed so my child will now have exited but I didn't call wait or anything and then I will read the child's process state. So if I read that you should see that the term zombie is a real thing. So first time it's sleeping so that makes sense, it's still alive and then after another two seconds it's now in a zombie state which the kernel keeps track of, right? It's not some word I made up, it's literally called a zombie state. So it's process ID is still valid but it can't execute or anything and it can't get completely cleaned up it's wasting resources. So if you just launched infinite processes and they were all zombies then eventually you're gonna run out of process IDs or memory depending on how big the process control block is. Yep. I checked my child's state, yeah, with its process ID. Yep. So here the child sleeps for two seconds and then exits and then in the parent I sleep for one second and then I read it state and then I sleep for an additional two seconds so three seconds so the child should have exited by then and then I see it's a zombie, yep. Yeah, so that is the next thing we'll do. So the question was basically what happens if the other thing happens where the parent exits first and not the child? Well, that's an orphan process and it needs a new parent. So yeah, the child process lost its parent process. The kernel is really strict about maintaining that parent-child relationship.  So the child needs a new parent. It is called an orphan and it still needs something to acknowledge it. By default the operating system is going to re-parent an orphan process to that special process init which again is process ID one. So we might have seen it before. Whenever I ran it I saw like the child's parent ID was one. Well, that was the rare case in that code where the parent exited first and it was an orphan process and it got re-parented to a init. So you can also think of init as the orphanage if you want, that is a good term for it. That is nicer than the real term, yep. Yeah, so by default whenever, like if there's a grandchild or something like that, the kernel only cares about direct relationships.  There is an exception to that though and the exception is you can designate a process as being special to essentially become an orphanage and you will accept any grandchildren that die and they'll get re-parented to you instead of a init and that often is called being a sub-reaper. So a nice gruesome name and actually the technical name orphanage was a nice name for a init. Its technical name is the reaper, like the grim reaper. So yeah, so init, technically it's called a reaper and now we know kind of the other part that would be in init. So a init would just, a well-written init would launch some processes and then whenever it's done launching processes at the end of it it would be like, while true, wait and then it would clean up any orphans it gets. So here is the orphan example. Let's do this really quick. So in the orphan example, we'll fork again and in the child we'll see whatever its parent is immediately we'll sleep for two seconds and then we'll check what our parent is again and this time in the parent process we will only sleep for a second. So we will not last that long and we can see that we have an ID and then we see that the child's parent ID after the sleep is one, so it got reparented to init. All right, any questions about that? Yep, yeah, so that's a good question. If a zombie's parent dies does it become an orphan? So yeah, that child process could be a zombie because the parent process just never acknowledged it and then at that point it would become a zombie orphan process and then it would get reparented to init and then init would acknowledge it and then it would get cleaned up. Yep, yep, yep, yep, yep, yep, yep. Yeah, so the kernel will reparent it to init automatically that's just part of what the kernel does and then it would be init's responsibility to call wait. So because wait waits for the first process to die if you just had while true wait then you would acknowledge them as soon as they come in. As soon as they exit you acknowledge them you just do it over and over again. So the simplest init you could write would be like launch some process and then while true wait to clean up everything. Yep, no, so here the parent process just sleeps for a second and then it exits and returning from main is the same as exiting and exiting will terminate a process. Yep, so the question is if I am a process and my parent dies then yeah, then it would get reparented to init but your child is still your child it would still think it wouldn't get reparented to init because you're still alive. Yeah, so you only get reparented when your direct parent gets terminated. Yep, yeah if you wanna think of it that way but the kernel doesn't really care about grandchildren or anything it's just parent child. So it's like wherein this is the parent child so like here, oops, yeah, so this would be just a bunch of parent child relationships here. In init is the direct parent of journal D, system D, user and Udev or whatever and that's all the kernel cares about and the kernel just cares about this relationship and if for some reason you break this, like if this process dies before this one starts running this just gets reparented all the way to init. Like if this one dies? This? Yeah. Yeah, so if no shell dies then Firefox would get reparent, then just this process would get reparented to init. So the other ones would stay so this would just get reparented to init and all these processes, their parent's still alive because it's just this one, so nothing changes. Yeah, for them nothing changes just the direct parent changes. All right, I guess we're over time so just remember, pulling for ya. We're all.


Well, just next door at the same time, Walker-Hackensack, Aiklin, Minaga, 1-0 game to the six, Braves break it open. Kenzie Keiko, drive to the left-centered gap. That'll play 1-2-0 black, then Haley Hegar gets into the action. Back up the middle for the RBI single. That'll extend their lead, but they aren't done yet. Rachel Kicker hits 1-3. Play at the play, but the runner is called safe. Minaga will win this one. They'll hold on down the stretch. 5-1, the final. If you've enjoyed this segment of Lakeland News, please consider making a tax-deductible contribution to Lakeland Public Television.