Chess.com stopped working on 32bit iPads because 2^31 games have been played(chess.com)
chess.com
Chess.com stopped working on 32bit iPads because 2^31 games have been played
https://www.chess.com/forum/view/general/impossible-de-jouer-depuis-deux-jours-quel-est-le-probleme
326 comments
Self-confidence as a programmer is when starting a new project, storing the transaction ID as a long rather than an int...
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
- Erik, CEO, Chess.com
"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.
Snarky... Except that there were probably years of games to notice that you were approaching a "magic number" like 2^31.
I recently experienced a nasty bug with BLOB in MySQL. The software vendor was storing a giant json which contained the entire config in a single cell. It ran fine for months, and then when it was restarted it totally broke. Reason was: the json had been truncated the entire time in the database, so it was gone forever. It was only working because it used the config stored in memory on the local system. Nasty!
This problem is more related to a programming underestimation than the actual limitations of a 32bit CPU (which can happily process numbers or IDs that arbitrarily big if you have the memory for it and program it correctly).
That said, this is definitely indicative of what's going to happen in just 20 years, 6 months and 20 days from now. I mean, we're still cranking out 32bit CPUs in the billions, running more and more devices, and devs still aren't thinking beyond a few years out. I know of code that I wrote 12 years ago still happily cranking away in production, and there may be some I wrote even longer than that out there... and I guarantee I hadn't given two thoughts about the year 2038 problem back then, and I doubt many devs are giving it much thought today.
It's truly going to be chaos.
That said, this is definitely indicative of what's going to happen in just 20 years, 6 months and 20 days from now. I mean, we're still cranking out 32bit CPUs in the billions, running more and more devices, and devs still aren't thinking beyond a few years out. I know of code that I wrote 12 years ago still happily cranking away in production, and there may be some I wrote even longer than that out there... and I guarantee I hadn't given two thoughts about the year 2038 problem back then, and I doubt many devs are giving it much thought today.
It's truly going to be chaos.
Long long time ago, I created a poll on a small website I was maintaining. I didn't expect much traffic and, so, not thinking too much about it, I put the ID column to be a TINYINT (i.e. max value = 255)...
That was a valuable lesson.
(I actually generated most entries myself while testing stuff - live in prod of course - and while there were probably fewer than 255 votes, the AUTO_INCREMENT did its job and produced an overflow).
That was a valuable lesson.
(I actually generated most entries myself while testing stuff - live in prod of course - and while there were probably fewer than 255 votes, the AUTO_INCREMENT did its job and produced an overflow).
Reminds me of the havoc that was caused when Twitter tweet IDs rolled over. Resulting in every third party developer to update their apps (and at the time there were a lot of those).
Twitter saw it coming and forced the issue. By saying that at a certain date and time they would manually jump the ID numbers rather than wait for it to happen at some unpredictable time.
Twitter saw it coming and forced the issue. By saying that at a certain date and time they would manually jump the ID numbers rather than wait for it to happen at some unpredictable time.
This reminds me YouTube changed its view counter from 32-bit integers to 64-bit integers due to the popularity of 'Gangnam style' https://www.wired.com/2014/12/gangnam-style-youtube-math/
Do we know when chess.com launched? If so, we can calculate the average number of games being played per second.
were they ever expecting negative number of games? why signed integer?
How many other examples like this have occurred throughout computing history?
Fun to read some of other stories where this bit them too (PacMan, WoW, and eBay)! Anyway, new app has been approved by Apple and should be rolling out soooooooooon....
Thanks for all the comments! Always lots to learn from.
Thanks for all the comments! Always lots to learn from.
So they probably just need to use longs instead of ints. But I'm curious, if you were really stuck with a 32-bit limit on data types, what's your preferred workaround? I'm thinking I'd add another field that represents a partition. Are there other "tricks"?
eBay (almost) had this problem and I cannot find any articles about it online. They were rapidly approaching 2^31-1 auctions. So they switched to a larger integer, the switchover went badly, and they were mostly down for 4 days, if my memory serves. This would be like 10+ years ago I think.
A lot of comments but no one said the great time that we are living for chess. So many games online, ready to be analysed and learn from them. After deep blue people thought that it was the end of chess, but it´s only getting better. Computers helping players to improve.
Chess.com is a great site, also lichess.org and chessable.com if you like chess you should check them.
Chess.com is a great site, also lichess.org and chessable.com if you like chess you should check them.
That's the most successful reason for failure.
The title is probably wrong, off by one.
You probably mean 2^31 -1.
You probably mean 2^31 -1.
These are always the best problems to have
The other one to watch out for is the 53-bit javascript integer limit. That caused the twitpocalypse when Twitter tweet IDs hit it. They had to switch to strings in the JSON representation.
And I was just reading Heroku/Django discussing the same issue this morning!
https://groups.google.com/forum/m/#!topic/django-developers/...
https://groups.google.com/forum/m/#!topic/django-developers/...
Issues like this are not uncommon on Chess.com. I've been playing there since 2008 or 2009. If you read recent comments about issues as they pertain to the recent "v3" release ... as much is to be expected.
> For f sake how are we supposed to Anderstand that. I suppose your French fry maker is broken ?
Didn't expect Chess.com and YouTube to have a crossover of users? Surprised there isn't active moderation on a site this size.
Didn't expect Chess.com and YouTube to have a crossover of users? Surprised there isn't active moderation on a site this size.
[deleted]
What would be the best way to test for this kind of issues in advance. Testing at theoretical limits at all endpoints?
Will the Lichess app and platform have this issue? And if not, why not?
> an unforeseen bug that was nearly impossible to anticipate
Hmmm... :)
Hmmm... :)
Real world example of why Apple is killing 32 bit apps on iOS.
"Obviously unforeseen.. impossible to predict." Really? You don't know how to properly store ID numbers?
IMPOSSIBLE to predict.
IMPOSSIBLE to predict.
I sometimes think it would've been better if a few things had visibly failed in January 2000.