3,517 karma · joined Jul 23, 2021 (5y ago) · 2,823 submissions
comment 3y ago · link · parent
The value is in the users, the people who create content. And to that end the freest, fairest, and most democratic choice is the individual's private decision to participate. Closing subs to protest takes that choice out of the hands of the user. Make organic posts to the site to raise awareness of any particular issue or cause you like, and let those get viewed and voted as they will. But using moderator powers to make these statements is an abuse of power and abuse of the user base, and it's exactly what I would expect from the archetype reddit moderator. I wouldn't be too upset to see a few get their comeuppance for it.
I say this as someone who dislikes the reddit organization, the CEO, their lies and underhandedness, has been proudly perma banned from there, and would get some petty satisfaction from reading about them crashing and burning. But if people like it and want to use it and continue to participate in their communities they are a part of there, they should be permitted to.
comment 3y ago · link · parent
One part of it was certainly about quantitatively adding instructions that could be used (by the programmer / compiler), but that was inextricably linked to the other side of the coin which is to define instructions that could be implemented in a performant way. Instruction complexity, addressing modes, lack of load-op, etc were all based on simplicity and high frequency pipelining. To a fault in some cases, famously branch delay slots in Stanford's architecture, a choice only explainable as a decision to complicate the ISA in order to make (contemporary) implementations simpler. Others as well though -- it's not that compilers were incapable of using or benefiting from load-op instructions for example. It's just that they were harder to implement.
comment 3y ago · link · parent
Silicon valley isn't silicon valley because it had cheap property or cafes or internet cables -- lots of places had cheap housing, and the internet didn't exist when SV was kicking off. The reasons are (among other things) that it is close to some of the best technology universities in the world, had significant defense and government technology opportunities and investment over a hundred years or so. You can't just spend a few billion and pop up a new one of those somewhere.
And I'm speculating here, but the hip vibe of California and San Francisco in the 60s and 70s, and the relatively large proportion of Asian immigrants at the time quite possibly helped to draw in young, creative, talented people. Also something that's difficult to conjure up out of nowhere. It's actually a confluence of things that won't be possible to reproduce again because hundreds of cities are trying to do it so there will be no such singular center of gravity.
comment 3y ago · link · parent
The latter is a bit clunky but the core more or less implements them in the same way. Acquire a line exclusive, load value, increment it, write it back. And you can hold the line exclusive such that the conditional store failure cause is mostly a formality, and can't actually become an infinite loop.
No general purpose atomics are done by shipping the operation to the cache or to memory controllers, it just doesn't work[*]. So even if they look slightly different in the core, they all end up looking exactly the same at the caches and coherency protocols, and that is where atomics are slow. Well any sharing of cache lines updates really.
[*] EDIT: That is to say it doesn't work for performance, for many reasons. Some CPUs do have "remote atomics" something like that which does exactly this, but they are not intended to be broadly used.
comment 3y ago · link · parent
It doesn't work of course, obviously because there is no forward progress. CPU1 can order all previous stores, then later store some flag or lock variable, and that will never propagate to CPU2 spinning on that waiting for the value.
But also because CPU2 and CPU3 can see different values depending on the state of their caches. If one had no such line and the other had a valid-stale line, then they will end up seeing different values. And the writeback out of CPU1's cache needs to write back and invalidate all possible older such written-to lines. By the time you make it work, it's not a cache it's a store queue but worse because it has to do all these coherency operations and barriers have to walk it and flash or flush it, etc.
comment 3y ago · link · parent
I don't want anything, I was correcting your misconceptions.
> Well, if I go by "if it's part of the memory model then it's not stale", then you can allow a relaxed ordering on single addresses without having stale data.
I don't know what you're talking about. Memory ordering is not about ordering of a single address. That's cache coherency.
[snip]
> I'm pretty sure the entire point of acquire is that you can't reorder reads from after it to before it.
And you're still wrong. Acquire barrier can be required even if you receive coherency updates in a sequential order. Barriers in modern processors do not flush, invalidate, or perform coherency operations.
This is what I mean by you can't just handwave with a basic idea about the programming semantics (which aren't particularly complicated). It's easy to think up some vaguely plausible sounding implementation of those things, but the reality is infinitely more complicated. Real cache coherency protocols are verified with formal proofs, and not because they are easy. I guarantee if you handwave a new coherency state or give up some property of coherency, you will have bugs.
comment 3y ago · link · parent
Not sure what you mean by that.
> Let me try wording it a different way. A store_release requires all previous writes to be ordered before it. This obviously includes other memory addresses, but its own memory address isn't an exception. So even without cache consistency as a general rule, the nature of a release gives you all the ordering you need in this situation.
We're talking about cache coherency, not memory consistency. Coherency is not about ordering, it's about ensuring agents don't see stale data.
> So I meant acquire but I think there's also a clear solution based on exactly what I said.
The same goes for acquire though.
> The lines that could possibly be affected by the FIFO are all in the "Shared but maybe stale" state. Consume turns those into Invalid. So any read that's from after the Consume, reordered before it, should see those lines as Invalid.
Implementation of CPU memory pipelines and cache coherency aren't really something you can just get a bit of a feel for and then handwave about.
comment 3y ago · link · parent
That is not what a release barrier does.
> Without cache coherency a release barrier makes sure all previous stores are committed to L1, and explicitly says that any old versions of the cache line have been invalidated.
That is not a "normal barrier" though, writeback and invalidate operations are software coherency.
> If you had a design a lot like MESI, you wouldn't really need release semantics,
This is not the case. Release barrier can be required even if your cache coherency operations completed in FIFO order, because reordering could be done before cache coherency.
comment 3y ago · link · parent
Hardware caches which are not coherent require e.g., writeback and flushes to be coherent with other agents.
> When you read address X that refers to address Y, it's impossible to read Y and know it's the version that X refers to (or a more recent version). I would call that Y being "stale, as per the memory model". I'm pretty sure that's a normal use of the word "stale" in the context of memory models?
It isn't, because it's relative. "Most recent" is according to the observer, and if you couldn't previously observe something that is "newer" (within the rules of memory consistency model), then it is not stale.
> Imagine a CPU with a weak memory model, where multithreaded code without memory barriers loses the property of always seeing the same order of accesses to a specific address. That would break some things, but that code was broken anyway.
Not same order of access, same order of stores. If memory location x receives two stores, A and B, and CPU1 sees A, B and CPU2 sees B, A, now one thinks the location contains B and the other thinks it contains A. In the end, all CPUs can see different values at all memory locations. A normal barrier doesn't solve this, the stores are already done.
comment 3y ago · link · parent
Not without coherency performed in software though, which is the point.
> Cache coherency doesn't protect you from stale data unless you only read one memory address ever.
It does. Observing updates to different locations in other than sequential order does not mean the data is stale. I guess that's also colloquial language issue. The data is up to date according to the constraints of the memory model.
> That depends on the memory model. You could have a system that doesn't guarantee cache coherency in general but works fine if you put in ordinary memory barriers.
What property of cache coherency could you lose and still have it working?
comment 3y ago · link · parent
comment 3y ago · link · parent
Your CPU guarantees a lot, cache coherency to start with. But also a very well defined ordering model and ordering instructions. It's not necessarily trivial to program for, but that doesn't mean you can't trust it.
comment 3y ago · link · parent
I'm using coherency as in the term of art, not a colloquial meaning. Every agent observes stores to a location in the same order[*]. Cache coherency says nothing about observed ordering of stores to different locations.
[*] Although store forwarding throws a bit of a spanner in that definition, there can still be reordering occurring absent that local reordering.
comment 3y ago · link · parent
If software has to perform some operation to maintain coherency then you hardware is not cache coherent. Which some aren't, and especially some sub-sets of operations aren't (instruction cache vs data ops, or CPU vs DMA). But for load/store operations by CPUs, they're all coherent.
Barrier/fence instructions are about enforcing ordering on when memory operations to more than one location can be performed or become visible, with respect to one another.
comment 3y ago · link · parent
Only joking, but no it is not "projection". It is definition. It goes something like "people do what they want to so if they donate something to others it is because they wanted to do it and therefore it was not selfless."
It's a pretty stupid and pointless definition though, probably sprung from someone's need to economicsify human nature. Even then you can easily get around it by defining selflessness to be the selfish need to give to others.
comment 3y ago · link · parent
To be clear, that is according to the definition you've made up. The commonly understood definition includes many or most of peoples' desires. Travel, housing, vacations, iphones, advanced health care, entertainment, higher education, etc.
> I think we are actually there, but have induced a scarcity economy with extreme imbalances and fake incentives to toil for toils sake.
Even in western countries, millions of people are struggling with basic costs of housing, energy, and even food. I mean people who actually work many hours every day and earn money are struggling with these things. We seem to be a long way off it even for your "basic necessities" definition.
comment 3y ago · link · parent
Everybody is an artist, and everybody can create and share art for themselves and the people around them. That is art at is best, in my opinion. Commercialization and mass production and display and distribution of "art" is what degrades it for me.
> Especially as we move post scarcity, I hope we can build a WPA like entity - perhaps, in a crazy twist, funded by AI?
Post-scarcity will never happen because even the people with mansions in many countries, billion-dollar yachts, and fleets of private airplanes do not have enough. And 10 billion people can't even live like them. Why would the people who own most of the capital suddenly collectively decide they would like to share the production with the rest of the world?
But if it did happen, we should not pay artists for art. We should give everybody enough so that if anybody wanted to paint a picture or hammer some metal into a horseshoe or knit a sweater or write some assembly code, they could do so.
comment 3y ago · link · parent
Anybody who believes there is an almighty assembly of "experts" out there with super-human integrity, incorruptibility, and infallibility, is sadly deluded.
comment 3y ago · link · parent
And the answer is not to teach people better critical thinking and fact finding skills or to teach people ways to accept and cope with the fact that other people have different opinions about things than they do. It is to convince them they will be hurt by these things and must turn to others to protect them and prevent them being exposed to such dangerous things, like like those comedy sketches of parents covering their childrens' eyes and ears when they see something profane.