Live data from Hacker News

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

chess.com

131–140 of 338 posts

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

#131
post #46

Earlier quoted context omitted.

Similar to how much effort goes into dealing with things like dangerous strains of bird flu, only to have people complain about how much money was spent on "nothing" when an outbreak doesn't occur.

This is a whole class of problem - I wonder if there's a name for it. More examples include: talking about welfare being unnecessary because no one is starving. Or people on medications stopping because they feel better (while still on them).

This makes me think of a hypothetical scenario proposed in one of Nassim Nicolas Taleb's books where-in some senator gets a bill passed in the weeks before 9/11 requiring reinforced doors on all commercial airplane cockpits.

No parade would be thrown for this senator for having prevented 9/11 and likely he'd be castigated for having given airlines an excuse to raise prices due to restrictive government regulations.

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

#132

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 any case though, I'm curious how inaccurate the televised reality from my youth actually was.

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

#133
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.

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

#136
post #53
post #8

Self-confidence as a programmer is when starting a new project, storing the transaction ID as a long rather than an int...

> Self-confidence as a programmer is when starting a new project, storing the transaction ID as a long rather than an int... uint64_t even Or a UUID as others have suggested. Technically C spec doesn't really say exactly how many bits int, long and long long should be. If you want specific sizes and your code to be somewhat portable use the specific bit sizes to make that clear. There are also types for size-like thi…

The C spec does specify minimum sizes: at least 16 bits for int, 32 for long, and 64 for long long.

Best to use the stdint types, just in case.

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

#137

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.

As a former Y2K project manager, I had one thing go BOOM. But it didn't go boom on 1/1/2000, rather on 2/29/2000. Our Y2k program had, IIRC, some 9 likely fail dates including the 1/1/2000 date. The component in question was provided globally and untestable locally, so I the best I could do is acquire a copy of the remote complete test script and call it good.

I was thrilled that we had something to point to as a "see, this is why we put in so much work". Prior to that had received lots of criticism about the amounts spent, people hired, blah blah blah.

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

#138

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

Think of a mechanical odometer, and how it only has a certain number of digits. Eventually you'll hit 999,999 miles, and on the next mile, everything will roll over to 000,000.

Same deal here. 32-bit numbers are stored as 32 switches, starting from

    0000 0000 0000 0000 0000 0000 0000 0000
which is 0, to

    1111 1111 1111 1111 1111 1111 1111 1111
which is 4,294,967,295. Since the 32-bit iOS version of Chess.com apparently uses 32-bit numbers to store each game's unique ID, that means you can have 4,294,967,295 games.

So what happens on game 4,294,967,296? Just like the odometer, everything rolls back to 0, and things start breaking because the program gets confused.

Pretty common problem, really. The fix would be to use a 64-bit number, which doubles the number of binary digits.

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

#139
post #46

Earlier quoted context omitted.

Similar to how much effort goes into dealing with things like dangerous strains of bird flu, only to have people complain about how much money was spent on "nothing" when an outbreak doesn't occur.

This is a whole class of problem - I wonder if there's a name for it. More examples include: talking about welfare being unnecessary because no one is starving. Or people on medications stopping because they feel better (while still on them).

I mean, yes, but from the outside some examples can look an awful lot like "my tiger-repelling rock works because we haven't been attacked by tigers".
Post reply on HN