Live data from Hacker News

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

chess.com

151–160 of 338 posts

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

#152

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.

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 one of my credit cards for the January 2000 billing period, and then a subsequent apology for the duplicate bills. They never said Y2K, but the timing was very suggestive.

It's pretty much exactly what I expected from most companies...the big stuff had been largely been dealt with, but a few things slipped through which they could dismiss with some hand-waving. The thing that surprised me was that there didn't really seem to be any high profile disasters (like a company that couldn't ship products, an airline that couldn't issue tickets, or whatever) at all...I figured there'd be at least a couple.

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

#153

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 m…

The sad part is people are going to look at the lack of a year 2000 event and assume 2038 is going to be a "dud", when they fail to see all the damn work that went into making sure Y2K was a dud including a significant portion of IT hours and probably a lot of extra support laid in.

I expect 2038 to be a rare hell because of the nature of the devices. Y2K was an IT problem, but 2038 will be an embedded system problem and that's going to be a much more painful thing to audit. Moving from the server room to inside equipment and walls is going to be fun.

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

#154
post #127

Earlier quoted context omitted.

- This decade I knowingly wrote code that will breaks in 2038 Sure, but how bad was it really? Something you could fix relatively quickly with a little time and money, or an instance of Lovecraftian horror unleashed upon the world like so much COBOL code?

Even then, mix in people switching jobs, losing the knowledge of where or what all these landmines are, and add similar but unrelated issues across your entire codebase. This stuff adds up. I like to at least add stern log messages when we are at 10%-50% of the limitation. It's saved my ass before, especially when your base assumption can be faulty. In one of those scenarios, where we expected the growth of an intege…

I'm assuming this is C/C++ so I'm wondering if there isn't some compiler pragma to have it warn people still building the code in 2025 or so?

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

#155
post #99

Earlier quoted context omitted.

The naive, 9 years in the past me once was like "int will last us forever! and it'll save us some space!", only to have to change it to bigint a few months later

"int will last us forever! and it'll save us some space!", There are still plenty of people with that mindset. Some will even quote "YAGNI" when you question them.

Makes me wonder how many long ints haven't needed a char to store them

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

#156
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…

[deleted]

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

#157

Earlier quoted context omitted.

Yes - I understand HOW it happened, just not sure WHY. Meaning, I'm not sure what the developer was thinking, and at this point, I'm not going to track down exactly who it was and point fingers. I think everyone has learned enough through this highly interesting bug. It certainly was interesting to see the slack room exploding with theories and debugging. A new iOS client has been submitted to Apple (hurry plz!!!), a…

> Meaning, I'm not sure what the developer was thinking A 32bit integer is pretty much the default numeric type for the majority of programming tasks over the last 20 years. Even with 64bit CPUs, 32bit is still a common practice. Probably 99% of all programmers would make the same choice unless given specific requirements to support more than 2 billion values.

> 99% of all programmers

Many dynamically typed languages have an automatic change from int to bigint rather than allowing overflow. For example, Python.

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

#158
post #92

Earlier quoted context omitted.

Mysql's unix_timestamp() breaks on years past mid 2038...so plan for that one too.

OpenBSD[1]: > time_t is now 64 bits on all platforms. Linux[2]: > The vast majority of 64-bit hosts use 64-bit time_t. This includes GNU/Linux, the BSDs, HP-UX, Microsoft Windows, Solaris, and probably others. There are one or two holdouts (Tru64 comes to mind) but they're a clear minority. This is little help for older, already deployed systems, of course. [1]: https://www.openbsd.org/55.html [2]: https://mm.icann.o…

Good to know. I was, though, specifically taking about a function inside MySQL.

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

#159
post #105

Earlier quoted context omitted.

Thanks. I'm a pretty understanding "boss", especially on the heals of reaching the 2 billion games milestone :D Our team is awesome and we love what we do. Unfortunately we're still a bunch of humans sitting at kitchen counters and on couches around the world, so things do sometimes fall in between the cushions...

> on the heals of reaching the 2 billion games milestone That's a very poetic typo

True. Only time (and grammatical errors) can heel :P

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

#160

Will the Lichess app and platform have this issue? And if not, why not?

Looks like lichess is using strings for IDs so they will not have this issue

https://github.com/ornicar/lila/blob/master/app/controllers/...

Post reply on HN