Welcome to this very first lecture on structural dynamics. In today's class, I would be just giving you a brief introduction about this course and that will include the concepts that you would be learning as part of this course. Then I will give you a general idea of what is a static loading and what is a dynamic loading and what are the key differences between dynamic and static loading in terms of their effects on a structure. Then I would be discussing the problem statement that you would encounter as part of this course, so what problem to solve and then different solution methods that we could potentially employ to solve though that problem statement. So let us get started. In this very first lecture of structural dynamics, we are going to discuss about this course. What are the different concepts that we would be going through this course? What are the objective of this course? What is basically a simple difference between a dynamic system and a static system and then I would be presenting you the problem statement for this course that we would be studying. So without getting much delay, let us go through this course. If you remember from your undergraduate knowledge, you used to find out forces and deflection or different response quantities subject to a load say p0.  Now remember never at a point at any point of time you were told how the load p0 is actually being applied. So it was just said that a static load of p0 is being applied on this beam and then you needed to find out the response quantities such as forces and deflection. So my first question to you, can you tell me if I have to ask you how is this load p0 is actually applied or let us say in general how a static load is applied. So what I mean to say if you have to apply a static load of p0 on a structure, what would be the time variation of it? So that is my first question. My second question to you is what is the deflection of this beam subject to this point load p0. Now you know it from your undergraduate studies that if the load static load p0 is being applied, you calculated the deflection at the midpoint as the maximum deflection and the value was pLp0Lq by 48EI. Now the question is, would this load or would the deflection be always p0Lq by 48EI, okay? So that is my second question, okay? So what I am showing you here, the question is how the static load p0 is applied and I am showing you four options. If you had to represent the time variation of this load p for which the maximum value is p0, how would you describe this static load? Okay, so I have shown you four options, okay? So you need to select one of these options. If you would like, you can scan this barcode and open up a form which would show you all the option and then you can select the correct answer and then it would show you whether the selected answer is correct or not, okay? So let us discuss these four options. So in the first option, I have load p0, okay, which is being applied like this, a constant load p0. But do you think it is physically possible to apply a load like that? Like it suddenly goes to p0, okay? We will discuss about that. In the second figure, you can see I have a maximum load of p0 and then it decreases slightly so that it goes to a value of 0 over a certain duration. In third one, I have a load p0, okay, which starts at certain time, t1, it goes to p0, it is maintained over a certain duration of time, then it again goes to 0. Then in the third one, I have a load which is gradually being applied so that it reaches to a maximum value of p0 after a time duration. Let us say we will call this TR or the rise time, okay? So which one do you think can be used to represent this static load that you have studied till now, okay? If you think about it, the only load that could be or the role representation could be used is actually this ramp load here because if you try to apply this load or this load or this load here, you would see from the principle of dynamics that you would study later, they could never have a static load application through any of these representation, however, if you consider the fourth option here, depending upon the time value of TR, you might be able to apply a static load, okay? And we will come to that, what do you mean by static load and dynamic load, okay? How do you characterize actually, mathematically how do you characterize static load and dynamic load, okay? So this was the first thing you heard about, you used to do analysis subject to certain kind of load, let us say p0 is equal to 10 kilo Newton or 20 kilo Newton used to find out like, you know, the response, okay? But now you need to understand how the load p0 is actually applied. Now, let us come to our second question, okay? So my second question is, out of these four options or the four load representations that I have shown here, which one would give you a deflection that is most likely to be the value p0L cube by 48EI, okay? So you have to select one of these options depending upon the plot of p versus T that I have shown here, that would give you a value that is closest to p0L cube by 48EI. Now again, you can scan this barcode using your phone either through an app or through your camera, okay? And then you can submit the answer and see the correct answer right here. Now let us discuss each of these options that have been provided here, okay? So the basic difference between these three plots, A, B, C, what do you find the basic difference? It is basically the rise time that you see. So you can see TR is an intermediate, this first option has an intermediate rise time. The second option is the fastest rise or I can say like the smallest rise time, okay? And third is the largest rise time, okay? So what I mean by this is that this load is being applied fastest, this slowest and this is somewhere intermediate between these two, okay? Now I can simply discard this fourth option because this would never produce a value of deflection that is equal to p0L cube by 48EI, okay? So my, the computation is between these three options here, sorry, okay? So what you would see that out of these three, the loading that has the largest rise time would give you a load which is closest to being a static load and we will see why, we will see like you know mathematically we will also prove that, okay?  So this one is most likely to give you the value which is p0L cube by 48EI, okay? So now let us come to what basically defines a dynamic system, okay? So as we discussed dynamic system deals with the variation of a state of a system or structure with time, okay? Of course under application of external load, okay? So I will write under application of external load, so load, okay? So again I have shown you that representation, a load representation that is used that can be used to represent a statically applied load of the magnitude p0, okay? Now we saw that a parameter to determine whether a system would behave as a static system or a dynamic system under the action of external load is TR, right? We saw in the last slide depending upon how fast you apply or how slow you apply it might behave like a static system or dynamic system, okay? To demonstrate that I will give you a simple example, okay? So let me show you a spring, okay? Which has a mass m and k and another spring, okay? Again same mass, so both of these have same system properties but now I am applying a load p, okay? Of final magnitude p0, only thing in this one TR or the rise time is much, much greater than TR in the second one. So in this one load is being applied slowly and in this one load is being applied fast, okay? Now can you imagine, okay? Forget about mathematical formulation. Let us just talk about like, you know, have the feel of the system, okay? First develop appreciation from the real life examples then we will get into mathematical formulation. So in this case, as you can see if the system are same and I applied two load of final magnitude p0, however if one is applied slowly what will happen? This spring won't vibrate as much as if you have a load that is being applied suddenly. So in the first case load representation is something like this, in the second case load representation is much more sudden, okay? So I can say TR plays an important role in determining whether the system would behave as a static load or a dynamic load, okay? Now can you imagine some other parameter of the system that would determine whether the system is static or dynamic? For example, again consider a similar example except in this case, let us say mass, let me keep the mass same but I have K1 and K2 and in this case K1 is much smaller than K2. That means this is a flexible system and this is a comparatively rigid system. And now I apply a load which has the same rise time. So both load of final magnitude p0 applied over the same duration. Now can you imagine if it's a flexible system then it would vibrate more and if it's a rigid system it would vibrate less. Of course I am doing a relative comparison between these two. So compared to this system I would see that load p which has which is a ramp load it would lead to more vibration in a flexible system compared to a rigid system, okay? And I would come to technicality later like you know what do I mean by more vibration less vibration in terms of what response parameters but in layman terms just try to understand something like this. You can appreciate this example from a real life let us say a pedestrian bridges that you see for example like you know the Jhula bridges that you see in some villages you know it is also called a suspension bridge. So you have something like you know let us say bridge which is very flexible and supported at the end and then you have river going over like this, okay? You can imagine you try to walk very carefully very slowly here because if you jump it would start vibrating because this is a flexible system. So the dynamic effect would be more however if you have a rigid system like a concrete slab bridge okay which is much more rigid than this you don't need to be that careful as you would like you know in the case of a suspension bridge or like you know just a hanging bridge, okay? So the second parameter that determines whether the system would behave statically or dynamically is the flexibility of the system or more appropriate if you would see later is the time period. So it is mass and k. So these two parameter and if I represent time period as this is actually what determines the second parameter, okay? So depending upon the values of tr and tn we can decide whether the system would behave as a static or dynamic under the action of an external load, okay? So this thing you need to keep in mind, okay? We will come back to this later and we will try to do mathematical the derivation of whether the system would act as a static or dynamic, okay, alright? Now let us come to classification. So we saw that we have a ramp load here, right, okay? And if we increase the value of tr to like in a very large value then we can represent it as a basically a static load, okay?  And we said that is a static load, okay? Can you tell me why the dead load was considered as a static load?  Self-weight of the structure or anything that is attached to the structure is considered as a dead load. And remember that dead load is not applied suddenly to the structures. If you are building a structure you would do it over a day or like you know over days, over months, you know, so slowly you are going to over concrete and build the structure, okay? So it is applied over day and then you also have live load. Live load could be like you know the habitant or like you know people that are going to occupy that building or things that could be moved, okay? So that would be considered as live load. Even that would be applied slowly, okay? Of course we are not considering live load analysis like a vehicle moving on a bridge or something like that, okay? Live load we are simply considering due to weight of like you know people or like you know things that could be moved during the life of the structure, okay?  Now in terms of dynamic load, we can consider earthquake load, wind load, impact load, blast load or tsunami load and why do we consider these are dynamic load? If you consider an earthquake load, can you tell me what is the typical duration or can you think what is the typical duration of an earthquake? Maybe let us say 15 seconds, 30 seconds, 1 minute, something like that, okay? So structure is applied a very heavy horizontal like a very large horizontal road over a very short duration. So this TR is very small, okay? And depending upon the time period of the structure, it could lead to dynamic effect, okay? And then I can also have wind effect and depending upon like you know at what rate the wind is flowing or at what velocity the wind is flowing, I can have very large dynamic effects in the structure. I could have impact which is like a sudden impulsive load or I could also have blast which is also like an impulsive load and then I can also have tsunami load which is like you know sustained load over a little bit larger duration of time than the impact and blast load. So these type of loads are characterized a dynamic load due to their duration over which they are applied to the structure, okay? And the typical time period of the structure, okay? So keep these things in mind, all right? Now what I am going to do, I am going to show you some videos of previous loads or like you know the real life example of different dynamic loads that we have mentioned in the last slide. First I am going to show you basically one of the few images of the Bhuj earthquake that happened in Gujarat and you can see what kind of damage it resulted in. So all these buildings, most of these buildings were designed adequately like you know I can say for vertical loads, you know they were designed for vertical loads but I am not sure whether they were designed appropriately or adequately for horizontal load. So earthquake is in horizontal load due to shaking of ground motion. It leads to horizontal load on the structure and this because of inadequate seismic design it led to like a lot of devastation during the earthquake and loss of precious lives. So this is the example of what dynamic load like an earthquake can do to the structure. Then here is a video of Nepal earthquake. You can see this is a live CCTV video at that time and it is showing like you know you can, I will just show you like in a small clip. You can always go to YouTube and see like you know in detail that all the clips you can see let me run this video so that you can see it here. So you can see the shaking happening and soon you will see like you know the intensity increasing and lot of structures. You can see that there is a structure that just fell ok. And there are like you know 10 different footages at different places. So let me, so you can see another footages here I think the structure already collapsed. So you can see the effect of earthquake on this residential house as well, lot of pots falling around and people coming outside ok. So you can go and search on YouTube like you know different type of earthquake loading and the failures on the structure and you can see like you know what is the effect on different structures around the world like you know during different earthquake ok. Now the second type of dynamic load that we discussed was wind loads. What I am going to show you, this is a suspension bridge known as Tacoma Narrows Bridge. You can see that one morning due to wind effect what is happening is actually what happened. Lot of wind started flowing below the deck and due to pressure differential it started creating torsional motion of this deck ok and which finally led to failure of the suspension bridge precisely the deck of the structure ok. So let me just play this video. Of course there are lot of failure studies which would more accurately describe the failure mechanism and what led to this failure can go ahead and look if you are more interested go ahead and look into those studies ok. So you can see this deck of the central span wobbling vigorously and the amplitude keeps on increasing. So I am going to fast forward this video so that I can show you the final failure video of this one ok. Let me again go here this is showing the front view of actually the funny thing happened one of the dog was actually left in the car and then the owner of the dog actually went ahead and then actually rescued like in on this wobbly deck. You can see that the amplitude is increasing. I am again going to fast forward this video so that so we also have a suspension bridge right. We have a suspension bridge in Bandaravadali ceiling if you have not gone there it is a great engineering structure you can always go there just to have a look and look carefully at the suspension bridge that we have there. So you can see that due to increased basically deflection because of the wind load it finally led to the failure of the deck span ok. So and now like in all these type of structure need to be designed against such wind load so that even if there is a constant energy infusion due to wind then there should be some energy dissipation mechanism and which we will learn later so that it minimizes or it actually like you know truncate or basically it keeps the amplitude within a certain limit even if there is a constant fusion of energy ok ok. Now let us go to the next video not yeah this is crash test video so the third type of dynamic load that we talked about is impact load which is a short duration pulse ok. So this is one of the test that was conducted now if you like you know because of the security threat many of this structure now need to be designed against aircraft impact and this was one of the experimental test done in which a concrete wall actually was hit with a phantom F4 aircraft and then it was seen whether the aircraft would be able to take that load or not ok. So let me just play this video. So what do you think whether this aircraft whether did it breach the wall or not well it just so happens even the load was very high the wall was designed in such a way that there was lot of damage due to this impact however there was not a complete breach and that is what these walls actually designed for heavily reinforced concrete walls are designed for ok alright. So I am going to go to the next slide next type of blast impact sorry dynamic load is a blast load what I am showing you a building before and after bombing this is a building called federal building Alfred P. Mura building in Oklahoma City and it was bombed in 1995 using explosive kept in a van the explosive weights were 1800 kg what it did actually it due to the blast it took out the columns here columns and been here and it led to so first it led to the removal of columns here and then because of the blast pressure shock wave there was an upward pressure on these slabs which they were not designed for ok. So due to this it led to the progressive collapse of the building and finally what you see here is the building partially collapsed so I think lot of fatalities happened around sort of total number goes around 160 people died in this building so now many of the buildings are whether it is there are critical like you know civil building civil building means like you know for civil purposes non-military purposes they are now being designed aircraft buildings are being designed some operation control centers are being designed for blast loads and also military structure defense structure have always been designed for these type of loads ok.  So, they are asked requested to break their steps breaking their steps mean walking randomly so there are multiple frequencies with very small amplitude ok but not a single frequency periodic load with a large amplitude ok alright. So, let us go to the pretext of this course ok so what you see here what is the problem statement ok for this course or what we are trying to do here ok so the problem statement is how to build a structure that can sustain those dynamic loads that we have discussed in previous slides and mitigate their detrimental effect ok so that is a larger goal ok and what is the solution for that well the solution for that is to design structure for dynamic effects of load ok very simple right but it is not as simple as this statement make a sound ok. So, what is required to do that well first I am showing you a structure here this is a like you know I mean you can think of like you know building structure here to obtain and design a structure first what you need to do create a numerical model of this structure ok because you cannot have a numerical model that includes each and every minute detail of any system or a structure ok so you need to create a simplified representation which might be single degree of freedom system or if you need depending upon what is your response quantity of interest you might create a multiple degree of freedom system ok what is the next step then well once you create a simplified model you need to find out what are the stiffness what are the damping properties and then from that what are the time period of the structure what is the damping is basically represented let us say representing it by viscous damping so you need to find that out ok and then you need to find out the dynamic loads that are being applied so in this case let us say I have an earthquake here horizontal earthquake so I will represent it through some like you know time history function ok and then I have a numerical model and these time history function the next step is to find out the dynamic response of this structure so response means what are the forces the base here let us say what are the moments in the members ok what are the displacement here those are the typical response quantities once we have that I can design my individual component or overall structure to accommodate those kind of forces and deflections ok and the final step once I have that is as I said to design the structure to minimize and sustain those dynamic load effects ok now first three steps are analysis steps ok and the fourth step is basically a design step now the scope of this course is to study first three analysis steps so we are not going to do go ahead and go design structure but definitely we are going to study first three steps so structure through this structural dynamics course we are going to analyze system and find out the response ok there are other courses that are there and which we will see subsequently that will discuss how to design the structure once you have the effects of dynamic loads figured out clear ok so that brings us to the context ok so the context is where does this course you know whenever you start a course for the first question you should ask why I am studying this course ok what I am going to achieve through this course ok and how does it fit into a bigger picture ok so let us say if your goal is to become a structural designer or analyst or like you know computational mechanist so you have to first find out what is the utility of those course and how it is going to be useful and how does it fit into the bigger picture now let me draw out the whole curriculum and then show you like you know how does this whole thing actually builds up to work towards a greater goal to equip with you equip you with the skills that are required to work towards designing a structure analyzing a structure ok and finding out or basically building safe and economical structure ok now in your undergraduate you would have studied a lot of subjects now let us see where those subjects actually fits into this picture ok so what are the steps required to design a structure as we discussed before well the first step you need to find out forces on a structure right and which course did you study to find out forces on a structure well it was the first course was engineering mechanics right now forces might not be enough right because most of the times failure criteria governed by the stresses not the forces ok so to get the internal stresses and strains you studied solid mechanics ok now after you studied how to get the stresses and strain you also needed to find out how to get internal forces and displacements in a structure and what did you study for that basically a structure analysis course ok and finally when you were equipped with all the analysis courses ok all the analysis courses then you studied specific courses that were for the design of different type of structure so whether it was a steel design course and concrete design course ok so these were at very preliminary level very basic level now at the advanced level in the graduate curriculum let us see what are the courses and how does this course fit into the bigger picture so now what are the steps required now for advanced analysis and design ok so you did basic analysis and design in your undergraduate let us see how do we do what are the steps required for advanced analysis and design so to find out the same the forces on a structure now you do advanced structural mechanics which discuss advanced methods of analysis ok and then you also now study a course which is called advanced solid mechanics to find out stresses and strains in your undergraduates you mostly focused on linear stress and strains however in a graduate you might do linear and non-linear both ok and then to obtain forces or stresses and strain you need some knowledge of numerical methods ok and to learn those numerical methods you take or you are going to take a course which is called numerical methods ok which is part of a curriculum that we have a department also has ok and then till now whether it is undergraduate curriculum or graduate curriculum these courses were focused on static again these courses are focused on static I mean you can do a dynamic like in advanced courses but the first course that you have which deals with the dynamic effect of loads on a structure is this course structural dynamics because most of the loads are actually not static they are dynamic even when you call a load as a static they are still a dynamic load which has a variation with respect to time but applied very slowly ok so I hope the context of this course is clear to you ok so again let me come to the problem statement so what through this course we would be doing first we need to find out what is the load that is being applied on a structure ok so first we need to determine the load history ok the second step is develop mathematical model of a structure so whether it is a building or whether it is a vehicle or whether it is any other type of system I first need to represent that system or a structure through numerical model or a mathematical model ok once I have that with this loading history and the mathematical model of the structure I would set up what is called equation of motion so I would formulate this equation of motion and we would see how to do that for different type of system and you can extend that to a you know very simplified as well as complicated systems as well so I need to first set up this equation of motion and then solve this equation of motion alright ok now the set after this once I have the equation of motion set up I would find out the response quantities ok so obtain numerical response and what are the typical response quantities I am interested is in they could be this could be displacement velocity acceleration and force ok these are the response quantities I need to find out so these are this is the basically the problem statement and basically through different chapters of this course we are going to addressing one or multiple steps at a time ok so keep that this problem statement in mind ok when we will go through different chapters alright now let us look at how do we obtain this load history what I am going to do I am going to present in front of you typical load history that you a structure or a system might encounter in real life so the first one is a harmonic loading which might be a sinusoidal or like you know cosine loading this type of loading you can imagine due to some machines on vibration happening due to machine attached to a floor or like you know other type of harmonic basically machines producing harmonic motions ok the second could be periodic loading a periodic loading might not be harmonic but harmonic loading is a periodic loading so just keep that distinction in mind so periodic loading is something that repeats after a period which is t0 here ok so what I have shown here is basically this is like a representation of a walking load ok of course this is a zoom a uniform walking at like you know at a fixed pace ok but this basically represents a walking load ok then there could be earthquake load which is more like a random excitation ok there could be a wind load which again could be represented by these random spikes which represent the pressure peaks ok there could be impact load which is like a sudden spurt of a load ok for a very small duration of time and there could be a blast load which is like a sudden spike and then decreased and this duration is actually very small ok so I have shown you some of the load history that a structure might experience these are the load history and typical load scenarios that would experience in while obtaining dynamic response of a structure ok so once you have the load history second thing we talked about is mathematical model of the structure and pardon me for the mistake here so in mathematical model of the structure I can represent my structure using a single degree of freedom system and I will tell you like you know what does that mean the degree of freedom in a later slide let us say I have this pergola type of structure where this is like a walkway in which your heavy slab is actually connected or supported through these steel columns ok or you have a water tank in which again a heavy mass is connected through this column so this can be simplified through a single mass and then a single stiffness component represented by this column and this is called single degree of freedom system or we could encounter like you know more complicated system in which I have a very complicated structure and I might decide to simplify at simple beam columns and then applied by loads here so the slab loads and everything can be applied here ok and then horizontal load might be applied here or a vertical load might be applied here depends ok now this is this structure can be further simplified if we assume that the all mass of these loads are rigidly connected to each other and the flexibility is basically represented by these columns so I can further simplify this system through this three degree of freedom system ok now you would ask which is the appropriate representation well it depends on your problem and it depends what are you trying to achieve through that problem ok so for some system even this could be represented by a single degree of freedom system ok if let us say your goal is to find out what is the total base shear and not what is happening in the structure above ok or if your goal is to find out what are the story shears ok then you need to represent it through a shear type building or building like this ok so it depends on what are you trying to find through that that problem ok so coming to what are the different components of a dynamic system you have to think about what happens when a force is applied to deformable body forget about this slide don't look at this slide right now but just think you have a deformable body and then you apply a force force that is varying with time ok so can I say if you apply a force on a deformable body then there would be an acceleration so motion or acceleration let us say motion acceleration and if it's deformable then of course there would be deformation and can you imagine if I apply a load to a structure there would be some sort of energy dissipation so in reality every system every system every structure in reality would dissipate some amount of energy when you apply a load it might be small so in some cases it might be neglected but in for all practical purposes there is always some energy dissipation ok so the third component is energy dissipation ok so considering these points in mind any structure or a dynamic system has three integral properties which are mass which is basically ability to resist acceleration ok then stiffness which is ability to resist deformation and then damping which is the ability to dissipate energy ok so a simplest representation of a dynamic system is a spring mass damper system ok and this is called a spring spring mass damper representation and if this spring mass damper system is acted upon by an external force f t there would be a response which is here displacement ok so I can say the dynamic behavior of any system can be studied by modeling it as a combination of spring mass damper system ok so although I have shown you here a single spring mass damper system let us say even if I have like you know interconnected body I can lump the masses ok I can lump the masses connect them with a spring and a damper like this ok connect them by spring and damper ok and each of them can be connected through each other node ok depending upon what is the connectivity ok and through this any system can be represented by like you know a spring mass damper ok so what I need you to do basically when you are doing this close try visualizing every system what you see around yourself as a representation of a spring mass damper ok and of course if you can tell me that to solve this system I need to represent it with some additional properties then let me know because this I find is the most simplest representation of a dynamic system ok so what I want you to do ask yourself few questions at this point of time ok in this introduction slide how the car shock absorption works ok so you have cars or like you know any other vehicle ok and like you know our Mumbai especially Mumbai is famous for potholes or our Indian roads are famous for potholes and all the cars or any type of vehicles are actually equipped with shock absorption so we need to imagine how would that actually work and if somebody has to design that car shock absorption how would they do it what would be the critical parameter ok then what I want you to ask yourself you guys have travelled by train and you must have seen or the metro you must have seen there are blast or crushed stones like you know below the rails ok what is the function of that one why can't I just have like you know rails on the top of let us say concrete slab ok and then just run vehicle on the top of that so what is the utility of that ok and then you might have also travelled by aeroplane have you ever noticed which wheel the aeroplane any aeroplane lands on whether it is like you know front wheel or the rear wheels so just try to notice that next time and try to find out the reason why the rear wheel or why the front wheel ok and then I need you to ask yourself what will happen if a very fast moving load hits a very stiff structure ok or a very fast load hits a very flexible structure ok these two questions I need to so these questions like I want you to leave I want you to leave with these questions ok keep pondering about these questions because the answers to all these questions would lie or would be answered in future chapters that we study ok so and like these questions are just example always try to imagine whenever you see the systems around you try to visualize why what is happening is happening and what is the mechanism behind that how can I explain that there are so many examples of dynamics around you or the structural dynamics around you that it would become very interesting when you start looking and analyzing those systems in your mind ok so with these questions I would leave you we will come back to again these questions in subsequent chapter and we will see I will explain the basic concepts behind those principles as well as the mathematical derivations of these principles or the questions unanswered to these questions ok so thank you for your attention and let me just leave you with these questions and we will come back to again in next chapter ok thank you


