Live data from Hacker News

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

chess.com

101–110 of 338 posts

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

#101
post #86

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…

It's most likely for efficiency and performance reason. 64-bit doubles the storage requirement of 32-bit and would have impact on database's utilization of memory, querying window size, cache, and storage. Edit: 32 bits worth of games played means about 4 billion games. 4 billion X 4 bytes for 32-bit = 16GB just for the 32-bit ID's. 64-bit ID's would need 32GB for the 4 billion games. I guess memory and storage weren…

It sounds like it was client side, not server side. Most likely the iOS client was using Objective-C's NSInteger or Swift's Int, just because that's the default choice for most programmers working in that language, and they didn't think it through.

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

#102
post #35
post #24

Earlier quoted context omitted.

Or UUID...

I pick UUIDs because experience has taught me that even for the smallest workloads, I'll inevitably have to shard my DB (to partition a shared public cloud from N isolated "enterprise" deployments), and then will inevitably want to do statistical-analysis things that involve ingesting rows from the shards (or log entries referencing those rows), and deduplicating them by ID, without generating false-positive collisio…

I don't agree with all their reasoning---but ulid still seems like a good idea. (Though the main difference you care about in programming is how they are generated---via timestamps plus randomness, not that they have a different serialization format.)

For some applications you don't want to leak the time. Choose wisely.

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

#103
post #55

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!

For those, like my, that didn't recall off the top of their heads: BLOB in MySQL can usually only hold ~64KB. EDIT: Though I am curious why MySQL doesn't throw an error when you try to store more than 64KB in BLOB?

The BLOB size limit is a nuisance, the silent truncation is the bug...

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

#104
post #80
post #59

Earlier quoted context omitted.

Signed overflow is ub in C

Signed overflow is IB, not UB.

Alas, no. Signed overflow is UB and compilers can and will assume that it cannot happen when performing optimizations.

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

#105
post #66

Earlier quoted context omitted.

It's an honest mistake, things like this happen. Not the end of the world, especially for an otherwise great product like chess.com. Go easy on your eng team ;)

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

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

#106
post #99
post #8

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

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

Also see: IPv4 vs IPv6.

Remember, these fancy computing devices were built for the rich and the government, not for the average joe, noone thought computing would be this easily accessible.

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

#107
post #72

Earlier quoted context omitted.

It really depends on how much data and how old. My dad's first programming job was initially to mechanically change how variables where stored thus saving 1 and only 1 byte of disk space . Someone ran the numbers and having someone do that for a few months was a net savings. A few years after that he was talking about some relatively minor optimizations that saved a full million dollars worth of hardware costs by del…

Regarding the point I was speaking to: it's undoubtedly true that some of those hacks were initially worthwhile. Keeping them going until the year 2000 was, by that same standard of cost effectiveness, pretty definitely a visible failure.

You keep them going because of status quo bias / not touching a working system.

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

#108
post #73
post #65

Earlier quoted context omitted.

C/C++ is notoriously head-ache inducing on this point. Yes, all the CPU archs you'd reasonably expect to encounter today behave this way. However, because the language standard says signed overflow is undefined, compilers are free to assume that it will never happen, and make optimizations that you'd think would be unsafe, but are technically permissible. [1] [1] https://stackoverflow.com/questions/18195715/why-is-un…

Well that's interesting. I was not aware of any compilers doing this. I wonder if there's a switch in gcc/llvm/msvc/etc to turn this specific behavior off.

https://linux.die.net/man/1/gcc -- Search for `-fstrict-overflow`. And note how it says

  The -fstrict-overflow option is enabled at levels -O2, -O3, -Os. 
In other words, basically every program that you're using is compiled with that option enabled. (Release builds typically use -O2, sometimes even -O3.)

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

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

A more relevant way of putting it for me: Why do we have to have so many different corporate rules and processes when everything is working anyways?

The flip side is the confirmation bias of "it's working because of our rules."

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

#110

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

In my experience the chat on chess.com harbors a similar demographic to that of most video games. You'd think that chess would attract a more mature player base, but nope.
Post reply on HN