Okay, welcome to the session about device stream and how to get your device tree bindings accepted in less than 10 iterations. My name is Krzysztof Kozłowski. If you don't know how to pronounce my name, it can be just Krzysztof, works perfectly fine. So I work for RINARO in Qualcomm landing team. I upstream few, some support for Qualcomm SOCs. I'm also co-maintainer of the device tree bindings in the Linux kernel and I take care about a few other things as well in the kernel, few other subsystems there. And this is about RINARO services. Okay, what the topic would be about. So I will say a few words about the generic rules, about the bindings in the Linux kernel. I will show how to use the DT schema. Also, I will explain a bit what is this DT schema. The main part of the topic would be dos and dons. So what, as a reviewer, I kind of expect from the bindings. The presentation finishes with something which I call reusable patterns. I will not be going through this. I keep them on this presentation so you can use them in your upstreaming process and also other references so we can use the slides in your work. If there are questions, we can leave them till the end but actually you could also interrupt me and if you see something interesting, just ask a question during the talk. So short disclaimer that device tree bindings are used in several projects. However, I maintain the Linux kernel. Therefore, the entire talk is focused on the Linux kernel device tree bindings. The guidelines here are mostly based on the experience and also the guidelines sometimes change and during the review on the mailing list, some things might be different than I tell you here. Sorry, I mean, the maintenance decision over rule, whatever I wrote here. Okay, what are the bindings and device tree schema? Device tree sources, so the DTS. I hope that everyone in this audience know it. So the DTS describes the hardware so the kernel can use it. It's mostly for the cases when the hardware is non-discoverable. And now the device tree bindings describes, say, what are the rules, how this DTS should be created. So similarly as the DTS, the bindings also focus on the hardware. So we don't describe the Linux drivers. We don't describe anything for the operating system. We rather document the hardware which can be used by different implementations. Although, of course, we focus on the Linux kernel. So in the past, we're using the text to describe the bindings. But device tree schema or DTS schema is the new format. We use YAML there. And it has certain benefits. So because it's a language, so we can first of all, validate the bindings against the something which we call meta schema. So certain rules, how the bindings should be written. But what is more important, we can validate the DTS. So you can check whether DTS has some style or some important features and therefore it conforms to the bindings, whether the DTS actually presents what binding is telling to do. The rule is that for the Linux kernel device tree bindings, all of the new bindings should be in DTS schema. We don't accept anything in the text. The old bindings which are in the text, you could still extend adding their compatibles, it's okay. However, adding new properties to text bindings, usually it's not accepted with some exceptions. How could it look? I hope the text is a bit visible. So on the left, there's a DTS, there's a SPI bus with one device, it's ADC. It has a compatible, it has a unit address reg and it has one regulator called VRF. On the right side, there is a piece of the device binding in DTS schema without some parts of the boilerplate. So there are some few things which are here removed for the obvious reason. It starts with the title description and again we say what is the hardware. So the hardware is some ADC with its name, it's a channel. Then we list the properties. What properties do we expect? We expect the compatible, very specific one. We expect the reg with maximum one item and there can be also the supply which is the regulator, VRF regulator. We list which properties are required under the list of required and we finish the binding with the keyword called additional properties false. This means that no other properties can appear. I will also mention this additional properties false later in my talk. What are the generic rules for the bindings? We already have it documented. It's everything. So I'm basically repeating the Linux kernel doc. First of all, they focused on the hardware. So they should be independent of the implementation and hopefully some other operating systems or other projects are using the bindings, not only Linux kernel. Therefore, for the same reason, we try to avoid the Linux system. So we avoid the Linux subsystem naming in the bindings. We don't describe the drivers or Linux specific subsystem. We also try to avoid describing the operating system policy. So we don't tell the operating system in the bindings what the system should do. It's not the hardware description anymore. And of course, the bindings are for the same as DTS, are for non-discoverable hardware. If your hardware can discover itself, for example, present some kind of ID, version ID and then you can discover what type of block it has or can say what type of features, capabilities it has. Maybe you don't need the bindings for these pieces at all. The less work for me actually. I mean, I would have much less things to review. When you contribute to the kernel and send your bindings for your new device as a patches, there are a few also things which we all expect them to have. So we want them to be dual licensed, mainly because we want them to be used by other projects as well, so GPL and DSD. The file name should follow certain pattern, the same as compatible. So we want the vendor comma and the name of the block. And if your bindings come with also with the headers, so these are usually located in include DT bindings, ta-ta-ta, these are also part of the bindings. The same rules, dual license, naming, similar as compatible. And please don't mix the bindings with the driver code because they are describing a bit different piece of that is grabbing the hardware. So we expect the bindings patches to be really separate patch in the patch set, the best before the usage comes. Quite important property is the compatible. So what are the rules for the bindings regarding the compatible? Most important should be specific, which means that we don't accept the wildcards. And of course on the mailing list, pretty often we saw discussions that some bindings in the kernel already had a wildcard, therefore my device also had a wildcard. No, it's not, doesn't work like this just because we accepted something in the past. Sorry, I mean that guy was lucky, you are not. So the wildcards are not allowed because you want the compatibles to be very precise. We can accept some family names, I mean like a device family name. There are such exceptions. So usually it's for the SOC IP blocks when one device, I mean, actually all devices have similar programming model. So the example here shown is this Qualcomm MDSS DSI controller. So this is the controller for the DSI in the graphics. So all of the devices have similar interface so we accept a compatible which matches the entire family which you still have to prepend with the specific compatible. So with the compatible matching the actual device. Therefore there are two compatibles, one for SM8550 and then the generic one. What else? If you have devices which can be on multiple buses, so there are such devices for SQC or SPI, then the compatible should not include this type of the bus. I mean, in case of the Linux kernel bindings on which bus your device resides, this depends on the note, on the device not parent to the device. So it should not be part of the compatible. The compatible just describes that the device and device is just, in my example, four. Very nice device thing. Linux has two specific compatibles. So I think these are not used in other projects that come from the Linux. And this is the Cisco and simple MFD. You can use them and see them pretty a lot in the Linux kernel, mostly around the SOC world. So every SOC will have at least Cisco. The main rule here is that we want them to be prepended with a device-specific compatible. So Cisco and nor neither, Cisco and simple MFD cannot be used alone. What are their meanings? Simple MFD means very simple multifunctional device. But the true meaning is that this device doesn't provide anything for its children. All children does not depend on any of the features of the parent. This means that you cannot have in such a device which is simple MFD. You cannot have any reset lines. You cannot have any clocks, anything. Because otherwise this is not simple MFD. This is purely for very, very simple devices which you don't want to write a driver for it. And probably you should not overuse it to write your drivers with simple MFD. Just create your own device and call off-platform populates to populate the children. Now the Cisco. Cisco represents some kind of non-very generic type of register range which contains several pieces and it's not actually responsible for one device. So they don't represent one specific device. Pretty often this is called system controller and this might have several bits for different pieces. There is also a tendency to simplify design of all the bindings, all the DTSs that instead of writing a phi node or instead of writing a reset controller, some kind of SOC developer or DTS upstreamer will push it as a Cisco. And then the reset client, so another device which needs to reset something will use the Cisco and be handled to reset something. So please don't. The Cisco is not an excuse for laziness. Please describe such dependencies precisely. So if you need a reset, create a reset provider and use it from the reset consumer. This also has important pieces because the reset and clocks and other will guarantee you proper ordering, will guarantee your probe deferral and everything, device links, everything. Okay, let's go further. So the other generic rules about the bindings, so properties. We tried the properties to be, to representing also the hardware characteristics. So the good example is let's say if there is some regulator, it has voltage. So minimum voltage should be represented in units of the microvolts. Rather anti-pattern would be to represented in register values. Pretty often we accept it for devices, I mean for properties specific to devices, but in general if you have a property which actually maps to a physical phenomena, then use the common units and we have such units which I will also mention a bit further. So in this case, microvolts. Okay, so these were the bindings. Now, device tree schema. First of all, I will not say exactly what is the device tree schema. I'm just simplifying. It's a set of let's say rules and entire out of tree, out of the kernel application we've written in Python with a lot of YAML. For you the important part is that we use their specific language which is YAML and how to use it. So install the package from the Python and then when you write your bindings please test them before sending. So there are here three comments which allow you to check the bindings. Either you can test the binding themselves or you can test entire family of bindings in the example of Qualcomm bindings or some piece of direction of the Linux kernel. And this is how you can test your binding. More interesting part is how to test your DTS. So we expect actually that all the new SOC platforms which are being introduced to the Linux kernel are coming with towards zero or close to zero of the device tree schema validation warnings. This means that the DTS for this new platform at least for new sub architecture comes without warnings when validating against the device tree schema. How to check it? So of course this depends you are testing DTS so this depends on the cross compiling. You can test all of the DTS as with the DPS check but this will take a lot of time. Therefore you can narrow the check for the specific bindings in the example with trivial devices.yml or you can even test on your DTB target. So then you run a bit different syntax. It's a make check DTBS which checks one specific target. So in this case, Qualcomm SM845 HDK board. You can even intersect these two so check one board with one specific binding. No questions so far, okay. Oh, there is a question. Can you get a mic here? Here on the left, my left. So, yeah? Okay, I use an external DTB when I'm compiling my kernel so can you check an external DTB? Yes, I think there's a DT validate that's coming from the DT schema so if you install the package or install the DT schema then you should have a response proper comment. I never tried it. I work only on the upstream therefore please upstream your DTBS but it should also work. So it was not heard. And the question was whether can you test validate some DTB which is out of three? The answer is yes, I hope. That's the point. All right, let's go. So there are also a few dos and don'ts about the device three schema. So the bindings written in device three schema. So these are rules I hope people will follow and this will save me a lot of time when you send the patches because I'll be less grumpy and less reviewing less job to review when reviewing the patches. So what to do, what to don't do. So first of all, please always look for a standard property. We have already several defined properties in the DT schema repo. We have some common properties lying in the Linux kernel. You can check the other bindings, how they do it. So look for the common parts. We don't want to duplicate the properties. However, pretty often you will need property for your device and your property. So let's say custom property and then the rules come. You need a vendor prefix. You need the type, type is expressed with the dollar ref. Unless you use a standard unit, I will say about it in a second and you should provide a description. So the code at the bottom shows this example. So this is a Qualcomm property. It has a ref, it's unsigned integer 32. And there's a description saying what is this property about. Now you don't need this type, this ref, for certain things. First of all, if you use a property with a well-known suffix. So we have a list of the suffixes like microvolt or even microamp 1000 hertz percent. Then you don't need to provide the type because the DT schema expects already the type. So then you can skip it. The example is entry latency US, so microseconds. Several other properties are also defined by the DT schema. They are not exactly like units but such example is the supply. Supply means here the regulator supply. So also there is nothing, no need to provide the time for the supply. And there is a set of common properties which are well known like interrupts, reg, what else? I don't know, resets, clocks, all of them already have defined time that these are, for example, p-handles, or actually p-handle array. However, you still might need to provide some constraints. So for the case for the interrupts, we need to say that how many interrupts we expect one interrupt in the example here. Pretty common property are the arrays. So usually these are expressed like with the reg, clocks, DMAs, reset lines, interrupts, power domains, all of them. And there's a corresponding property called softening, softening names, so clock, clock names. Reset names. The main rule is here that the list, both lists should be strictly ordered and we expect specific order and the names are actually a helper. Now, this of course is not 100% true because from time to time Linux drivers depend on the names, therefore the names is not exactly the helper, but having the names should not allow you to kind of have a relaxed ordering of the array. So again, the items in the array are strictly ordered. We expect them to be ordered. There are of course exceptions. If you have the names, don't make them redundant. So if the, this is interrupt, it's enough to say that's TX interrupt, not TX IRQ, it's obviously IRQ. And how does it look? There is a way to describe it with the example below. So there's a clocks, keyword items, which says it is an array, and this array expects two items and they are defined by descriptions. So they'll be 24 megahertz clock and there's a bus clock. Then also we need to describe the names if we use the names, and as well we expect two items and these two items are const, so they are fixed, we expect ref and bus. This is strictly defined array. So no order can change, no other entries can appear here. Arrays can also have different flavor. So first of all, obvious cases you can skip description like here is the example of the items for the resets are not written because what would be the point of saying that this is the reset for the first and this is the reset for the second. So we just say the constraints, max items. If minimum items equals to max items, just say max items, it's enough. Although also there are exceptions if you define it in all of if then blocks or in kind of conditional block. For really obvious cases like the reg, you just say that how many items you expect like a max items one. If you would have here more of the IO address space ranges, then this would not be enough and we would expect to enumerate, say what is the first, what is the second, what is the third because they are strictly specific order. But if you have just one, just say that it's max items one, want to say more. I said at the beginning some time ago about the SysCon providers. So the SysCon block which is a system controller. Now about the consumer, so the other side. So this is also pretty often appears in many, many cases this is a SysCon p-handler. The rule here that if you have a property called SysCon it's too generic, it's not specific enough. So it would be not good. You need a vendor prefix, you need some type of descriptive name. So this in the example shows the sysreg, system registers shortcut and you need some type of description like this is p-handled to the system register region. It can be also described a bit better or more applicable to other cases if you have an offset. So then you can use p-handle array for such SysCon and say that you have an array of actually one item and this item has two. So there are two descriptions here. The first is the actual p-handle, a second is offset. Several drivers already use such pattern. The bindings finish with this keyword called additional properties or unavelated properties false. So this keywords determines how other properties will be evaluated. So these are all the properties which are not explicitly mentioned in the binding. These other properties can come from divestory schema itself or from other reference schemas, anything which comes from how we write the bindings. So for almost 99% of your cases you will use either additional properties or unavelated properties and set it to the false. If your binding does not reference other schema in the top level, so there is no top level dollar ref, then most likely you want to use additional properties false, almost actually 100% want to use additional properties false. And the example here is exactly that case. So there's a list of properties, there's some of them are required and additional properties false, which means that nothing else is allowed, only these properties are expected. Now, you might have a bit different case. So you might have a top level reference and this example here shows the panel binding which is using the, or referencing the panel comma datiam schema. So this other binding comes with its own properties. However, you might not like all the properties, you might just choose that, yeah, I write the binding for the panel but all this common panel bindings are not good for me. Therefore, you can list which properties you want. I want the backlight, I want reset GPIOs and I assign them to true, which means that I just want them to evaluate. I don't define the type, I don't define the description, why? Because this other reference schema, this panel common already tells me the type, already tells me the description, what is this? I just have to mention it. And then of course, I also finished the binding with additional properties false. This means that no other properties, which you list here are allowed, including no other properties mentioned in the panel common. This makes sense for certain cases. Although, if you reference other schema, you rather would like to have such case. So you would like to use unevaluated properties. There are two examples here. So typical is the regulator. So this is actually patterned property but it doesn't matter, there is the LDO, actually that can be up to four LDOs. And they reference regulator.yaml and finish with unevaluated properties false. The example below is the same panel example as before, just with unevaluated properties false. This means that you reference the other schema and you accept all of the properties coming from this other schema, from the regulator.yaml or panel common.yaml. You can add more properties and nothing else. So nothing which was not evaluated is not accepted. Nothing else is allowed here. So if you reference other schema, most likely you would like to have this style. So you finish your binding with unevaluated properties false. Finally, the binding finishes with the example. So we want some one or two relevant examples which will validate the binding itself. This is used during this make DT binding check and we use it for the purpose of testing the binding whether the binding is correct. It also serves as a purpose example for anyone who will be writing DTS based on the binding. There is really no point to have 10 examples if they differ by just compatible or free properties because this is pretty often obvious stuff. And unlike for the yaml, we prefer here for space indentation, although two space indentation for such DTS example is also okay. What about the example more? So we don't want there to have status. So status, okay, status disabled. It's not relevant for this example. It's pretty common mistake when you copy an example from DTS. And there is usually no need to provide some unnecessary pieces of other example. So if you, for example, if you have a binding for a clock provider, there is no point to give example of consumer of a clock because it's pretty obvious. We have thousands of consumers. Just provide the example for the same for your device or the provider. The final rule, it's which applies for all the DTS. So we prefer the know the names to be generic and therefore the proper node name for this, for example, for ADC is ADC, not AD7190. That would be pretty it. I have here available patterns. And as I mentioned, I will not be going through them. I leave them only if anyone would like to have some cheat sheet when working with your device rebindings. So I will quickly go through it up to the thank you and the questions. Any questions? Yeah. Could you go back to the beginning slide, please? I think it was. Which one? Right, right at the beginning. I would like to speak up. The microphone's fairly quiet. Honest. Can you go back to the beginning? Beginning slide. Yeah. Sorry, it's where you say that one there. So this is true for Linux. The do not describe software policies is something that Linux does because it has a user space. So other users of device tree, for example, Uboot allows that or needs that because there's configuration goes there because it has to put it there. It can't put it anywhere else. And Zephyr is actually the same. And perhaps that's the reason why Zephyr hasn't been upstreaming bindings, but it's certainly something that is now allowed in the DT schema, as I understand it. And so I just wanted to make that comment. So far, I think there was no case that actually someone was trying to upstream Uboot bindings which have the policy saying how Uboot should behave. So we didn't have exactly, I think, that case to say whether it's not or yes or no. So the policy here that we don't describe operating system policies is for the Linux. For the case of the Uboot or other projects, this would be probably discussed. And therefore I made a disclaimer that the further Linux open source community might overrule this talk, but it's a valid point. There's a question there, Far. I have seen people mixing the Cisco and simple MFD compatible strings recently quite a bit. This is apparently not allowed, right? Is there a reason behind that? Together. Together, yes. No, it is allowed, yeah, it's okay, it's fine. So the only thing which you need to have is to have a specific compatible. What Rob Herring was saying on the mailing list that actually he believes that this is contradictory. So if something is Cisco, it actually cannot be a simple MFD. And he's complaining about this on mailing list. However, he accepts this. So it's a rule by practice. So it's okay. So this is okay to use. We are not supposed to create some sort of wrapper drivers which would do the sub-node scanning. This is okay. If you follow the rule that simple MFD cannot have any other resources for the children. So the children cannot depend on resources. Ah, okay. So because this is the rule of the simple MFD. So the only resource coming from the parent is the IO address space. So the register, special register region space. Good job, thanks. So we actually ran into an issue in TI. Maybe we're using the J720 controller. I didn't get that. Is this better? Yeah, so we did run into an issue at TI with the device trees. So we ended up using like TI J720 system controller along with the Cisco. Then we realized that the register accesses can overlap and it depends on the driver how the request is going to happen. So what we are trying to do is to get away from Cisco entirely with simple bus. So if I got correctly, one conclusion was to get away from the Cisco. And yeah, it's a nice shortcut. The same as simple MFD, but if you start using such compatibility in your source design, then actually you limit yourself and then you might have troubles further in your upstreaming process. So, okay, any other questions? Oh yeah, there is. It's a bit loud at this time. I noticed that sometimes warnings appear when you update your DTC or whatever because it discovers new things that it doesn't like. And then you get a lot of warnings that for files that were previously valid and now not. Is that something that's continuing or have we reached the end of that? So if I got the question, you mean how to reduce the amount of warnings when you do the validation or can you refresh?  I do it now, it produces 50 warnings because DTC is checking a lot more stuff. I mean, I'm just wondering, will that continue? Because it's annoying because you've got perfectly valid DTs that now produce warnings six months later. So the answer is probably that there will be still warnings going, but it's up to you to fix them. So one of the answers, how I became the device she bindings maintainer is just I was converting a lot of things, a lot of things and fixing DTS on the way. So it's community effort. And the point is that, yeah, we have a lot of warning. So with all of the automation tools and someone has to fix them. And the DTC, so the DT compiler warnings are also should be fixed. I don't think that they are a requirement for the system ready, but it would be actually nice to have the platforms without them. There's a question further. This is more of a kind of a conceptual question, but say for example, check patch has this parameter fixed in place, which can just attempt to fix the errors for you. Is there any chance that the DT tooling will have something similar ish and that it will attempt to fix the errors for you in the bind, in the DT source? DT not, but chat GPT can. Yeah. Maybe. So if we describe entire DTS in the binding, so because there are some values, let's say that you miss introps or you miss some GPIOs, but what is the value for the GPIO or the introps? You can actually write it in the bind. You can create so complex binding that it describes every value and you can generate DTS out of the binding. But of course, yeah. I don't think that's the point. I mean, fixed basic errors like no, this called like ADS 74, something, something instead of ADC, that kind of errors I think could be fixed already, right? Based on the bindings. Yeah, probably start simple things. Yeah, there could be. And what could be probably improved also the errors coming from the DT schema. So when it finds some mistakes in your bindings and produces a very interesting error, which is quite sometimes challenged to decipher, so. Yes, thanks. Yeah, one more question here. It's quite overriding. It's healthy exercise. Why choose a license? Or dual license? Why choose dual license for DT-by-DQ? The question is why do we have dual license for the bindings? Because you want them to be used in other projects, which might have different licenses. So not everything runs on GPL. There are some BSD things as well. Sucks. I guess that's it. Ah, no, no, no, no, one more. I was wondering in the example you had for the DT schema check, it didn't have the checker flag, but the bot seems to ask for dash M. Is that important to have? This DT checker flag dash M? No, so this, when the rope runs is bot, which scans all your patches, it runs with this DT checker flag, which also checks whether actually your binding does not, whether it references the example in the example, the binding which you want to put there. So basically it tests whether the example matches the binding because if you test one binding and you put the irrelevant example, then your check, local check would be fine and you would not notice that the example doesn't match. But when you submit, I mean skip this flag and it will be also perfectly fine. And if something is wrong, then the rope will correct it. I mean the bot will correct it. Back to a question that was asked earlier, the first one. There's a comment on the chat about how to validate an external DTS. So I never tried it, how to... It's available. How to, there's a comment, how to do it. Yes, yes, explaining. Good, so that's for how to validate them. With DTS, we pass a path to a DTB wherever it is. Great, cool. And then back to the decent file. Anything more? Then I guess that's it. So thank you very much for coming.


