this post was submitted on 08 Nov 2024
749 points (98.2% liked)

Programmer Humor

19630 readers
964 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] Allero@lemmy.today 28 points 2 weeks ago (5 children)

The most beautiful thing about this program is that it would work.

Various bit flips will once lead to all numbers being in the correct order. No guarantee the numbers will be the same, though...

[–] fallingcats@discuss.tchncs.de 8 points 2 weeks ago (1 children)

Those bitflips are probably more likely to skip the section erroneously than waiting for the array to be sorted.

[–] Allero@lemmy.today 2 points 2 weeks ago (1 children)

Fair enough! But won't they flip again to start the program?

[–] fallingcats@discuss.tchncs.de 2 points 2 weeks ago

The OS would crash entirely before that happens

[–] Midnitte@beehaw.org 7 points 2 weeks ago

Might also take a very long time (or a large amount of radiation).

[–] Zoomboingding@lemmy.world 6 points 2 weeks ago

Reminds me of a program in Homestuck. It's code that iterates until the author/universe dies, then executes some unknown code. The coding language is ~ath, or TilDeath.

[–] ProgrammingSocks@pawb.social 3 points 2 weeks ago (2 children)

Not necessarily. I don't have the numbers in front if me, but there is actually a probability that, past that point, something is so unlikely that you can consider it to be impossible (I.e. will never happen within the lifetime of the universe)

[–] TriflingToad@sh.itjust.works 1 points 2 weeks ago

screw the universe we be flippin' 😎🏄‍♀️

[–] Dyskolos@lemmy.zip 1 points 2 weeks ago

Yet... The chance is never zero 😁

[–] Buddahriffic@lemmy.world 2 points 2 weeks ago (1 children)

I'm not sure there's any guarantee that it will ever be sorted, since bit flips will be random and are just as likely to put it more out of order than more in order. Plus if there's any error correction going on, it can cancel out bit flips entirely until up to a certain threshold.

Though I'm not sure if ECC (and other methods) write the corrected value back to memory or just correct the signals going to the core, so it's possible they could still add up over time and overcome the second objection.

[–] dan@upvote.au 2 points 2 weeks ago

ECC (and other methods) write the corrected value back to memory

That was my understanding (it corrects the error and writes the good value back to RAM), but now I'm not so sure! I imagine it must do that, otherwise a second bit flip would actually corrupt the RAM, and the RAM manufacturer would want to reduce that risk.

Regular ECC adds an extra parity bit for each byte. For each byte of memory, it can correct an error in one bit, and detect but not correct an error in two bits, so they wouldn't want a one bit error to linger for longer than it needs to.