Hey all. Thanks for noticing :P Obviously this is embarrassing and I'm sorry about it. As a non-developer I can't really explain how or why this happened, but I can say that we do our best and are sorry when that falls short. - Erik, CEO, Chess.com
It's an honest mistake, things like this happen. Not the end of the world, especially for an otherwise great product like chess.com. Go easy on your eng team ;)
Chess.com stopped working on 32bit iPads because 2^31 games have been played
71–80 of 338 posts
Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played
#72It's fascinating... the Y2K problem never came to fruition because - arguably - of the immense effort put in behind the scenes by people who understood what might have happened if they hadn't. The end result has been that the entire class of problems is overlooked, because people see it as having been a fuss over nothing. I sometimes think it would've been better if a few things had visibly failed in January 2000.
> I sometimes think it would've been better if a few things had visibly failed in January 2000. Having to spend billions of dollars on programmers' goofy means of saving a few bytes of memory is a pretty visible failure.
My dad's first programming job was initially to mechanically change how variables where stored thus saving 1 and only 1 byte of disk space. Someone ran the numbers and having someone do that for a few months was a net savings.
A few years after that he was talking about some relatively minor optimizations that saved a full million dollars worth of hardware costs by delaying a single new computer purchase.
Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played
#73Earlier quoted context omitted.
When's the last time you worked with an architecture that didn't use twos complement and roll into negatives on overflow? Your reserved bottom range is a perfectly good solution. But rolling into negatives seems fine, too.
C/C++ is notoriously head-ache inducing on this point. Yes, all the CPU archs you'd reasonably expect to encounter today behave this way. However, because the language standard says signed overflow is undefined, compilers are free to assume that it will never happen, and make optimizations that you'd think would be unsafe, but are technically permissible. [1] [1] https://stackoverflow.com/questions/18195715/why-is-un…
Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played
#74Hey all. Thanks for noticing :P Obviously this is embarrassing and I'm sorry about it. As a non-developer I can't really explain how or why this happened, but I can say that we do our best and are sorry when that falls short. - Erik, CEO, Chess.com
We can help you understand how and why! Computers set limits internally on how big numbers can be when they're keeping track of stuff. Your developers had given each game a number to identify it. So your first game was #1, the 40th game was #40, and so on. The limit for how big the number could be was a bit over 2 billion, and your players have just now played a bit over 2 billion games, and so that id number suddenl…
Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played
#75Hey all. Thanks for noticing :P Obviously this is embarrassing and I'm sorry about it. As a non-developer I can't really explain how or why this happened, but I can say that we do our best and are sorry when that falls short. - Erik, CEO, Chess.com
Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played
#76Hey all. Thanks for noticing :P Obviously this is embarrassing and I'm sorry about it. As a non-developer I can't really explain how or why this happened, but I can say that we do our best and are sorry when that falls short. - Erik, CEO, Chess.com
2 billion is a very large number that was probably not envisioned as reachable in the near future - as a programmer I'd argue this is a pretty easy mistake to make, and that while (slightly) embarrassing, its a good learning moment. It's also really awesome that you're here, and that you guys were so honest about the nature of the bug - this is really something that should be encouraged.
Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played
#77Earlier quoted context omitted.
Because signed is default for some reason in most languages, and most developers aren't taught to think critically about how decisions like simple datatypes might affect scalability.
The problem is momentum. I could use unsigned int everywhere, but then I have to constantly typecast to int and back anywhere I use a library expecting signed ints. If we all switched to unsigned int by default, then everything would make more sense but we'll all live in typecasting hell during the migration.
It was a mistake to use them for sizes in C++. Google code style requires using int64 to count sizes instead of uint32 for good reasons.
Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played
#78"This was obviously an unforeseen bug that was nearly impossible to anticipate..." Snarky... Except that there were probably years of games to notice that you were approaching a "magic number" like 2^31.
I actually read that quote as fully sarcastic.
Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played
#79Hey all. Thanks for noticing :P Obviously this is embarrassing and I'm sorry about it. As a non-developer I can't really explain how or why this happened, but I can say that we do our best and are sorry when that falls short. - Erik, CEO, Chess.com
It's a beautifully simple problem and one born of success.
Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played
#80Earlier quoted context omitted.
When's the last time you worked with an architecture that didn't use twos complement and roll into negatives on overflow? Your reserved bottom range is a perfectly good solution. But rolling into negatives seems fine, too.
Signed overflow is ub in C