Live data from Hacker News

Chess.com stopped working on 32bit iPads because 2^31 games have been played

chess.com

201–210 of 338 posts

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#201
post #60

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

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.

> 2 billion is a very large number that was probably not envisioned as reachable in the near future

I disagree. Simple napkin calculation: 100 million players playing 40 games each per year (about 1 per week) over 5 years = 10 billion unique games.

As others pointed out it was likely not a miscalculation, just a lack of calculation. The bug occurred only in the client and the decision to use a smaller data type was likely not a conscious one.

In any case, I wouldn't hold it against an individual programmer. But arguably this sort of bug indicates your development process has flaws (not enough testing, code reviews, etc).

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#202
post #188

Earlier quoted context omitted.

The reason is that anything else is using default types and you lose your safety battle in each: int32_t x = call_returning_int(); line. Otherwise, you assert/recover on each me-they borderline. C is a language where you have absolutely no guarantee that int or constants defined as int will fit into anything beyond int, long or long long, and then there is UB patiently waiting for your mistake. The method of handling…

This is a perfect use for the C++ auto feature: auto x = call_returning_int();

C had this particular feature for decades.

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#203
post #152

Earlier quoted context omitted.

If you were watching closely and knew what to look for in the first couple of months of 2000, the failures were there. But they were generally minor and easy to overlook as Y2K problems. I spotted something like half a dozen failures in various systems I interact with which I strongly suspected, based upon the timing, were likely Y2K problems that slipped through testing. For example, I received duplicate bills for o…

in JavaScript, new Date().getYear() returns 117 :)

getYear() is based from 1900, if you use getFullYear() you'll get 2017. Though, given all the additions to ES201*, it would be nice if all the timezone data were in the browsers, so one could get moment-timezone without the, relatively large data files.

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#204
post #22
post #14

Earlier quoted context omitted.

IIRC at least slashdot and twitter had to do some non trivial database migrations because they hit maximum value of some ID field.

Twitter's was called the twitpocalypse and it was a pretty big deal at the time. I don't know how bad it was internally, but it hit a lot of third-party apps that stored tweet IDs in 32-bit integers. One interesting aspect of it was that Twitter realized what was going to happen in advance, and artificially pushed their IDs over the edge at a preplanned time so they could have as many people available as possible to…

I think Instagram also recently (year?) passed the 31 or 32 bit mark, as some client lib I was using started failing.

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#205

Earlier quoted context omitted.

Some people were. But it's worse than that. In the 90s a lot of code used 16-bit values, character strings. That is, it stored a char(2), parsed it as 2-digit number and then converted it to a date by adding 1900. So it was only really "saving space" when compared with storing a char(4).

But if they wanted to save space why not store a 8 bit number? I imagine it must have something to do with punch card compat or some binary coded decimal nonsense. Still seems inefficient.

Maybe because they didn't know better? I was going to say "maybe they were bad programmers", but likely just "average" programmers.

No punch cards or BCD, I'm talking about DOS/Windows systems.

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#206

Earlier quoted context omitted.

"Wait, we spent two million dollars servicing your fleet of 100 cars in the last year, and you're complaining that none of them broke down? Why spend all that money on maintenance when they just keep running?"

Are you sue those numbers are right? That's 20k per car per year. At such a cost running the cars with no maintenance then buying new cars every break down is cheaper.

They were intentionally inflated - however I probably had Australian pricing in mind which is probably about 50% more expensive than the US ones. Considering the audience I guess I should have said 150 cars instead. :)

A lot of money was spent fixing the Y2K issue. Can't exactly recall how much time I spent myself, but it was a dominant factor as far as IT projects went back then.

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#207

It'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.

Maybe it's because of how young I was at the time, but I remember media outlets reporting on the Y2K problem, and showing video of hundreds of older computing devices that were being retired (thrown in landfills) because they wouldn't work properly after the date change happened. Maybe this isn't a "real" failure, and the symptom of some IT departments working diligently to solve the problem before it happened. In an…

Y2K was a software issue.

In short and very simple terms, some software stored date as DD/MM/YY.

It would asume that for year it would always prefix 19. The problem was when you reached /00. Any calculations or software decisions that happened based on that date, it would be off. Way off.

Some solutions where expanding the date to YYYY or adding a prefix to the new dates. Dates without the prefix would be 19xx. Date with the prefix X was 19xx and dates with prefix Y where 20xx.

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#209
post #194

Earlier quoted context omitted.

I wish. I do have dandruff (depending on where in the world I happen to be). Head & Shoulders does absolutely nothing.

Not merely an insightful repository of analysis and explanations around the more profound aspects of our world, John Ralston Saul's exquisite Doubter's Companion includes some answers - acerbic accusations bundled free - to the more pedestrian issues: "DANDRUFF: The ANSWER is usually vinegar. To some problems there are solutions. "What we call dandruff is often the result of a PH imbalance on the skin, which shampoo…

I suffer from dandruff, tried a bunch of shampoos but they didn't work well. I saw this tip about vinegar, which I tried a single day then I gave up thinking this could be popular saying. I'll try again and report.

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#210
post #194

Earlier quoted context omitted.

I wish. I do have dandruff (depending on where in the world I happen to be). Head & Shoulders does absolutely nothing.

Not merely an insightful repository of analysis and explanations around the more profound aspects of our world, John Ralston Saul's exquisite Doubter's Companion includes some answers - acerbic accusations bundled free - to the more pedestrian issues: "DANDRUFF: The ANSWER is usually vinegar. To some problems there are solutions. "What we call dandruff is often the result of a PH imbalance on the skin, which shampoo…

Stop spreading psuedo-scientific alternative-medicine falsehoods. Dandruff is in no way caused by a "PH imbalance on the skin": http://www.mayoclinic.org/diseases-conditions/dandruff/diagn...
Post reply on HN