Hi folks, this is Matt, and so we're talking a little bit about social choice theory now, and I'll introduce you to two voting schemes and social choice functions. And in terms of the overall idea, what we're looking at now is we're looking at a setting where a society is making decisions, and we've got a bunch of different individuals who have preferences, and that we want to aggregate those, right? So we've got a set of voters, a set of people, they have to make decision, and we want to take into account the preferences of the different individuals. So we're looking at a setting where we have a set of outcomes or a set of alternatives, so something we're going to choose over, so it could be a set of political candidates, it could be that we're trying to choose a set of new members for a society that we're trying to decide on a new tax rate for government. We've got a whole series of different questions, and there's possible outcomes that are there. And the people, the voters, the agents, the people in the society have preferences over these outcomes. So in this setting we're going to look at, for now people are going to have preferences, they'll be able to tell you this is my favorite outcome, this is my second favorite, my third, my fourth, and so forth. And what a social choice function is going to do is take the preferences of the individuals and as a function of those tell us which outcome are we going to choose. So it's going to be a mapping from profiles of preferences to a particular outcome. And generally what we're going to be interested in is sort of which ones, which of these social choice functions would we like to have. Now in the course we're going to eventually have to talk about incentives, because people, you know, in a setting where we're voting for a bunch of candidates, it might be that I actually, and you ask me which one's my favorite candidate, I might not tell you truthfully which is my favorite candidate, I might vote for somebody else if I think my candidate has no chance of winning the election. So people might try and manipulate the voting scheme by changing how they represent their preferences. They'll say, okay, actually I would like to vote for this person, not for this other person. So we'll have to very carefully think about how the mapping from preferences into alternatives eventually is achieved. But for now what we're going to do is we're just going to look at the function itself and say, okay, if society, you know, there's a whole ways, a set of ways in which these things can be mapped and then later we'll ask which ones can actually be achieved or how they can be achieved and so forth. Okay. So given as a set of preferences or outcomes or alternatives, so that's going to be the set O. And people are going to have preferences over these and we're going to represent these in a very simple form. Generally the agents are going to have strict preferences over these things. So we'll eliminate indifferences that will make our life easier. So that's going to be represented by this relationship, which is going to be generally linear orders. So we'll look at situations where people are not indifferent. So they'll be having a linear order or what's known as a total order over the alternative. So they can tell you which is my favorite, which is my second favorite and so forth. So given a finite set, I can just list them in order. And so a linear order, the set of linear orders will let be denoted by L and those are going to be the binary relations, which are total and transitive. What does that mean? That means if you look at any two alternatives, any two outcomes A and B that are not equal to each other, then either A is preferred to B or B is preferred to A, but not both. So it means, first of all, I can tell you which of the two I prefer and I'm not indifferent. So one part about a linear order is it's going to be a strict ordering. I'm never going to be indifferent. And for any two alternatives, I can always make a comparison. I can't say I don't know. I'm not sure. I'm not undecided. All these voters are decided. They can tell you exactly how they rank everything and preferences are going to be strict. They're also going to be transitive. So if I like A better than B and B better than C, then I better like A better than C. So we've got a nice transitive ordering. That's going to be a linear order is total and transitive. Sometimes we'll also be working with non strict preferences. So it could be that someone's indifferent. So then we'll allow for transitivity and completeness. You can make a comparison between A and B. So A could be weakly preferred to B. B weakly preferred to A. And you could have both relationships holding at the same time, which means you're actually indifferent. So sometimes it'll be better to work with non strict relationships. And in fact, when we're thinking about how society decides on a relationship, it might mean it might be that everybody in a society has a strict ranking, but then society as a whole ends up with a weak ordering. So we'll allow for non strict preferences as well. So those are going to be preferences. Those are the objects that we're going to assume people have. And then based on those, we try and make a choice for the society. So the formal model then in terms of the way that we'll work through social choice functions, we've got a set of individuals, finite set of individuals, finite set of outcomes O. And we'll consider the linear orders on the outcomes, this set L. And also the non strict version. So social choice function is going to be a function which maps from the set of preferences, weak preferences into outcomes. So if you tell me what everybody thinks in the society in terms of their rankings, I'll pick an outcome. So social choice function tells you as a function of what people believe in terms of their preferences of different outcomes, what's the outcome you're going to choose. A social welfare function or a social welfare ordering is going to be the same kind of object except that instead of just picking an outcome, what it's going to do is actually say give you a full ranking of outcomes. So society is going to rank outcomes. And that's different than just picking an outcome. So it might be that we've got three outcomes ABC, and we ask people what their preferences are over these things, and we're going to pick one of them. So we just need to make a choice for who's going to be our president. Alternatively, we might actually want society to be able to rank these objects. So often when you look at rankings of organizations like rankings of universities or rankings of schools, we'll take a whole series of different people who say, here's my ranking. And then we aggregate those up and say, okay, here's an overall ranking. And there might be ties. So we might have people express their preferences or their rankings. And then society might end up saying, here's society's rankings. And that's different. So sometimes we're picking an outcome, sometimes we're picking a ranking. So what are some examples of these things? The most basic and most widely used is what's known as plurality rule. What's plurality rule? That's just picking the outcome that is most preferred by the most people. So everybody just gets one vote, they get to express it. And generally, we'll assume that people are truthful. We assume that they'd express who's their favorite. And then the social welfare, social choice function just picks the outcome that is most preferred by most people. So that's known as plurality rule. Cumulative voting, that's another interesting voting rule. You give people multiple votes. So you get a set of votes. And you could probably, you can give your votes to different candidates. So if there's four different candidates, I can assign several votes to the first. I can give two to my most preferred and then one each, say to my second and third. And then we'll count up and find who has the most votes. So now I've got multiple votes I can express. Approval voting is another interesting voting rule. And that's one where you can basically just express whichever outcomes you like and not express which ones you don't like. So this is often used in saying electing new members to a club or electing new members to a society, something like that. So you can, you know, like a hall of fame, you can list which candidates you think should be included and then give zeros basically to the ones you don't think should be included. So you just vote for the ones you think should be included, not for the ones you don't. And then there's some method of counting up and either picking just one if we just are going to elect one candidate or picking several if we're going to pick memberships there's some threshold. And so that's known as approval voting. So these are different methods of making choices and they're going to have different properties. A set of other voting, voting schemes best on more kinds of information ranking, plurality with elimination. So what's known often as instant runoff or single transferable vote or transferable voting goes by a series of different names. And that in that case what one does is you actually express your whole preference ordering. And so you first we count everybody's favorite outcome. So think of everybody voting for their favorite outcome. And if some outcome has a majority, it wins. So if somebody gets more than 50% of all the votes, then it wins. But if nobody has a majority, so if we have say three or four outcomes, it could be that we have some candidates that are tied or some no candidate got more than a majority. And so what we do then is look at the outcome with the fewest votes and eliminate it. Okay, so knock out the one that has the fewest votes. You may need a tie breaking procedure to, you know, if there's two that have the fewest votes, so knock one with the fewest votes out and then revote. So now we've only got a subset of the candidates left. Everybody expresses their favorite out of this. If somebody has a majority, that's the winner. If not, knock another one out. Okay, and so forth. And actually there are rules. There's variations on this. The French presidential election works this way where you first vote and then if nobody wins enough votes in the first round, then there's a runoff among a subset of candidates. There's a number of systems that work this way. Okay, well, another one is very interesting and widely used. What's known as board out rule, board out count. How do we pick outcomes under this? In this case, you get to give your ranking. And so you're assigning a single number to each outcome. And so generally if I suppose I have a ranking of I like A, better than B, better than C, better than D. If we had four different possible outcomes, what I would give is I get to give a score of three to my preferred two to my second preferred one, zero. And so my most preferred gets three votes. This gets two, one and zero. And now when we look across different individuals, we add them all up. Right. So somebody else has D, B, A, C, somebody else has B, C, A, D, et cetera. Right. So in this case, D gets three, two, one, zero. B gets three, two, one, zero. So B gets three votes here, two votes here, two votes here. B is going to have seven votes overall and so forth. So board account will get numbers for each one of these things. Then we count up this total number of numbers. And the winner is the one with the most, the highest score. And this is actually going to produce a social welfare ordering. Right. It's going to tell us which outcomes are in first place, which ones are in second place and so forth. So it's actually going to rank all the outcomes. And so board account gives us an overall ranking. And actually this is used in a lot of sports evaluations. So in the U.S. for ranking basketball teams or football teams and different polls and in a series of different situations where you're trying to rank alternatives, you can give votes and then aggregate those up and produce a ranking. Another one that's very interesting, successive elimination. You order the alternatives and then you first have a vote over the first two. Do we prefer A or B? The winner of that gets matched against C. The winner of that gets matched against D. The winner of that gets matched against E. And so forth. So you order the alternatives, do a pairwise vote and then do this. This actually works often in legislatures where we could imagine that there was a bill introduced, then somebody amended the bill, then somebody had put an amendment to the amendment. And what we would do is first vote whether we do the amendment to the amendment or just keep the amendment. And then the winner of that gets put up against the bill. Do we want that versus the bill? And then finally we ask bill, no bill. So that's voting by successive elimination and is often used in many legislative processes. So you can see there's many different ways of voting and choosing alternatives. And these are all going to have different properties and that's what makes this area so interesting. There's not a simple way to do things. There's many different ways to do things. They're each going to have pluses and minuses and so there could be tradeoffs involved. Now one important concept that we'll be talking about a little bit in the future is what's known as Condorcet consistency. And Marquis de Condorcet defined this centuries ago. And the idea here is looking for a candidate that's preferred that beats every other one in a pairwise majority. So if you look, if we've got A versus B, A's preferred to B by a majority. And we look at A versus C, A's preferred to C by a majority. In A to D, so if A beats every other alternative, it has a majority of votes versus all other ones, then that's known as a Condorcet winner. Okay, so it's something which majority prefers to any other alternative. And when those exist, then we'll say that a rule is Condorcet consistent if a social choice function picks a Condorcet winner when there is one. Okay, so that's a nice property that's sometimes desired of rule. And there can be a cycle. So for instance, if we had three alternatives, one person one likes A, B, C, person two likes B, C, A, person three likes C, A, B. Now you can see here, A's preferred to B by a majority, two people prefer A over B. B's preferred to C by a majority, but C's also preferred to A by a majority. So we get a cycle here where we end up with a majority rule. We have A beating B, but B beating C and C beating A. So we can begin to see that there's going to be problems with voting rules in terms of making sure that everything's coherent in terms of the way that society's going to end up making a choice. And Condorcet cycles are going to be an important part of that. It's nice if we have a Condorcet winner, they don't always exist. So the next thing we'll be talking about is some of the properties of voting rules in more detail and then some more general results on these things.