Hello, everyone. My name is Ravi Chandra Padmala. I also go by Nina. I work at Nelenso. We do a variety of web services on the server side, mostly across a variety of languages. I was fortunate enough to write some Elixir code for about a year last year, this year, some of this year. And in the process, I gave a talk at Functional Conf last year at which someone towards the end of the talk, Mr. Saurabh Nanda from Vocational Labs, asked me what people mean when they say let it crash and what do you let crash. This talk is mostly a response to that, but you'll find that it also in the process ends up talking or touching upon a variety of other things. Also, a quick show of hands who here hasn't been, didn't attend Andrea's talk earlier today. Okay. All right. So about half my talk intersects or is covered by his talk. So I think that might even be helpful. We can move faster on some of the slides and go slower on some of the specifics, but that might also mean that I might talk about things that aren't necessarily on the wall a bit more in detail. There's no code in the talk and there are no pictures, so you'll have to do a lot of imagination. First things first, very quickly, actually another question for everyone. Is anyone here not able to confidently explain what a GEN server is? Yeah, not a... Okay, maybe that's... Is everyone here able to explain what a GEN server is? Can I get a show of hands? Okay, cool. So that helps. I guess because this is a more generic functional programming language conference and not just Erlang, Elixir specific one, it's worth talking about what Erlang is very briefly. It's a programming language. It's a single programming language, but if you look at the languages on the Beam VM with Erlang and Elixir and a couple of other smaller communities, there are a variety of programming languages. What makes it stand apart? One of the key differences that has it standing apart from most languages is how in when you're building Erlang, and during the course of this talk, I'll use the words Erlang and Elixir interchangeably. My experience has mostly been with Elixir, but yeah, the right term would be to call it a Beam system or something of that sort, but please just treat it as either word. So what makes the language stand apart is largely the idea of having independent processes communicating via messages and inboxes. It comes with a lot of distributed tools out of the box, and it has been doing this for a long time now, and I think finally in the last 10, 15 years, we're able to take advantage of it, or rather more people are able to take advantage of it and more people are needing it. Yeah, so it's an 80s language design for modern problems. Who uses it? WhatsApp most famously. Adroll, because I saw a tweet about them hiring. If you're using RabbitMQ or eJabidi or CouchDB, the community uses it from Unreal stock. And getting back to the question that I asked you earlier, OTP is a library that comes with Erlang or Elixir and defines a set of common patterns or what are called behaviors over processes or over actors. Gen servers are effectively just processes to whom you can send synchronous messages. This is a regular process. Sorry, send asynchronous messages, and this is a regular process as well. But in addition to that, it gives you a way to, in a standard fashion, send synchronous messages as well. Similarly, there are supervisors. Do this one task more or less of restarting processes with some parameters. Now that you have processes that can respond to messages and now that you have processes that can restart other processes, we can talk about, I think, what started this whole talk in the first place, which is if you have supervisors that can restart processes, you can, at this point, oh, has that been there at the end? Oh, okay. Cool. Just give me a second, sorry. I'm using a new presentation tool. All right, sorry. These are the slides. They're not very fancy, sir. You didn't miss much. Yeah, but the punchline was now that you have supervisors and they can restart your processes. You can finally let your processes crash. That was the cell. That's what we were told we could do. Not quite. At this point, and this was something I couldn't answer for myself even two months into the project, it's difficult to say what you're letting crash. What is it that crashes and what is okay. And before that, even I think it's valuable to just have a common vocabulary, just to have a common vocabulary across. All of us here define what that is. So if we're defining faults as the system going into an incorrect state and errors as unhandled faults that somehow propagate through some part of the system and failures as the catastrophic scenario where an error finally makes the system stop responding or terminate. Let's go with this lingo from here. But at this point when you're talking about crashes and when you say let it crash, you're in the space of anywhere between fault and error. Generally, when people say let it crash, they don't mean let the server stop responding or let it terminate. Just to be clear, that's what we're talking about when we say let it crash. Now, well, the earliest we can handle this is at a point when it's still a fault and not an error. And there are some patterns to deal with faults. I have a random sample of them here, a random sample of fault-tolerance patterns. And they're useful to talk about just so, and a lot of these are to do with distributed systems in that these are patterns that you would use for fault-tolerance in distributed systems. But again, we're not talking about distributed systems at all really today, though it will keep coming in and out during the conversation. Yeah. So there's load shedding or overload protection, circuit breakers, bulkheads, fail fast as a pattern. For load shedding and circuit breakers, the load shedding is listeners dropping messages if they recognize that they have too much load. So this you end up, you can potentially end up using some library or the other. Circuit breakers as well, temporarily avoiding hitting services that you know are not unlikely to be upright now. And there are libraries for that as well. There's one called Circuit Breaker. The other two patterns, bulkheads, it's probably something you'd want to do yourself. A library can't help you too much with it, but then there isn't much to do either. Having separate processes for different pools maybe. If you have a pool of workers, maybe you want to instead make that three pools of workers, one of them dealing with right traffic, one dealing with read traffic, and one dealing with some sort of critical traffic that is more important than either of the other two. And then similarly, anything that they use can be partitioned. So if you have connection pools or caches or other processes that these depend on, you can also bulkhead those things. And you can pick and choose based on what you need. Failing fast is what it says.  There isn't too much to speak about that. But now that we have some ways to deal with faults, at this point are we able to confidently say that we can let it crash? Not quite. So we've defined what crashes are, but we haven't defined what crashes. Yes, a crash is something between a fault and an error, but what goes there and what makes it go there and how is that even okay? Well, it's the usual stuff. Unsafe input, external resources, divide by zero, any other sort of bug effectively. Yeah, well, aren't these bugs? Are we saying bugs are okay now? Well, not quite. And this is where I mean... A lot of this stuff is covered in Andrew's talk again. If anyone on the internet hasn't watched that, please watch it. Yeah, so are we saying bugs are okay now? Well, not quite. But I think it's valuable to make the distinction between business logic, errors, bugs, and availability and reliability-related bugs. And this is not a complete set. These aren't the only two kinds of errors or bugs that you'll have. But it's worth making this distinction for the purposes of our conversation right now. I'm not saying the latter is something that's okay and that you can ignore. But that's more often the thing in the realm of, yes, restarting this or retrying this is fine. And that is the way to solve this problem in that you wouldn't maybe... There isn't much you can do in terms of logic or in your code to handle it. Yeah, so if we're saying that, that is it, availability and reliability-related issues. And this can show up in the form of, say, you're unable to get a connection from a connection pool within your timeout.  And this is not something that you see on a daily basis because this happens once you've reached your system's limits and gone beyond that. If you're in a situation like that, that's definitely a place where there's very little you can do in terms of code and you just let things restart or retry. Yeah, so at this point, maybe we can say, let it crash. We know what is going to crash and we know when it's going to crash. And we've narrowed that down a little bit. But what ends up happening or what did end up happening for us was that we did look at all these things in the process of building whatever system we were building. And in our heads, we were like, yeah, this is all taken care of because we're paying attention to these things and we're building our system. But there's some care to be taken when some care that's necessary. When we're designing our system beyond just looking at these as a high level, these kind of bugs will cause the system or these kind of circumstances will cause the system or certain processes to restart. And that is acceptable. The consequences of that go, depending on the design of your system, will go beyond that individual process, potentially causing you to take your entire system down. And to avoid that, we had to spend a lot of time thinking about how we design process trees and that will be a majority of the rest of this talk. So there's a couple of maybe ideas that we can borrow from distributed systems and apply them here as well. The kind of thing you would do maybe at a company which is running web services that has a lot of scale. As you grow, you end up tearing out or teasing out parts of your system into other smaller parts in a specific fashion. So it is your bottleneck, single function that is bottleneck that ends up becoming a separate process or the stateful part of your service that ends up being a separate service. In a similar fashion, I think you can take a lot of those things that we've learned from distributed systems and apply them to process trees within a single node. So you'd want to separate and pool expensive resources, connection pools, or caches. And this is something you'd end up doing in any other language as well. But the idea behind separating it into a process is just because it's expensive to retry or recompute. Once you lose state, whether that state is a connection because connections are expensive to set up or caches are far more difficult to repopulate, once you lose state, you are at a loss. And restarting that process is a lot more expensive than restarting your stateless processes. So you do want to keep those separate. And you do want to pay attention to ensure that your stateful processes are more robust maybe even than your stateless processes. To the point that, I mean, there's the obvious scenario that most people don't account for or design for, which is that when you depend on something so much, say if you have a Redis cache, which is 98% which has a 98% hit rate, and that's what's keeping all your systems up when it goes down what is going to happen is... I mean, most of us encounter this issue at some point but you do want to design for that, but in the process also want to design for not having that fail and not having to deal with the consequences of that. You also want to have processes be isolated in general and this, I haven't found a general principle to apply to figure out how to isolate processes. So it depends slightly too heavily on what domain your business, your code is modeling. And we'll talk about specific examples in a bit. You also want to have processes whose message handling doesn't make sense for processes to be ad-important, obviously, but when I say that, I mean, the way they handle messages, they're ad-important or if I may use the word rejectable, in certain cases, if you're having message queues and workers or job processes working off them, you can do retries and having things be ad-important helps there and that's a pretty straightforward approach.  There are other scenarios where, say, if you have an HTTP API, a client calls you once and you fail for some reason. You can retry, but you're not sure if that's what you want to do. You want to say I've failed in whatever fashion that is if that's by saying 500 or whatever. And you want to allow the client to decide whether they want to retry or not. And you want to do this so retries are possible either from the client or within yourself and that the consequences of all this affect a small surface area. The most important thing I think that we learned, which was maybe not even that surprising, actually, is that you want to communicate very mindfully across your processes. You want to pay attention to queuing in processing boxes at different layers and this blows up very soon as you have more processes. We had a system that had a, it was more than just a bunch of request processes, satisfying requests and dying. There were some long-running processes and then some others that they coordinated with and so on. And as you have this kind of a setup, you end up with having to deal with distributed systems problems but within one system and at every layer. So effectively every process you can almost treat as a microservice mentally because that's the amount of attention you often or at least sometimes want to pay when you're designing its interfaces. You want to think about queuing. You want to think about capacity planning across the entire system. If you have a connection pool of some size and a cache with, say, replicas of some size or some number, you want to make sure that that makes sense, that works with whatever your inflow looks like. So if we were to take these as some ideas that we can apply when designing processes, let's try to build a web server. So maybe even a very obvious example, we've spoken about it just a couple of minutes earlier and we've seen some very pretty slides earlier today about a very similar thing. We've said we want to have isolated processes. So the obvious step there is that your requests have one process per request and we know this is fine. It seems like a straightforward implementation. We are saying we want messages to be either idempotent or rejectable. I think at this point we've even spoken about this example before. We're able to, say, return a 500 to any client calling us and allow them to retry at work. So cool. We have, at this point, a reliable request handler process. Yes, but if any of you are assuming everyone has written a web server, you would have a question about what you do with the connection accepted processes and do you want to even be bound by one process there? Do you want one thing to listen for new requests and fire off new processes or do you want to parallelize that? All right, so maybe you have a pool there as well and that's isolated from your request processes. So is this it? Well, sort of. I think we've built a part of Ranch and that's what Cowboy's on and it's reusable for a generic socket library that you can build things on top of and Cowboy's on top of it. This is a pretty narrow example. Let's take a slightly, let's take the Hello World example. Hello World being us building a chat server. So just to quickly define what a chat server is, I think we can, if people are familiar with IRC, let's say we follow that design. We have rooms and you can join rooms and you can leave rooms and rooms are places where you have a couple of clients connected as long as they've joined and not exit and anyone sending messages to a room, that message gets found out to everyone else in the room. So this is our design, this is what we want to build. Some interesting things about this problem as we are seeing it. I've listed it down so we don't have to think about it. We have processes sending messages to other processes, most likely. Assuming we might want to separate our client handling processes from our room process. Sometimes processes are stateful so whatever this room processes clearly has some state, it knows who's connected, it knows what messages are enqueued and what messages have been found out. If you want to go one step further and if you're building a messaging platform for the present, then you will end up having to store history at some place and that might be an entirely different process altogether. And you have dependencies across process, so all of these obviously depend on each other. The clients need the room to exist if they're trying to join it and the rooms need maybe the room history process to exist if the clients would need it if they'd want to look at history and so on. And all of these processes may share external dependencies. If you want to say push every message to Kafka so you can do some analysis on it and then figure out automated response suggestions or whatever it is people we are doing these days. All of your clients would end up depending on whatever this Kafka process is. So let's maybe pick apart each of these points. We're saying we have processes sending messages to other processes. You want processes to be isolated and we don't have that. If we look at the design that we've spoken about so far, if you have one process per client, one process per room and say one process per room history if we're doing that, your processes are isolated to some degree. If a client dies, your room should be able to handle that fact and we'll get to this in a second but your room should be able to handle that fact and just be able to find out messages to everyone else. Similarly, if the room history process dies, you should be able to have a conversation with people even though you can't see your previous messages with them. And we're saying processes should be able to deal with messages in an important or rejectable fashion. Well, as long as the message has entered your system, it's not entirely always straightforward but it's often and in our case certainly straightforward to make it that important. Once I say hello, once you know that, it's easy to tag that message and then make sure that everything behind that is able to treat that message idempotently. Sometimes processes are stateful, so let's talk about that. We've said that we'll separate and pool expensive resources, connections, connection pools or caches. Stateful processes are also expensive and expensive in very different ways depending on how you get that state or how you maintain it. So in certain situations, you can actually throw away stateful processes just as easily as you would throw away stateless processes. Assuming you're able to somehow rehydrate and I'm making up a lot of words during this talk, but if your process is rehydratable in some fashion and if the cost of rehydration is low, it's entirely possible to treat these stateful processes with maybe even slightly less respect. But you do need that. You do need that as long as you care about that state and there are also situations where you wouldn't, where maybe you can actually run on production at full load without your cash being up and if your system is designed to do that but only uses the cash as an additional optimization, then yeah, you don't need to regenerate cash when you come back up. You can do that over time as it naturally would. You also want to have these processes, these stateful processes be isolated. You want to make sure, especially they handle messages in an important fashion because if your state is broken, that can have consequences across your system in very strange ways. And you want to do the degree possible, keep your state-free processes distant from your stateful processes, however tempting that might be. Because simply from a system design standpoint, you want to be able to restart your state-free process even if you don't need to. Or you want to be able to say I can make 10 of these without having to replicate data across them. And you might not need that today. So having one room process might be fine right now but you might need 10 later. There's a reason rooms have limits on most of these communication platforms in terms of number of members and maybe to handle that you want rooms of rooms and so on. So you definitely want to keep your stateful processes as separate from your state-free ones as possible. We've also said we have dependencies across processes. We've spoken about this briefly also. The key thing here, and we found this out the hard way but thankfully very early on. And the fact that you find these issues very early on I'd say even a side effect or a direct effect of Erlang putting these issues front-end center all the time. You're always dealing with distributed system problems on your laptop. So when you're doing this, when you have these dependencies across process, you want to be able to communicate very mindfully. The most trivial case or the most trivial failure is when you have one process making a synchronous call to another process and your caller could die because it has a timeout on the synchronous call and it's failed. And this is easy to debug and this is easy to understand. It's easy to understand at this point what's happening and you wouldn't reach this point until you have some amount of scale where you're like, oh wait, call has a timeout. I forgot. But the more contrived case and one that you might end up hitting maybe even sooner than you'd imagine is when in a more complex system you have some message coming in from the external world and then hopping across different processes which have maybe some assumptions and some of these hops are maybe not even synchronous. Some of them are asynchronous. Maybe your job processor, which gets its job in an asynchronous fashion, eventually makes a synchronous call to some other external dependency which ends up holding onto that external dependency for longer than necessary of which something that deals with actual traffic would fail. And even this is a slightly simplified version of what we've had to deal with. So you do want to really give these processes all the respect you'd give services so you don't have to do this. Face the music. Yeah, so that's that. And you also have, we've mentioned, we've said that these processes may share external dependencies. Well, you want to do the same thing, separate your connection pools that access those external dependencies. Maybe at this point bulkheads or something you want to consider again or the variety of solutions or ways, patterns you have to deal with. This has a general distributed system problem. You want to also keep in mind what we spoke about communicating mindfully here as well. You want to pay attention to how your, if you're using libraries to access these external dependencies, you want to pay attention to what the communication patterns there are between your process that's wrapping the library within that and outside. So your other processes and the one that's wrapping the library. Yeah, so we've done all this. At this point we know more or less what we would do or have to do to build a chat server. Are we done? Well, so sort of. The broader idea that I was forced to digest over the 10 months that I had to work on this project was that, well, we know that distributed systems come with a lot of complexities, but Erlang or in my case, Alexa had forced me and everyone else on my team to deal with them at every point and for good reason. At the end of it, once we addressed them, we had a very formidable system where we were able to be quite confident about how the system dealt with either load or situations. Yeah, so towards the end, once we digested this and acted on everything that we learned, we were able to, with some confidence, say, let it crash, but ensure it recovers. That's my talk after the crash. Thank you everyone. Can you give us some examples of the kind of issues that you saw in your system and how you fixed them? Yeah, so I think some of them were even the trivial case at some point, the trivial case being we're making a lot of synchronous calls in a lot of places that we don't need to and that's forcing failures to propagate in a fashion that we don't want to.  A lot of these interfaces we initially had, initially were more tightly coupled across processes. So for example, if you take the chat server example, your clients and the thing that's coordinating stuff between the clients was either synchronous immediately at that hop or synchronous at that hop and then internally also synchronous and all of this ended up with cascading failures across the system. In some situations, something as trivial as one Redis call failing, taking down the entire system and so on. So one of the first things that we did very early on was to just make your interfaces as loose as possible, loose or uncoupled as possible, loosely coupled as possible and that solved a lot of problems for us, I think. Like 90% of our issues was that from like early days to slightly more than early days. Are there libraries in comparing Erlang and Elixir? Elixir has a lot of libraries packaged, having some of these patterns already built for. So did you use any of those libraries or you built all the patterns for your design in custom fashion? So I'm unable to recollect right now, but I think we ended up using one or two libraries to deal with these kind of problems. But more than libraries, I think just the change in thinking helped us a lot more. I think it's basically just us recognizing that our processes need to be more polite to other processes. And once you start thinking that way, you're not really changing too much. I mean, you're still having a process and a message to another process, but you're just putting a lot more thought into how that is happening. The example that you shared was like idempotent and projectable, a pattern as well as anti-pattern sorts of. So that's what I wanted to say. So with that particular example, there's no general thing you're going to do to have your message processing be idempotent. It's going to be very tailored to what your message is and how that can be idempotent. In some situations, they can't. In some situations, you do want things to be exactly once. So in many of your slides, you mentioned about processes. And the first point was it was at many slides. It was isolated. So aren't these online processes already isolated? I mean, OS processes are definitely. So I guess online processes, they must be isolated. Yeah. But did you do something more? We didn't do anything to make processes more isolated. That's a very big question if you're asking me that. I guess maybe you meant it supervised. No, that's not what I meant. The idea that I was trying to convey was that you want to, isolation comes with processes. But what you want is to isolate in the correct fashion. So you want the fact that you're saying your request lifecycle process is separate from any other process. Is you saying this request is isolated from anything else? And that is the isolation you're talking about. The isolation of this request handling in particular, not that processes are isolated. That's true. Yeah. Just the separation of concerns. But in a specific fashion, in that you wouldn't want to separate things into processes just because they're different concerns. You would want to separate them because you expect them to be stateful or fail in different ways and take down different things when they fail. And you want to draw these lines with those concerns in mind, not just any general, sorry. Does that answer your question, though? I don't know clearly. Okay, let me give it another shot. No, we didn't have to do anything to make processes more isolated. Enough for our purposes anyway. The idea that I was trying to convey when I said, when you're designing your process trees, you need to make sure they're isolated. It's not that the processes are isolated, but that they're isolated in the right fashion. Because you can put everything in one process in the most extreme example and be isolated. Or you can also over isolate and create processes for no reason. Okay. Thank you. Thank you so much.


