6
atheist
3d

My new favourite consensus algorithm:

Get several devs to implement the same standard. Compare the results for lots of different test data. The consensus "correct" result is the one that is most common from all Implementations. Where consensus can't be found, the devs are shown each others code and it's a race to find bugs to invalidate an implementation that disagrees with yours. Implementations that don't follow "correct" behaviour must be updated accordingly, even if it means copying bugs from other code.

The insane thing is this is legit how it works, like python's typing standard is based on mypy and other type checkers have to match its behaviour. Unicode isn't really a standard, it just started to describe how text works in different places instead of the fights to the death battle royale we used before that.

Comments
  • 1
    the standard is unit tests you say?
  • 4
    I had a networking class in uni where we had to write a standard as a team and each of us had to write implementations and we would be graded on compatibility. I kept nagging everyone to please decide on byte order, and when they didn't have any opinion, I suggested big endian.

    During testing on submission day it became obvious that they didn't care because they didn't know what byte order is and just punned their number fields into byte arrays, so every implementation except for mine was little endian, at least on their computers and presumably the prof's.
  • 1
    @lorentz
    Did you get a bad grade because of that?
  • 3
    @Tounai nope, I replaced to_be with to_le and from_be with from_le and fixed everything immediately.
  • 0
    @lorentz And then you realize professionals aren't much better :(

    Glad your prof wasn't an ass or did you catch it ahead of time?
  • 1
    @BordedDev We caught it ahead of time. The prof hated that he had to teach and would rather have spent all his time researching like nearly all undergrad teachers do, so he did not give a single shit about the assignment, copied an old Cambridge spec and then graded us on vibes.

    Another part of the assignment was that each of our implementations had to have a proprietary extension that we didn't standardize, to demonstrate the extensibility of our protocol. About two thirds of the class lost points because the proprietary extension "could've been more interesting", whatever the fuck that means for the likes of the shitty flat-map directory protocol that we ended up on the more complex end of the spectrum with.
  • 1
    6 teams independently decided on a variation of Redis, I don't call ours that because we dedicated a lot of thought to partial retrieval for very large values so it would actually work decently well as a file store.
  • 0
    @lorentz Yeah, I've had profs like that as well. My most passionate one didn't code much funnily enough
Add Comment