(This is more common than you'd think.)
5,964 karma · joined January 30, 2014
(This is more common than you'd think.)
LOL. No, no they are not. There's a lot of reasons I'm out of that game, and this is one of them. $1400 a month (2010 dollars), unlimited working hours, unlimited international travel. Sound fun? No?
> bonuses
I think I got a $5 Starbucks gift card once. I guess you could count the free leftover pizza as a "bonus"?
To address the heart of your argument, Science is not structured like software engineering, and if you're thinking it is, you're making a lot of mistakes. Scientists often do well as software engineers, should they change careers [waves hand!]; economics aside, software engineers very rarely make good scientists. The mentality is simply different.
As regards complexity management and dishonesty; yes, straight-up dishonesty does occur sometimes. We are all human, after all. But science is done in the physical world, and unlike software or mathematics, the physical world does not admit unlimited complexity. So things must be divided up in a manageable way right from the very beginning. On a big experiment, if your little "box" of responsibility does not work, you can and will be replaced. I have seen it done. Even to or by me. (If involved, I have historically been the one doing the replacing; but I've been on the other end, too.) And you will be cross-checked by independent people, if it is critical: I have seen this too. You had better get it right.
The moment someone has a theory that's experimentally testable somehow (somehow possible, anyway), there will be plenty of interest. There has never been such a theory to date.
Until that arrives, it's all just hot air.
No. Just... no. Even advancing that fifty years to 1975, the Standard Model reigns not because people want it to reign, but because no one can knock it off its throne. There is no better idea that can explain more than the Standard Model can. It's not a conspiracy.
(I did used to joke with my students that progress in physics stopped around 1975, which is around when LSD got banned, so there might well be a lack of ideas. But I'll leave that one to the reader!)
That was not the only thing about the apparatus, just one of the most important, but the point is: we cared, we cared a lot, and we cared a lot about a lot of things.
But I would never call them "robust". Unfussy, yes. But a G2 glob is just a minor annoyance. A V5 leak, and they do leak, is a real problem. They're also prone to quick deaths if they roll off a table. G2s don't care about such minor mishaps.
So the G2 is my vote for "sprinkle everywhere".
Mostly they're just nice for being fairly rugged and reliable in a way most nicer pens just aren't, for carrying loads of ink, and for being ubiquitous. They're far from perfect. They're just... Good Enough™. And that's good enough!
I have a Lamy 2000 (well, more than one...) that I adore for writing anything with any actual length. But I still scatter those G2s around.
Because right now my attitudes are trained by things like this https://algassert.com/post/2500 that explain just why 15 was factored in that famous run of Shor's algorithm and not, say, 21; and why 21 hasn't been factored yet and isn't likely to be any time soon....
But it's also very possible that hypothetical report was genuinely concerning. We just haven't seen it or anything like it.
However I'm pretty firmly in the "quantum computing won't be doing anything useful any time soon, if ever" camp, so that definitely colors my opinions. I don't have any particular recent expertise to support that, but I did used to share an office with some serious QC people and go to their talks so... make of my words what you will.
Muons are nasty little buggers.
Certainly, back then the prefetchers were a lot happier when they could easily identify patterns. They are more sophisticated now, but the old tricks still work. Avoiding register-based indirection is a major help to pretty much everything. When the base register gets updated, as well as the index register, that's hard to optimize. It shows up in both memory prefetch as well as speculation past an instruction.
The other idea to keep in your head is to start thinking in SSA form. Compilers live and breath SSA, so if your fast-path code looks like SSA with a couple of phi nodes, well, it's probably going to generate like you think it will. That's why I preferred the explicit `update_j` style: it's SSA form!
OK, it seems I've been a bit confused myself. I think my final conclusion is actually just that clang is generating kind of crap code here, and this change gets good codegen out of clang. Since I was mostly looking at clang and was leaving gcc as an afterthought, I didn't pick up on this. (Obviously I'm a little rusty on my x86, I shouldn't have fallen for that!) As gcc shows, it doesn't matter much either way. But when clang is happy, its code is quite nice, so there's that.
That little address dependency chain is nastier than it looks, though, the way clang is writing it. Best done away with. There's really no reason for clang to be emitting that crud. gcc handles the addressing in a much cleaner manner whether it's byte- or dword-wide. But gcc also does need that fence when clang does not. I'm sure that's not a coincidence.
> Could you explain your thought process [on placing the compiler fence]?
I ended up dumping this in kind of carelessly and noting that it worked before moving on (it was a last-minute add and I was kind of done by this point). But GCC does care where it goes, since it doesn't work if placed before. Let's try this explanation: the fence basically means "resolve all funny business with this variable before proceeding". Before the write, there's no funny business to resolve: nothing has happened to that variable. No writes, no outstanding reads (we're well into the loop at this point, in theory). So it's a fancy nop. But if it's after the write, we've now got a consequence: `next_j[i][j]` is different now. The fence forces us to resolve that now and not let it linger until the next loop iteration. Where it can be handled perfectly well, but not particularly quickly (which we do care about), and by the way that choice puts the update in the fast path. Forcing it to be dealt with before we re-enter the fast path is how we force the stupid compiler to keep it out of the fast path.
> ugly code for address calculation... might affect throughput a little
What I'd actually worry most about is poisoning the prefetchers, and speculation more generally. They're very very good at handling things like "increasing stride off this base". They struggle more with things like "double indirect register access to determine next address", though there is so much compiler crud out there that they have some surprising capabilities. Basically: simple stupid loop stride is going to do well with them. Complicated four-instruction chains to generate an address that could have been `[base + 8*stride]` or whatever is just... not helping. gcc does perfectly well here. It has multiple offsets floating around, but all of those instructions to update them can update superscalar, in a single cycle. The clang chain is a four-cycle delay. And to top it all off the branch can probably fuse in the simple addressing case!
If you can change the type on `next_j` over to `unsigned` (or `size_t` or ...) then a lot of weird stuff goes away. The dependency chains in address calculation at the beginning of the loop are gone too, which seems a win. (Or I'm sure there's some other, more complicated, way to get the compiler to get rid of them.) But if the space hit from using `unsigned` is allowable, I'd expect it to be both faster and less brittle.
The processor doesn't really know what you're up to, it only sees registers. When `j` is stored in `ecx`/`rcx` and `ecx` isn't changing, it knows it's free to push ahead pretty far on speculation. If the update to `ecx` is rare, putting it behind a well-predicted-not-taken branch will make it go away, as far as the speculation engine is concerned, and let the processor go far and fast. (The rollback on mispredict can be pretty painful, but, well, that's out-of-order execution for you.) That's what we're really trying to accomplish here: stuff that single register write behind a rare branch, somehow.
Here's what that can look like: https://clang.godbolt.org/z/1ss6hsEKb
Note that I disabled unrolling because some approaches got unrolled more than others. (I saw no unrolling, 2x, and more!) Comparing them without unrolling is fairest, I think, though it's also interesting to see how far they can unroll without assistance.
I also found that clang didn't need any additional fencing (or care if it was present), but gcc did, so there's an `asm volatile` style fence, which I think is a lot more clear than the other tricks. (Your mileage may vary; people who've done a lot of low-level work won't blink at these, while others will just stare agape. Perhaps also not blinking, but for opposite reasons!)
(Mind you, I didn't actually run any of this, so, well, you get what you pay for.)
Of course the details of what specific parts are purchaseable on the open market can and will change this calculus a lot.
TL;DR: I'm surprised this isn't a laser printer, as those are actually quite a bit easier to design and manufacture, especially if you can use a cheap, older, commonly available, remanufacturable toner cartridge.
Quantum mechanics is an excellent example here. It is not "defeatist" to accept that we don't know where the electron in the hydrogen atom actually is. Or to accept that if we really, really wanted to figure out where it is, we can only do so by disturbing it enough that its position is probably no longer a useful thing to know.
These are fundamental features of the world (at least according to our best theories of Nature), and it is only by accepting them and the uncertainties inherent to them that we are able to make progress using those theories. Among the consequences is that thinking about "the position of the electron" is not so useful; we instead need to leave position behind and start thinking using a new thing, "the orbital of the electron". This is a major conceptual change, and internalizing it can be Very Difficult for some people.
But the world does not care. It and its complexity owes nothing to anyone. It is us who must adapt to the world, in all its fuzziness and incompleteness. Nature will break the rigid, but if you bend, you can soar.
The obstacles aren't technical. They never really have been. The obstacles are human: political, bureaucratic, and corporate. It's not about "can we build a safe nuclear plant?". It's about "do you trust these bozos to build a safe nuclear plant?", remembering that if said bozos screw up, the damage is basically irreversible.
That's the problem.
LILCO Shoreham, for example, famously couldn't build backup gernerators that worked, until they exploded and had to be completely redesigned and replaced. Does that inspire confidence in the rest of their plant?
No, that is not true at all.
This is a kind of thinking a lot of programmers fall prey to. The real world, outside of code, is a very fuzzy and inherently analog place. There is very rarely one in any complex system having a complex problem needing a complex solution. At some point even the definition of diagnosis gets fuzzy.
The best demonstration of this in medicine is probably the DSM-5. What, really, is the difference between Narcissistic Personality Disorder and Borderline Personality Disorder and Generalized Anxiety Disorder? Can they overlap? (Yes.) How do you treat them? (It's not easy.) What about depression: how do you tell if someone has Major Depressive Disorder or Bipolar Depression? (Again: not easy.) In some circumstances the only way to tell the difference between the two is what drugs work: if antidepressants help, it's Major Depression; if mood stabilizers help, it's Bipolar Depression. It's kind of odd to define a One True Diagnosis by "well we fixed it this way, so it must have been that", with no other way to do it, isn't it? (What if both work? What if one works for a while, then the other works? What if treatment with antidepressants induces bipolar (hypo)mania? All of those happen!)
And that's just a few examples.
Great seat number though.
1. "Funding" meaning: We knew what we had to do but didn't have enough money to do it; if we had, this path would have worked (though why it says "TAM" here I don't quite get);
2. "Technical" meaning: We knew what we wanted to do but couldn't quite make it work; if we had, this path would have worked
3. "Uptake"/"Regulatory" (perhaps not the most natural pairing, though I see why they're together) meaning "We couldn't get people to actually do it"/"The authorities wouldn't let us do it"; if we had, this path would have worked
But that is missing a much different type of failure:
4. "Strategy" meaning "This path does not actually lead to our goal"
It's easy to see why in marketing material they'd leave out that last one. They want to build confidence! But for a moonshot like this, especially a biological one, it's kind of silly to think that this is definitely the best way to achieve this goal. I am, personally, quite skeptical; this reads like a mashup of SV and germophobes (with apologies to, well, both of those groups). I hope it works! And I won't stand in its way. But I won't be betting my own money on it. Probably we will learn something interesting no matter what.
More generally, this is a distinction that a lot of people miss (often intentionally, if PR/marketing is involved): strategy and tactics are distinct and they can succeed or fail independently. The best execution (tactics) here will not help if the plan (strategy) is flawed. And there are numerous other examples from research, business, and of course everyone's favorite hobby subject, war, of what happens when your tactics are good but your strategy isn't, or vice versa, or any of the other combinations. And, of course, making decisions about when to pivot (switch strategies) and all those other fun topics.
Everyone else has dodged this bullet. I'm surprised, pleasantly, that S&P et al actually made the right choice here.
I don't really get this either. I've come to think that it comes down to two pieces. The easy piece is that some people don't seem to realize just how good renewable power sources have gotten in the last 10-20 years. Nuclear has simply been outcompeted in so many ways. But this happened pretty quickly, so not everyone has gotten the message.
The other one is more subtle. For decades there were a lot of bad attacks on nuclear as a technology. (And a few good criticisms, but for some reason those never seem to get the attention, even though they should -- they're pretty strong arguments!) There's a certain type of person who loves to debunk these bad arguments, and there's plenty of that type of person around here. And that can get you emotionally invested into the thing you've been defending (perhaps rightfully: they were crappy arguments against it), and might keep you promoting it after its natural time has passed.
(To be clear: I don't think nuclear plants are worthless, and I think keeping the ones we've got operating smoothly as base load stations is probably an excellent idea. But I don't think it makes a whole lot of sense to be building more of them these days.)
So what do you do in practice? You have to normalize: you don't calculate log x, but instead log x/U for some scaling unit U. It's typical for U to be something like 1 mV or 1 W in electrical engineering, for example. This is completely legitimate, but it does mean that the thing that comes out needs a corresponding unit attached to it: dBmV, dBW, et cetera.
And it's really kind of important to be careful about that.