Hello everyone. Today we're going to present to improve the programmable bootstrapping with larger precision and efficient arithmetic circuit for TFHE. This is a working collaboration between me, Ilaria Killotti, Damian Lige, Jean-Baptiste Orphila, and Samuel Eltape. The four of us today are going to take care of the presentation. So before we start, let's see a little overview of what we're going to present today. So the presentation is going to be split in five major parts. We're going to start with the introduction of the TFHE scheme, an overview of the TFHE scheme. Then we're going to present our improvements, which are the PBS mini-loot, the BFV product into TFHE and the WOPBS. And then we're going to finish with some challenges and conclusions. Okay, so before we start talking about the TFHE, let's understand what is the FHE. So FHE stands for fully homomorphic encryption. And it's a new technology allowing to do computations of encrypted data, ever-encrypted messages. So in the slides, you're going to often see the messages encrypted inside a box. As Insta seen this slide, a little blue box with a lock on the bottom. This means encryption. And the message is going to be X and Y in this slide. So in practice, what happens in homomorphic encryption is that if we add homomorphically to ciphertext, or if we multiply homomorphically to ciphertext, the result is going to be a new ciphertext encrypting the addition and the multiplication of the original messages, respectively. By combining addition and multiplication, we can possibly evaluate any function. And the type of messages we can treat in homomorphic encryption are values. We can have bits, integers, real messages. So the most annoying part in homomorphic encryption is what we call the noise growth. To be more clear, what happens when we encrypt is that we add some little amount of noise, this little randomness that is measured in the slides with this little thermometer. And when we start, when we encrypt, the noise is very, very small. However, when we start computing homomorphic operations, the noise grows. And when we do additions and linear combination, the noise grows a little bit. However, when we do multiplication and nonlinear operations, the noise grows faster. And the problem is that if there is too much noise, and especially if the noise reaches a limit, a certain limit that in the slides are going to be is going to be indicated by this horizontal red line in thermometers, then we risk to have an incorrect decryption. Thanks for us. There is a technique called the bootstrapping that allows us to deal with this noise growth problem. And the TFHG, the scheme that we're going to use today has a bootstrapping. So the bootstrapping of TFHG is very special. As any bootstrapping, it allows to reduce the noise inside ciphertext. So in particular, it takes an input, what we call an LWE ciphertext, we're going to explain in a few slides what it is. There is a noisy and by using a bootstrapping key, which is an encryption of the secret key originally used to encrypt the X. It will evaluate the encryption circuit and produce a new ciphertext of the type LWE as well, with less noise inside. So in practice, he refreshes the ciphertext noise. And the bootstrapping of TFHG is even more special because at the same time that it reduces the noise is also able to evaluate a lookup table. So the result is not only going to be the same encryption of the same message with less noise, but an encryption of L of X, where L of X is the position corresponding to X, the input inside the lookup table. So the result is going to be L of X with less noise. So this technique is actually in the rest of the slides, we're going to often call this technique PBS for programmable bootstrapping. Before we try to understand how the bootstrapping work, let's check what are the ciphertext using TFHG. So first of all, what is an LWE ciphertext? So LWE ciphertext is a TAPO AB, where A is a uniformly random vector, and B is equal to the inner product between this uniformly random vector A and the secret key. And then we have an addition of the message rescale to a certain delta and the error. The error is generally a Gaussian error, sampled with a certain variance and the variance is going to be indicated in the thermometer. The LWE ciphertext are very nice because they have a homomorphic properties and especially they are homomorphic with respect to the addition and in the germ multiplication. In TFHG we not only use LWE ciphertext but we use also two other ciphertext. The first one is ring LWE ciphertext, which are homomorphic with respect to the addition and the constant multiplication, and ring GSW ciphertext, which are homomorphic with respect to addition, constant multiplication and multiplication as well. So this means that when we have two ring GSW ciphertext, we can multiply them together and the result is going to be a ring GSW ciphertext containing the product of the messages. There is an additional operation in TFHG that is largely used, which is called external product, and it's an operation between a ring GSW ciphertext and a ring LWE ciphertext. And the result is going to be a ring LWE ciphertext encrypting the product of the messages. Okay, so now that we saw what are the ciphertext in TFHG, let's try to understand how the bootstrapping is done. So just to summarize what we said before, we're going to have an LWE ciphertext in input, quite nosy. We're going to take also in input a lookup table that we want to evaluate and the bootstrapping key that in the case of TFHG is a list of ring GSW ciphertext. We're not going to see the details because this is not important for the comprehension of the presentation. The output as announced before is going to be again an LWE ciphertext this time encrypting L of M with less noise. So what is the operation that we evaluate during bootstrapping? Well, we homomorphically evaluate the decryption algorithm of the LWE encryption. And the decryption algorithm consists in two major steps. The first one is the computation of D minus A times S, which by solving the equations I showed you before, gives us an output delta M plus the error. And the second step is a rescaling and rounding, allowing us to retrieve the message M. So in order to better understand what is coming next, it's important that we visualize what is the LWE input, so delta M plus the error. So you can always imagine it as a list of bits where we have the message that is put in the most significant bits and the error that is in the least significant bits. And in this presentation, the message is going to get values between zero and P minus one. How does the bootstrapping work? So we have a first step that is called the modular switching, which is a step of switching from the modular ZQ, which is the original modular ciphertext modules, and a modular 2N, which means that we are going to select the log 2N most significant bits inside this homomorphically of the input. So what happens in practice is that by selecting this log 2N most significant bits, we're going to preserve the message because the message is in the most significant bits. And if the error is not too big before entering the bootstrapping, then the message will also be preserved after modular switching. The second step is a description of the lookup table inside the polynomial V, modulo xn plus one, in which we're going to put some redundancy. So what does it mean? It means that if the vector you're seeing in the slide is a vector representing the coefficients of a polynomial modulo xn plus one, we're going to have multiple repetitions of the elements of the lookup table. So we're going to start with many repetitions of L0, then many repetitions of L1, and so on, until Lp minus one. And then the third step is going to be a rotation of this polynomial of delta m plus error position. Well, delta m plus the error are going to be the result of the modular switching. So we're not going to check into detail this step. This is performed in TFHE by using a loop of external products. And the final result of this operation is a wring LWA encryption of the same vector rotated. And what happens after the rotation is that the coefficient that were associated to L of m are going to move to the first position of the vector. And the last step was going to be what we call a sample extraction, which consists in extracting the first element of this polynomial into an LWA ciphertext. And since the first element was L of m, then we're going to obtain an LWA encryption of L of m with less noise as expected before. The TFHE bootstrapping seems a very powerful actually is a very powerful tool, but unfortunately has some limitations. And the major limitation is due to the fact that we work modulo xn plus one. So in order to be more clear what happens when we work modulo xn plus one. So we have polynomial of size n with n coefficients. And since the rotation modulo xn plus one is of order to n, what happens is that it exists a sort of imaginary part of size n as well, which contains exactly the same elements of the first part of the first n elements, but with a minus sign in front of them. So what happened is the following. See if the most significant bit of our message is equal to zero during the rotation, we're going to find an element inside the first n coefficient so an element of V. And the result is going to be exactly L of m. However, if in the most significant bit of the message is going to be equal to one after the rotation, the result is going to be in the, let's say imaginary part. And so the result is not going to be L of m, but minus L of m instead. So if we want to always have L of m as a result, we have to know the first the most significant bit of the message and especially in general, we're going to fix this most significant bit to zero. And we're going to try to keep it equal to zero all the time. And this is actually a big limitation. So in this paper what we try to do is to overcome this limitation together with other tfhe limitations. In the rest of the presentation, you're going to see our contribution. So we're going to start with what we call pbs menu to, which is a technique allowing us to evaluate several lookup tables per bootstrapping on the same input. And then we're going to see how to use the bfe like multiplication into tfhe to improve a tfhe techniques. And this was especially possible thanks to a tight noise analysis. And finally, we're going to see what we call the world pbs, which is a pbs without a bit of padding, which is the technique allowing us to overcome the limitation I just described about the most significant bit set to zero. So now we're going to have a look on a new method, which is called pbs many minutes and allows us to evaluate many function into one single pbs. First, we're going to introduce a new tool, which is called generalized strapping, and which will act on the mode of switching, which is the first step of the bootstrapping. So in the usual strapping, the first step required to shift from cypher text, which is encoded over qubits into cypher text, which is only encoded over two n bits, and that the frame obtain after this mode of switching contains the most significant So the idea is to add more degrees of freedom to this step. So first, we want to choose the position of the most significant bit, which will be retained after a little switching. So, for instance, we define new variable, which is called kpa, and this kpa in this example is defined to two. So in this case, after a little switching, this means that we have shifted from two bits from the most significant bits. And so that if our message encrypted was only originally defined as m-prime concatenated with m, after the middle switching will only have the encryption on m, since we have shifted from two bits. We can also define a shifting which is negative so that the kappa is negative. We can also define that after the middle switching will add some random bits as the most significant one in the frame which is retained after the middle switching. In this example, we define kappa as minus one. So this means that we want to shift from one bit after the module is Q, so that after the middle switching will have one random bit as the most significant bit. So this is about shifting from the right side, but in this case we'll define what we called a right padding. In this case, the idea is to have some bits that we will ensure to be equal to zero after the middle switching. This is defined by the variable theta and theta will represent the number of bits which are equal to zero after the middle switching. So in this example, we define theta as two, so that after the middle switching, the two least significant bits are now equal to zero. So with these two approaches, so that in fact this offer us the possibility to choose the frame which will be module switch. So with the kappa, we shift from kappa bits, and with the theta we ensure that the last theta bits will be equal to zero so that the frame of the middle switching is now up to our choice. The first application of this journalism strapping will be in the PBS Minidutes. So just for recall, in the PBS normally we have one PBS for one news, and that at the brand rotation state, we are going to choose the correct case of the loot which will be evaluated, meaning that we want to obtain L of M depending on the encryption of the message and Now, if we apply the general bootstrap by defining just the theta and theta will be equal to one. This means that we here we represent what we obtain after module switch in the plain text version, so that the last bit will be equal to zero and we are sure that this offers more possibilities to uncut lutes. Now we are able to uncut two lookup tables, instead of just one as previously. Why is this this possible, because now we can use the value of this list list significant bit to select which lookup table will be will be chosen. For instance, if we say that the list significant bit is equal to zero, we will select the first lookup table so L zero, so that after sample extract will be obtained LWCiphertext encrypting L zero L zero of M. If the last bit is now equal to one, then this means that we are going to select the first, the single lookup table, so that we obtain an encryption of L one of M. The value of the previous minutes is then that using this parameter theta, we are now able to evaluate to to the power of theta function with the cost of only one pbs and the cost of two to power theta sample extract. However, the sample extract is almost free, so that the cost of a generalized pbs and the evaluation of many lutes is the cost of only one pbs. This offers the multiple instruction single paradigm to the pbs. The cost of however some drawbacks. In fact, we require that the message are small enough since we are restricting the last bits after the switching to be equal to zero. And moreover, the more we increase the value of theta, the more increase the probability of having here or after after a pbs. So now we're going to focus on the BFV product in the context of TFHE. The product at a BFV. It's pretty simple. You have to wring LW ciphertext as input, and you compute a tensor product with between those two. You end up with a larger ciphertext encrypted with a bigger secret key. And what they do in BFV, they add this key switch to go back to the original secret key. So in this presentation, we're going to call the tensor product followed by the key switch wring LW product. We had to work on the noise formula for this operation in order to prove that it's possible to use it in the TFHE context. In the TFHE context, we have a small Q, the integer modules for the ciphertext. It means that we cannot have really big amounts of noise. So we had to work on this formula. And we did it in a generic way, meaning we can have different kind of secret key distributions. It can be binary, ternary, Gaussian, or anything else as long as you can provide the standard deviation and the mean of the distribution. So we were able to use that ugly formula and prove that we can compute some level multiplication in TFHE. For instance, we can see that with the message precision of 4-bit, we can have eight levels of multiplication. So to use it in TFHE, we have to convert LW ciphertext into wring LW ciphertext. Indeed, in TFHE, we mostly work with messages encrypted as LW ciphertext. So we're going to use this key switch converting our input messages M0 and M1 into constant polynomials encrypted in wring LW ciphertext. Then we do the tensor product and key switch. We end up with wring LW ciphertext encrypting M0 times M1. And to go back to LW, we simply compute the sample extraction. So we're going to see how this BFV product in TFHE can be useful to overcome the legacy click property of the programmable bootstrapping. So we're going to start with this toy example. We consider a ciphertext encrypting this plain text with a zero in the most infamous and this lookup table L. To do the regular programmable bootstrapping, we end up with a ciphertext of the message L of M. If now we look at what would happen if there was one in the most significant bits, we end up with minus L of M. And that's exactly what we want to correct. A way to do that is to compute what we call the sine. So we use another lookup table. It's a constant lookup table. And if we go back to this plain text with a zero in the most significant bit, we end up with an encryption of one. If we now look at what happened with one in the most significant bit, we end up with a minus one. And it's easy to see that if we compute a multiplication between those two, we end up with what we wanted, which is L of M in both cases. So how to build this warp pbs? We start with a ciphertext encrypting plain text without any bit of padding. We start with pulling a bit, which is random because of the way we encrypt with LWE. And we apply the little trick we just showed you. In more details, we're going to see what it is. You start with this ciphertext encrypting a random beta followed by your message M. You compute two pbs is one for the lookup table you want to evaluate and one for the sign. And then you use the LWE multiplication we described and you end up with the desired message L of M. So there are two pbs is to evaluate here. And we see that we can factorize them into one using the team 19 trick. There is a price here you add a little bit of additional noise. If the message is small enough, you can use our trick pbs mini loot and also evaluate for the price of one pbs only those two lookup tables. So I'm going to present another way to achieve programmable bootstrapping without padding. So in the version Damien just showed you, we use the LWE multiplication to correct the sign of the random bit in the MSB of the message. And here we use another technique. So we still have an encryption of a message M as input. And we want to obtain the evaluation of a lookup table L with M. So the lookup table L is representing the bottom left of the screen. And so we don't want to work with this huge table we want to work with lookup table twice as small. So first we are going to break apart this lookup table into two lookup table L0 and L1. So now we are going to see how we can use L0 and L1 to obtain this encryption of L of M. So at the beginning we have our encryption of the message M and here we call beta the most significant bit of this message and M prime the rest of the message. If beta is equal to zero and we evaluate the lookup table L0 on M prime, we obtain the evaluation of the lookup table L on M. And if we have beta equals to one and we evaluate L1 in N prime, we will obtain L the lookup table of M. So now how does this work in FHE? So at the beginning we have our ciphertext of message M. And at the end we want to obtain the encryption of the evaluation of the lookup table. So first we are going to perform the PBS with the first lookup table to obtain the evaluation of our lookup table at the sign up to a sign. We also are going to perform a bootstrap with the sign lookup table as with the first version of the bootstrap without padding and the bootstrapping with the second lookup table. Then we are going to add some offset to the sign and perform an LWE multiplication. So we all will do the same thing for the second lookup table with the sign. And at the end we are going just to sum everything. So here we use the, we use beta, the MSB of the message to select between L0 and L1 the two lookup tables and also to correct the sign at the same time. So as with the previous version, we have a layer of PBS, so we can use either the SIEM 19 PBS trick or the PBS menu which we just introduced. And we can, as there is two multiplication, LWE multiplication, we can use an LWE square which consists of an LWE multiplication with both input that are the same. And the complexity of the LWE square is more or less the same as one of LWE multiplication. So now we want to compare the complexity of a classical PBS and the two versions of the bootstrap without padding we just introduced. So we are going to look at PBS working on PBIT message. So for traditional PBS you will need a PBS for P plus one bit. So P bit for the message and the plus one is for the zero padding you put in the most significant bit of the message. For the first version of the bootstrap without padding, you will need two PBS for P plus one bit. So the P is for the message and the plus one is for the random padding we added during the module switching. For the second version, sorry, and we also have LWE multiplication. For the second version of the bootstrapping without padding, we need three PBS, but only for PBIT because we don't need any padding. We added two LWE multiplication and three additions. So we can see that the warp PBS one seems to be always to cost more than traditional PBS, but it's really dependent on the context for the comparison between what PBS to and traditional PBS. So what about parallel complexity? How does it compare? So each layer of PBS became just one PBS. And if we have two multiplication, we have one multiplication. So the interesting take on this slide is that the algorithm we introduced are easily parallelizable. And with the help of parallelization, the complexity are quite close to the one of a traditional PBS. So now it's the time to conclude this presentation and to, so I will begin by by summing up the contribution we just presented. So first of all, we showed you a BFV like multiplication in TFHE. Then we introduced a way to evaluate several look at table at once with the PBS menu. And finally, we introduced two way to build a bootstrapping without padding, the warp PBS one and the warp PBS two. So if you look at the at the paper, you will find more contribution. You will find a generic and types noises analysis of each introduced FHG operators. You will also find a way to build an efficient circuit bootstrap using the PBS menu. You will also find an efficient algorithm to split ciphertext in chunk using the warp PBS. And using this splitting in chunks, you can easily build a large precision bootstrap. And to finish, we also introduced a new approach for get bootstrapping, and we extended to arithmetic circuits. Finally, I'm going to introduce some open problems that still need to be solved. So first of all, we need to take a look at the FFT because for the tons of product we need a high precision FFT. And we want to experiment with hardware implementation, as it will be easy to parallelize everything and to play with the precision inside the FFT. We also want to find alternatives to the bootstrapping without padding, we just showed you because of the noise growth in those algorithms. And to finish, we want to improve the LWE to GLWE switch because as of now it's a huge part of the complexity of the warp PBS. Thank you for your listening.