Hello, I'm Becca King Reid for CTV with this week's coronavirus update for Santa Cruz County. Schools are now closed, so this week's focus is on education. Later we'll be talking to homeschooling expert Brandi Jordan about how to homeschool while working from home. But first, the update. Here's where we are. In a letter to families this week, Santa Cruz County Superintendent of Schools Ferris Sabaz stated, teachers throughout Santa Cruz County have been working diligently to prepare and plan for distance learning. We all intend to provide students from transitional kindergarten through 12th grade with learning materials that ensure their access to high quality education throughout the closures. Some of the educational content may be delivered virtually. Sabaz acknowledged that this could be a stretch for some family budgets, but offered a solution. Several internet service providers in the community are now offering free or low-cost internet service to low-income families. Visit sccoe.link.internet to see if you qualify for this program. Sabaz insists internet access is key to help facilitate our efforts to offer engaging distance learning. And education is just one of the important things schools provide for students. Many of our local children depend on the free or low-cost breakfast and lunch programs. Now even though the schools are closed, the kitchens have not. Schools will continue to provide an opportunity for families to drive through and pick up meals for their children. Parents can locate their distribution center on the interactive map at the address noted below. If you or someone else needs further food assistance, contact Second Harvest Food Bank or call 211 for more information. You may be wondering how you can provide educational experiences for your children between now and when the distance learning plan becomes available. Well, here are a few options. KQED is broadcasting a California State Standards Aligned Educational Television Schedule. The programming runs each weekday on KQED Plus, that's Local Channel 10. The programming is time blocked for different ages and grade levels. The programming runs from 6 a.m. to 6 p.m. and covers transitional kindergarten through 12th grade. You can see the KQED Plus TV schedule at the website noted below. Schoolastic is offering free online classes daily for students from free kindergarten to 9th grade at its Learn at Home website. Speaking of learning at home, earlier this week when Governor Newsom issued a statewide shelter-in-place order, he gave no indication when the order would end, but said he doesn't expect schools to reopen this year. Schools aren't the only things that are closing their doors. Businesses too are closing up shop and people are expected to work at home. Life has changed in an instant for parents who are now expected to maintain their job performance and educate their children at the same time in the same place. My next guest has some great advice for parents who are now homeschooling while working from home. We recorded our interview earlier this week by a teleconference because we're all working from home. Take a look. Brandy Jordan is a former elementary school teacher turned homeschooling on with over a decade of homeschooling experience under her belt. She is passionate about providing homeschool families with resources and support. Welcome Brandy. Thank you so much for having me. I appreciate it. Oh, this is going to be so great for parents. Right now we have a whole bunch of parents who are struggling with a whole new lifestyle. Now if one of them were to come to you, what advice would you give them to just to give them a good feeling moving forward? Well, first I would say I'm so sorry that you are put in this situation that you did not choose because homeschooling when you choose it is one thing, but homeschooling when you have no choice is very different. So I'm so sorry that you are faced with this situation because it's hard. It is not an easy thing even when you make the choice. So I would say just have a lot of grace with yourself. Be patient with your learning curve as you teach your children and be patient with your children because they didn't choose this change either and it's hard on them. So just be kind to yourself. And if things are not working, take a break. You don't have to push through when things are really challenging. It's okay to kind of step back, take a deep breath and just regroup. It's totally okay. Up until now, most people have been working in one place and coming home and being with their children and maybe helping with homework and maybe doing enrichment projects, but they haven't been doing the same thing. So now they've got competing commitments. They're in their home. They've got their kids. They've got their work. It's all there. How do they navigate the different chunks of activities that they're responsible for now? That's really hard because you're putting a situation where your employer still, like you said, expects you to maintain your job performance and your kids' teachers are expecting them to get support as they're learning. So I would say just rely on the resources you have available. If the teachers are there to help your children, rely on that. If your boss is very willing to be graceful and understand that you have children at home, take advantage of that. Don't hesitate to say, look, this is what I'm going through. This is my new reality.  Exactly now because we can't even invite someone into our home to help us. You can't call your grandma because that would be deadly for her. So we really can't get help from outside. It all has to come from within the home. It really does. And that's hard for a parent to manage on the weekends. Just taking care of everything and managing the house and a child, but then managing work and school on top of that is super challenging. So you're not alone and this team will pass. So you've said the start of the day is how you start the day kind of sets the tone. So how would you suggest parents start each day? When we start homeschooling. I found that it was really helpful to just sit the kids down and sort of have a morning meeting. So you can think of that like work, you know, where you have a morning meeting at work. Everybody tells what's going on, only you're sort of giving them a schedule of what's going to happen.  So everybody's going to be quiet for a month. But we're going to have language arts in the morning and we'll take a break and have a snack. Maybe we'll go for a walk. My mom has work to do or dad has work to do and just give them an outline of the day so that they know what to expect so that it doesn't come as a surprise to them when you suddenly have to jump on a call and they're forced to be quiet. They already have the knowledge that you're going to be asking them to do something quietly for a while. That worked great for us and it's just a nice way to start the day. Yeah.  Here's what we're doing today. You know, and so there isn't, sometimes when you, I was a freelancer for a long time and if you're not careful, you can, your day can slip away.  So I think the parents are going to have that kind of competing commitments now. They've got their work and they've got their home and they're really, when you work at home sometimes and work never ends because you're always in your office. So how do they divide up? How do they draw a line between when they're working, when they're schooling, when they're home? Right. So I think the first thing is everybody gets up, gets dressed in the morning, put your shoes on because there's something about putting your shoes on. Okay. The day is getting started. It's time to work. It's time to do school. Make you stay in your pajamas all day. Chances are it's probably not be as productive as you hope. So do that first and then just set a schedule for yourself but be flexible with it. So if you know that your kids are going to be doing online classes with their teachers, I'm not sure if California's implementing that or if teachers are going to be doing online schooling, but if they are, you know, your students can work during that time and you can be working on whatever project you're working on for work. Kind of set a time for your students so that they know exactly when they're expected to work and when playtime is and when break time is and much. But keep in mind that you have to be flexible because everything changes so quickly. So is it a good idea to have a space, like an outline place in home where you do this? Absolutely. Absolutely. If you have a separate office that you can use, use that. If you don't, the kitchen table works great. And you can make bins for each child with their work and just pull them out during school time. Then when the school day is over, put them back in and make it home again. But have that separation so that you don't feel like you're working all the time and your kids don't feel like it's school all the time that there is that home family time as well. And you had a great way of beginning and ending the day for your kids to get them more in the school mode. Can you share that? Sure. So when we started, after we would have our morning meeting, we'd be like, okay, it is time to go to school and they would put on backpacks and we would have their school stuff in the backpacks and they would walk out the front door and they would walk around to the side gate and let them in the side gate as the teacher, welcome them to school. And then we would start. And then at the end of the day, we would reverse it and go around. So if you have a side gate or a back gate and they can come in safely that way, that might be a way to do it. You could also pack everybody in the car, drive around the block and come home. And just to give yourself that kinesthetic actual movement of separating the day between work and school and family time and home. That really helps. That really does help. I used to have an office that was attached to the house, but I could get to it from outside.  Right, because otherwise you're working and you're doing school all day and it gets to be too much. Yeah.  You're always working. So I liked your idea of you could do it on the kitchen table, put everything away because then you really don't see that stuff or if you have a room, you can close the door. It makes a nice celebration. Now one thing you also mentioned to me was that, which makes total sense, but I hadn't thought of it before, but the school day is not as long as a work day. So kids are really only learning for two or three hours, especially if they're doing it in a condensed place like at home where they're not waiting for other kids to line up or come in or go out or file papers. And parents, they're working eight hours. So how do you handle that? Right. When you think about it, when your kids go to school, it seems like a long time throughout the day, but there's a lot of that time that is transition time and lunch time and maybe going to locker time. So there's a lot of downtime that's not actually instruction. And when you're homeschooling, all of that is super condensed. So all they have to worry about is completing their work because they don't have to wait for 20 other students to finish. They can just, when they're finished, they're finished. So for us, when we had our kids finish early with things, then we would have busy boxes or like bags of things that had puzzles or activities that they could do quietly while I still worked. And yes, screen time is okay. Like if you have to supplement with screen time, go for it. There's tons of educational movies. There's tons of things that they can watch on the internet. The zoos and aquariums are having wonderful live animal cameras that they can watch and learn while you're still working. And that's okay too. Yeah. Yeah. That's nice. So there's some sort of positive stuff to do when your when your parents are still working. That's a good idea. So, you know, what about older kids? I think it would be, you kind of got the feeling elementary school children, you tell them what you're going to be doing all day. They do it and they follow through and they play with the video cameras after. But is there anything different about high school students? They're a little more independent. They study on their own more. How do you, how is it different with them? Well, I have two teenage boys. One is a senior and one is a sophomore. So you would love to think that teenagers would be very self-motivated and they'd get up on their own and start work, but that's really not the case at all. So I would encourage you to work with them to set up a schedule too. And you might have to remind them and, you know, stay on top of them as much as you do your younger kids. Because if you don't, the tendency is to kind of slack off to not do the work because it's easier to be on their phones and communicating with their friends. So it's, I wish that it, I wish there was a magic solution for teenagers, but you really do have to be on top of them just as much. And yeah, so it's just attention. So accountability. So what, what, what do you, what are your accountability tools as you're, as you're getting students to work at home? Yeah. So we make sure that everything that they have to do that day is written down and then at the end of the day, we check it. And if they've had trouble, it gives us something to help them with because they can independently work on their, their assignments and that's okay. But it is really good to go back and make sure that they've actually completed them because there have been times where we said, you know, have you done all of your assignments? And the answer has been yes. But in actuality, there's pieces missing or there's things that need to be adjusted. So make them accountable and check that. And it can be at the end of the day after you're done work. It doesn't have to be during your work day. That makes sense. So one of the things I'm thinking when you speak about a cannibal in going over their work, like not, not most of the parents, I mean, some of them are going to be trained teachers, but most of them won't be. And some of them would just won't have, as my brother calls it, the way. So how, what is, how can you, what advice do you have for parents who are trying to teach their student a skill that is new for them or just new for the child? How, how is the best way? What's the best teaching attitude? Right. I would say, again, be kind to yourself. It's okay to admit that you're not sure how to teach something. Googling it is totally okay too. There have been many times when we're not sure about a certain skill or how to teach something in a way that's going to reach our kids the best. So we Google it. And there's lots of resources out there. Khan Academy is a great math resource. We love using them, especially for older, higher level math, because there's a lot of things I don't remember from, you know, going through high school myself, like geometry was not my forte. So being able to get supplements like that, like Khan Academy and use them and kind of brush up on the skill before I have to teach it to my child is very helpful. OK, well, speaking of resources, Brandy has provided some very nice resources for you and we'll have links to those at the end of the show. And I want to thank you so much for coming today. Is there anything I didn't ask you about that you feel you'd like to share with parents before we go? I would just say, you know, just go with it. Just do your best. It doesn't have to be perfect. Your child is going to be fine. You're going to be fine. You're going to get through this and it's OK if you don't like homeschooling. You didn't make the choice to do it. Nobody's going to judge you for not liking it. Just do your best. And if you have questions or you need help, reach out. There are so many people that are willing and ready to help parents who are thrust into the situation. Thank you so much. Where can people find out more from you? You can find out more at MamaTeaches.com and I actually created a page for your community. So it's MamaTeaches.com backslash Santa Cruz. So they'll be back to find information there. Oh, that's great. So it's MamaTeaches.com backslash Santa Cruz. Yep. You're so generous. Thank you so much for being here today. I know parents are really going to enjoy your printables and this interview. Thanks, thanks, thanks. Now, one more thing before we go. Sadly, when disaster strikes criminals, do not take a holiday. Right now, hackers are trying to lure concerned Americans into downloading a malware that's disguised as a Johns Hopkins map of the coronavirus pandemic. Visiting the website infects the user's device with an information stealing program that can collect a lot of sensitive data. No one is sure how it's being spread, but email, internet ads and text are the likely culprits. Some with Android phones have received text with links to an app that tracks the coronavirus. When downloaded, the app will allow criminals to track you through your smartphone's camera and microphone. It can even steal your text messages. You can find a safe map courtesy of the Mercury News at the link below. All the links I've mentioned today will be listed on CT's Facebook page. You can find our page at Facebook.com slash CTV Santa Cruz County. That's our update for the week ending March 21st. Thank you and take care.


