WTF Bites
-
@Tsaukpaetra said in WTF Bites:
It uses the filesystem inode number of the running user's home directory as the password for the private key.
Wonderful. Hope that's actually unique and non-predictable...Wait, so if you ever change home partition for any reason (backup restore, migration to bigger drive), it stops working?
Yep! Gonna need to redo from start!
Edit: That is to say, if you didn't happen to jot down the number beforehand and thus can decrypt it and re-encrypt it with the "new" one.
-
You've got to be kidding me!
Yes, it's obviously supposed to be:
} else {
... Yep...
The real question is... we have egyptian braces, but why don't we have pyramid somethings?
I saw something similiar recently in our code base but was only six or seven deep. I never got around to putting on light theme and seeing how pretty rainbow indent would be.
Yeah, I've seen a lot fewer of these things the last 10-15 years. Possibly because people don't care enough and just let the NPE bubble up instead.
I’d prefer that to be honest to what I’m seeing in one of the prs. Try catch return 404 at the controller. Not even a logging of the exception. I still have no idea what leap of logic got me to missing properties.
-
Despite developing Linux distros themselves, Red Hat does not seem to know what a Linux distro is.
Examples are two desktop environments and a piece of hardware!
-
@Atazhaia eh...kind of. They're right that some distros are meant to be used right away as a desktop environment (all the normal stuff you'd need is installed already) and some are meant for other purposes.
-
a piece of hardware!
Doesn't Raspberry Pi have its own distro and/or desktop environment?
-
@loopback0 said in WTF Bites:
a piece of hardware!
Doesn't Raspberry Pi have its own distro and/or desktop environment?
Raspberry Pi OS, formerly Raspbian
-
@boomzilla But neither Cinnamon nor XFCE is a complete distro. Cinnamon is the default desktop for (and part of) Linux Mint, so Linux Mint would have been a better mention. It's like talking about "other operating systems like Windows Shell and Aqua".
-
This post is deleted!
-
This text was carefully engineered to make everyone focus on the stupid mistake and not talk about the actually sinister part below where they gaslight readers into thinking community distros are in some way inferior to RHEL.
-
@Gustav to be fair, does IBM actually know what anything is any more? You’re probably right but I raise the possibility of incompetence rather than malice just in case.
-
I raise the possibility of incompetence
Right. I think it's just badly worded.
-
@loopback0 I wondered if manglement and or the corpo lawyers had gotten involved.
-
This text was carefully engineered to make everyone focus on the stupid mistake and not talk about the actually sinister part below where they gaslight readers into thinking community distros are in some way inferior to RHEL.
Especially that part is just another stupid mistake:
Community distros are a great option for beginner Linux users who don’t have much experience with the command line, or who just want to play around and experiment.
The more experienced command line users obviously go for enterprise distributions like Arch, Gentoo, Kali, or LFS.
But there's no need to gaslight anyone anyway. If you leave the decision what to use in your company to the ones who'll be running it, they don't need the article (or if they do, it's a failure either way); if it's the execs deciding, the guiding question is "has anyone ever been fired for buying RHEL?".
-
@loopback0 I wondered if manglement and or the corpo lawyers had gotten involved.
You mispeld "copro"
-
@LaoC but then I would be repeating myself.
-
The real question is... we have egyptian braces, but why don't we have pyramid somethings?
It's actually a thing.
That article is fucking awful. I hope the writers die in a fire.
-
That article is fucking awful.
It's Wikipedia. Wikipedia makes Sturgeon's Law wildly optimistic.
-
That article is fucking awful. I hope the writers die in a fire.
It's Wikipedia. Edits are accepted.
-
That article is fucking awful. I hope the writers die in a fire.
It's Wikipedia. Edits are accepted.
That's the best joke I've heard today!
-
@Parody they are accepted. Just not necessarily for very long
-
-
@boomzilla … interesting, but without branch (with conditional instruction I suppose) the pipeline should always work anyway. Seems something is rotten in the Apple silicon.
-
That's approximate enough
-
@boomzilla said in WTF Bites:
https://medium.com/@ludirehak/printing-lol-doubled-the-speed-of-my-go-code-e32e02fc3f92
LOL Go.
is that article.
This view highlights that the comparison in if_max_lol() spends CPU time executing a branch instruction (Branch if Less Than): BLT -6(PC).
Are you telling me the first one has no branch at all? You didn’t show the instruction(s) after the
CMP R4, R3
, so I’m not going to believe that. Why would it do a comparison and then not branch?So, the compiler saw the print(“lol”) statement in the source code, and generated an extra conditional branch instruction. This, in turn, invokes the branch predictor.
The branch predictor should be “active” for every branch. And since I don’t believe the first version is branchless, this doesn’t make sense.
What’s that? Here is ChatGPT’s explanation
If you’re not going to explain it, at least link to something that’s not AI generated bullshit. If I wanted to read generated bullshit, I’d go to MSDN.
-
@topspin Predicated instructions? IIRC ARM supports that on a bunch of instructions. But even x86 has
cmov
. Basically, the instruction either executes normally or becomes a nop based on the predicate/flags.That said, the article is weird (and, yeah, half of the code is missing, so we don't get to see if there's actually a predicated instruction). If the print were ever to execute, it should take all the time in the world. Article later mentions that -at least in some of the tests- the input was sorted in ascending order, so the mov would always take place. I'm also not sure why there's the
continue
-- at least in the first example, it shouldn't affect final code, because the compiler should be able to get rid of it. Assuming go'scontinue
does what it does everywhere else (maybe a big ask).
-
Are you telling me the first one has no branch at all? You didn’t show the instruction(s) after the
CMP R4, R3
, so I’m not going to believe that. Why would it do a comparison and then not branch?It has to have one branch, the one returning to the start of the loop. But for the condition, ARM supports predicates on almost all instructions—except in thumb mode, but the 64-bit version does not have that—so it would just do a conditional move.
Apparently, LLVM is good enough to emit these predicated instructions even with optimizations turned off, because the code does not appear to be optimized. If it was compiled with optimization, I'd expect the loop to be unrolled and, at least in the version not calling the
print
, vectorized. At the very least I'd expect the loop to be unrolled to take advantage of the ARM ability to load multiple registers from consecutive addresses at once (that is most often used to save and restore registers to stack frames, but unlike x86's pusha/popa, the load/store multiple instructions let you choose which register is the address and arbitrary set to load/store).Now I'm guessing that because the code is not optimized, the body of the conditional is actually somewhat complex, with all the instructions in predicate mode. It shouldn't. It should be just one move. But perhaps it is actually storing into memory though it shouldn't need to or something like that and that makes the predicated part, even when not actually doing anything, take relatively long.
-
This post is deleted!
-
@topspin Predicated instructions? IIRC ARM supports that on a bunch of instructions. But even x86 has
cmov
. Basically, the instruction either executes normally or becomes a nop based on the predicate/flags.Yeah I just looked, that's exactly what the compiler uses on x86.
That said, the article is weird (and, yeah, half of the code is missing, so we don't get to see if there's actually a predicated instruction). If the print were ever to execute, it should take all the time in the world.
It does.
goos: linux goarch: amd64 pkg: github.com/ludi317/max cpu: 12th Gen Intel(R) Core(TM) i7-1270P │ if_max_lol │ if_max │ │ sec/op │ sec/op vs base │ Fn/len=100000-16 73131.38µ ± 1% 42.07µ ± 0% -99.94% (p=0.002 n=6)
Even with an empty string in the
print
it's obviously still dog slow
-
But even x86 has
cmov
. Basically, the instruction either executes normally or becomes a nop based on the predicate/flags.But isn't the point of that to make it never hit the branch misprediction penalty? I don't quite understand how it does that, because it seems semantically the same. It still needs to "branch" internally depending on the flag, but I guess unlike an actual branch it knows where to continue execution and doesn't need to flush the pipeline.
Anyway, this article makes it sound like the conditional move always has the penalty of a mispredicted branch instead of never.
-
@topspin Yeah, the explanation appears to be bogus. The branch is continuing the loop either way, so it should be predicted as jumping either way too, and the point conditional instructions is indeed to avoid penalty of misprediction (or of the lack of prediction, because the early ARM chips didn't have a predictor at all).
-
EXEC('CREATE USER ['+ @userName +'] WITH PASSWORD = '''+ @password +'''');
The create user statement in mssql can't be called with parameters binding in a saner manner?
-
Yeah, the explanation appears to be bogus
Same - my guess is that this isn't related to branch prediction. The little snippets that are shown point at the cmp instruction (which isn't a branch). It seems to stall there for some reason.
At a guess, the cmp is the first place where both the loaded value and the previous value are required. It'd stall if either of them weren't there. So either the load of the new value is taking longer (we don't see it explicitly, so who knows), or the previous value (maxV) isn't there yet. Could be (more guessing) that a branch-y version somehow invokes a optimization that forwards the result faster than the conditional instruction. Is that actually the case? That would need some testing (which would need figuring out a way to test this first). Why would that be the case? No idea.
If the article is right, and if there is a conditional instruction (and nothing else funky that isn't being shown), and the conditional version is indeed slower than a branchy one, then that could be considered slightly problematic.
But, at this point, one would have to start testing from scratch. Probably read relevant optimization manuals, assuming Apple makes those for their silicon. Article may have stumbled upon something, but isn't exactly what I consider a good source of information (copy-pasta:ing an essay about branch prediction from ChatGPT is for sure not driving confidence up).
-
@cvi All other things being equal, I'd expect whatever produced the denser code to be better in practice, as it let's more of the working set be kept in cache. All other things aren't equal, of course.
The other thing would be to look to see if the assembler did something dumb. Or that the post author didn't get the figures reversed.
-
@dkf we all know what has to say about journalists after all
-
Ooh, a double WTF!
First of all: Why is Windows 11 listing all USB devices twice, with the second one out of order (according to drive letter)?
Second: I have apparently created an install USB with Microsoft Windows Debian Edition 11 judging from the icon.
-
Why is Windows 11 listing all USB devices twice,
I noticed this too, apparently removable drives get listed in the root tree now, and you're also expanded This PC.
apparently created
Windows doesn't like to refresh the icon cache of drives unless it receives a device insertion/removal event. It also caches some other things despite that signal, which resulted (I think i posted in this thread) in my SSD being marked as a HDD hybrid compete with wrong model number and other stuff.
-
@Tsaukpaetra I did a remove/insert (and the computer was booted with the drive in anyway) and it still got the Debian icon. Make me wonder how the custom icon has managed to persist through reformatting, or if Windows is hard caching it to hell and beyond as rebooting or reinserting has done nothing.
-
Windows is hard caching it to hell
"Could not delete folder.
thumbs.db
is open in A Program.`
-
@Tsaukpaetra said in WTF Bites:
thumbs.db
-
EXEC('CREATE USER ['+ @userName +'] WITH PASSWORD = '''+ @password +'''');
The create user statement in mssql can't be called with parameters binding in a saner manner?
mssql
sane
-
Make me wonder how the custom icon has managed to persist through reformatting, or if Windows is hard caching it to hell and beyond as rebooting or reinserting has done nothing.
The device ID has an optional association to an icon in the registry that overrides the one for the device class. Must be specified in this case.
-
@dkf I dunno why Windows would register that optional association on itself, though. Also, it only goes for the small icon in the sidebar. If I open This Computer and look at the big icon it has the "Windows Install Media" icon.
-
@Atazhaia That's what you get for deleting thumbs.db
-
@hungrier Clearly thumbs were a mistake and has only led to a detriment for the human race as a whole.
-
@hungrier Clearly thumbs were a mistake and has only led to a detriment for the human race as a whole.
No-one should ever have left the oceans to begin with.
-
@hungrier Clearly thumbs were a mistake and has only led to a detriment for the human race as a whole.
No-one should ever have left the oceans to begin with.
Birds and lizards are alright. Most terrestrial arthropods are fine. Even synapsids
havehad their day (Dimetrodon, anyone?).No, therapsids were a critical mistake. They should never have existed.
-
No-one should ever have left the oceans to begin with.
But the water was too cold
-
@TimeBandit Then heat it, dear Henry, dear Henry, then heat it, dear Henry, dear Henry, heat it.
-
@TimeBandit said in WTF Bites:
No-one should ever have left the oceans to begin with.
But the water was too cold
It's hard to get out of the water when it's covered by 10 feet of ice.
-
@HardwareGeek said in WTF Bites:
@TimeBandit said in WTF Bites:
No-one should ever have left the oceans to begin with.
But the water was too cold
It's hard to get out of the water when it's covered by 10 feet of ice.
Not hard enough.