Guys, this is a YouTube video on YouTube and not from my Twitch stream. Yes, this is actually a video that was directly to my YouTube. It actually happens sometimes. So watch it. You didn't see this on stream. It's going to be very exciting. Actually, maybe you didn't see this on stream because I talk about it a lot, but it seems that people have missed it or maybe they might have missed it or people on YouTube haven't seen it. But we're going to Korea. I'll talk about that a little bit more in a second, but we're going to Korea this week. This week we're going to Korea. Basically, what's happened is we've been very busy, right? We've had all kinds of stuff going on with IRL. When I say IRL, with like real life, like handling like the new house, I'm still working on stuff for the new house. We've had OTK stuff owning an org. That's an incredible amount of responsibility. We've been working on a lot of events, a lot of stuff on the back end that we can't really tell you guys about yet. It'll be exciting when we do, but just hold, hold, hold. The Games Expo is one that's happening June 8th. The Games Expo is happening June 8th. It's going to happen on Azman's channel. That is one that we are very, very excited about. That's going to be a big deal. I've been working on stuff with iDubs and Anisa for the Creator Clash, the charity boxing event that's happening in Florida, actually right after I get back from Korea. So we're going to Korea this week. Then I'm flying to Korea, flying back to Texas, going to Florida and doing that. And then maybe we'll do some stuff out in Florida. We'll see. We're actually going to do the press conferences and the weigh-ins and stuff on my stream as far as I know. The day before the charity boxing event happens. And then that's, you can find out more about that on Creator Clash. I think it's TheCreatorClash.com. So you can find out more about that there. There's a lot that's happening. There's a lot that's happening. So we decided, look, let's take, let's go to Korea. This is going to be like a little bit of a mini vacation slash stream thing. I mean, I'm going to, I'm obviously, it's me. You guys know me. I'm a grinder, right? I'll burn the candle at both ends. And then I'll find another end to burn it. That's just how I am. So it's, it's definitely going to be more of a stream thing for me, but it's also kind of like a vacation thing. It's supposed to be, but that's probably not going to happen. It's, it's been, it's been one of those things where, hey, let's go out. Let's go do some IRL and do things kind of like how we used to do it in, in 2018. If you've been watching me and Mizkiff for like four years, five years, then you know, like before OTK, before COVID, before Classic Wow, before, before all this other stuff has happened in the last recent years, we used to do tons of IRL together, right? Like me, Mizkiff, everybody, like we, we did a whole bunch of IRL with other people and that was kind of like the juice, right? It's not specifically the IRL content, but it, but it was just like the approach to how we did everything was, was, I look back on that. And I really want to channel that 2018, 2018, like middle of 2018 to like middle of 2019, like ironically enough up until the point where me and Mizkiff got banned. I don't think the ban didn't have anything to do with it, right? The ban didn't have anything to do with it, but around that timeframe, right? From one of our, around the time I got partnered on Twitch to, to that point in time. I really want to try and pull from that as much as possible. Conventions are coming back. The world is opening back up. I kind of want to, as much as I can, I, I kind of want to hit it like I used to. You know, I'm planning on doing Tailgate Tour again this year. I, I, I'm going to make some changes to it. I'm going to make it even better. But Tailgate Tour, I want to bring that back in the fall. The sport stuff has been going incredibly well. The football stuff and most recently the, the, the football stuff, right? The soccer stuff has been going really well doing like FIFA, the FIFA streams. Things have been going relatively well, but it just kind of feels like I'm, I'm just getting drawn and pulled in every direction. And it's, it's, it's kind of been driving me nuts to be completely honest with you. So I think kind of taking everything, putting it together and then going to Korea with, I don't even know if I said this already in the video, but with me, Mizkiff, Emeru and Austin, we're going to be going to Korea together. And we're going to be streaming on everybody's channel. So I probably won't be live more than like two or three times, realistically. I probably won't be live more than like two or three times, but we live on everybody else's channel. But we actually have this really cool extension that ton, I mean, we have, we have a bunch of people using it. But there's a really cool extension for Google Chrome and Firefox that you can download. And if you want to keep up with where I am, we can actually push a notification whenever we go live with somebody else. Because essentially what it's going to be like is, you know, I'm assuming it'll be like, we're doing one main stream a day on like, we'll do one on my stream. We'll do one on Mizkiff stream. We'll do one on Austin stream. We'll do one on Emeru stream. And like, that'll be like the main content of the day. And then maybe we'll do like extra stuff. Whoever does extra stuff on the side, that's fine. Or like, we have a bunch of friends in Korea if we want to meet up with one of our friends or do something there. But you can actually download that extension. Actually, I don't even think I've talked about the extension on YouTube before. It's really popular and toys. People love it. And it pushes out a notification in case you miss my YouTube videos, in case you miss whenever I'm going live. It'll tell you whenever I'm changing sections to something. Again, if you miss whenever I'm going live. And now we have it to where we can custom push a notification. Hey, I'm on Emeru stream. Oh, they're live for Korea content today. Boom. And then you'll see it in case you miss it. Or if I'm on somebody else's stream that you might not know. And then of course you can go into the settings and you can choose which push notifications you want or don't want. So it doesn't get too annoying. But people have been loving it. It's very lightweight. It shows you when my newest YouTube video is. So you don't miss a YouTube video. How many of you guys have gone into YouTube and been like, or gone to my channel and been like, I didn't even know this video came out. YouTube's dumb in a lot of ways. But it's also cool in a lot of ways. So you got to take the good with the bad and try and find out a way to kind of work around the good. So or work around the bad, I guess. But yeah, I mean, that's basically it, right? There's I can go on a rant and talk about a whole bunch of other stuff. But I wanted to make this video for you guys. Because even though I do talk about this on Twitch quite a bit. I haven't made a video about it on YouTube. And I've noticed that people are like, wait, you're going to Korea.   Because I'm going to go live and I'm going to test the tech. And I'm going to because I'll be running the backpack. And you guys know I'm a tech person. So yeah, that's it. I mean, there's a there's a lot of exciting stuff coming. Doing doing IRL people are coming to visit conventions are coming back. There's a little bit of there's still a little bit of classic wow stuff going on. I'm currently sitting over the cap for Gladiator in season three. Oh, I mean, that's a whole topic in its own, right? But like, I could talk about that forever. I'm not really going to worry about that now. But yeah, Gladiator, Sunwells coming out. Rathalish King is probably coming out in October, I think. But again, I'll say that for another video. I'll say that for another video. But anyways, guys, thank you for watching. OTK is going to Korea, except not OTK. It's me, Miss Kip Emeru, plus Austin, minus the rest of OTK. In fact, most of OTK is not going mathematically because we have 11 people in OTK. Anyway, guys, thanks for watching. It's going to be a ton of content. Editors are going to be very busy posting a ton of videos on YouTube all week. Download the extension. It is for Google Chrome and it is for Firefox. It is in the description below and I will see you on Twitch. I will see you on YouTube, Instagram, Discord, Reddit, Twitch, Twitter, whatever it is, it's SfanTV.