Live data from Hacker News

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

chess.com

281–290 of 338 posts

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

#282
post #255

What would be the best way to test for this kind of issues in advance. Testing at theoretical limits at all endpoints?

I'm not sure this falls under testing. If you start with an empty database each time you start the test you may never hit this issue. I think this is more of a capacity planning issue.

My concern is that even if one plans for a sufficient capacity, there still needs to be testing done to verify that the code actually works if the capacity is nearing the theoretical limit. In this example the database id was transformed into a 32 bit integer somewhere in the application code.

Usually when I hit some sort of unexpected bug in production I try to think about what type of testing will prevent similar problems in the future.

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

#283
post #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 o…

Having spent a year hardening financial systems against Y2K, I was very unimpressed to discover my credit card not working on 1st of January.

The call centre staff told me that this wasn't a Y2K bug, but a year-end bug. As if that was meant to make me feel better about an obvious, grim, failure.

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

#284

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…

Why 2038?

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

#285
post #53

Earlier quoted context omitted.

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

> If you want specific sizes I would go further and say you should _always_ use specific sizes, unless forced otherwise. There's no reason not to.

There are a gazillion reasons not to. You should _never_ use specific sizes, unless forced otherwise.

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

#286

Earlier quoted context omitted.

The silent wheel gets rode?

Greased wheels don't squeak.

How about: "prodigal brother syndrome"?

I suspect the parable it alludes to passes the cultural literacy threshold for comprehension, at least in the US.

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

#287

Earlier quoted context omitted.

But a 2 digit date should take less than 7 bits. Were they using systems that didn't use 8 bit bytes? Why wouldn't the dates work from, say 1900 to 2155?

Good question! Nobody was writing 1900 + (year % 100), right?

For example, some systems stored the year in a byte, and when printing out a report it printed "19" and that byte - so year 1999 would be followed by year 19100.

Some systems, where storing numbers in columns of characters were common practice (COBOL idiomatic style?) stored the date as two digits (possibly BCD), so the possible range is 00-99 no matter how many bits are used.

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

#288
post #226
post #46

Earlier quoted context omitted.

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).

It's a form of (inverse) Survivorship Bias. "None survived, therefore none started out" is an (inverse) extension of "The ones that survived were the ones that started out".

I was going to say ... it's a corollary of survivor bias ...

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

#289

Earlier quoted context omitted.

- Who among us is writing code today worried about how it will be used in 2052? The good programmers who are fortunate enough to be working on software that matters.

I doubt that's true, unless you mean it tautologically. There are plenty of good programmers working on software that matters that should absolutely not be trading off hazy possible benefits in 2052 for significant costs now. It's occasionally necessary. When I wrote the code for Long Bets [1], I took a number of prudent steps to make sure things would have a good shot at surviving for decades. But I only took the ch…

> "Technological change has slowed down some"

wat

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

#290
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).

Yes, Daniel Kahneman describes this kind of cognitive bias as "what you see is all there is". A simple example given in his book* is to ask the members of any couple (or roommates) which percentage of the home duties he/she performs. The sum is always above 100÷

*"Thinking fast and slow", best good recommendation I got from the HN crowd

Post reply on HN