This is a manifesto to end all manifestos This is a manifesto about my father These were the words spoken by Zimbabwe borns dancer and Choreographer Nora Chippermere at the end of her performance portraits of myself as my father a Persuasive and deeply personal narrative after losing her father at a young age This was her cogent revelation her proclamation Chippermere asked How do you become a man a black man and In an exploration of identity and black masculinity. She magnified stereotypical male gestures Choreographing them as she brought them into the bodies on stage From knuckle walking to a more natural looking swag Chippermere asked Her castmate to demonstrate the physical evolution of a black man Resulting in his final noble presence yet The cultural awareness remained there are those who continue to fear him Yes, her dance partner embodied every black man the burden and the bliss Watching Chippermere's tribute revived memories of my own father the man who had no permanence in my life as I grew I wore his features reminding my mother of her disdain for him whenever she looked at me. I Bore resemblance so striking it forced her to call me black and ugly Hurtting me in a way he had hurt her In a way Chippermere gave me permission to create my own manifesto of my father and along the way To fill in the blanks so his absence became its own story. I Imagined he was gregarious and over-enthusiastic Charming to strangers and generous to friends. Maybe he was kind and thoughtful funny and candid Had he been present he might have taught me how to shave or throw a ball tie a bow tie Maybe effectively use the F word. I want to think I would be more freely recount childhood memories to friends And in those stories I would be smiling My friends would listen as I justified my lack of detail Attributing them to my to me being too young to remember. I want to think his voice was heard in political demonstrations Marching for justice alongside public figures chanting no justice no peace I envision us having long conversations about manhood as he helped me cultivate self-pride and individuality in These imaginings I find myself proud to carry his name bask in his legacy and I relish these memories especially the ones I fabricated I Suppose he could have been any combination of these things, but I don't really know He was scarcely in my presence and when he was he reeked of to make Jamaican masculinity a term used in an article by Key on West for the Jamaican Gleaner Where he explained that many Jamaicans defined their masculinity primarily through dangerousness and anti-femininity Particularly in the areas of sexuality. He continues in contemporary Jamaica Masculinity has become little more than violence and the total rejection of anything perceived as feminine or homosexual. I Know two things about my father He was a cop and he loved women. I Can't remember ever seeing him without his gun My father the enforcer My father the womanizer my father It was only a matter of time before I came into direct conflict with him because unlike him I was soft-spoken and my demeanor was not his type of masculine That father-son encounter did eventually come It came in the form of a threat and later it's in something that was not quite a conversation. I Remember the first part of that encounter. I consider it my right of passage I was 12 I'd gone to a bar he owned and my mother occasionally insisted that I go there to seek monetary assistance from him to lessen her financial burden As I walked up the stairs to enter I how I heard shouts off where I say and chop all these are Jamaican equivalents of fears and yes a Group of teenagers were gathered outside the bar voicing friendly and obligatory praise to each other The only teen in the bar I was actively distracting myself from my father small vulgar group of colleagues who I'm sure were permanent fixtures in the bar Without warning My father pulled his gun from its holster and held it to my head he said If I ever find out you're gay, I will shoot you a Hush fell over the bar and I remember the sunken feeling of fear Inadequacy and shame as I covered beneath my father's intimidation His menace was palpable in that moment I Publicly became the emphasis of what I'd learned was the Jamaican male After the incident I intentionally fought against doing anything that made me seem feminine to myself and to others I Gave weight to my strides I wore clothes that did not cling to my unmuscled frame and I forced myself to deepen the timber in my voice I Performed masculinity the way Jamaicans would accept it for me those ways of moving through the world We're not natural acts so I would rehearse them perfect in my role as man hoping to stay alive Eventually I left Jamaica and I began to do more than stay alive. I began to live I Accepted my queerness I Needed to own my truth to take one step closer to redefining my masculinity I want to say I was unbothered by my past, but the irony is my transformation Was all spearheaded by the threats of the toxic Jamaican male when I was 30. I Made a phone call to my father. I Recalled to him the scene in the bar that stayed with me for so long. I Told him that his threat forced me to dislike him and that even though I wanted nothing more than his affection The reward of becoming the man that I am Outweighed my need for his acceptance.  See I called while I was living in New York Or maybe it was that third glass of wine Either way But as I'm owning my own truth. I came to this realization Sometimes the hardest conversations are easier when talking to strangers He was my father and I was a son and in spite of our connection through DNA.  I started coming to terms with my own I've often wondered what makes me my father's son as I get older I see more of him when I look in the mirror I can even imagine now that my father thought it was a joke when he casually told me he'd shoot me But unbeknownst to him that night he did pull the trigger In my rebirth I now live Unapologetically I may not be the same as my father, but his blood and his actions live in me Chippermere's portrait opened the door to an armory housing tools for the black man's survival. I Survived my father But as I was watching the performance I Silently wished that he could have seen me stride through life as his queer son