Live data from Hacker News

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

chess.com

321–330 of 338 posts

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

#321

Earlier quoted context omitted.

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

Which is a good thing, assuming you did reasonable testing with ubsan etc. Having to assume things that never happen is a big problem for optimization!

That's a good point. Seems like we could do a bit better than the current state of the art, though. If non-optimized builds trapped on overflow, that would at least give you a better chance of detecting these problems before the optimizer starts throwing out code you meant to keep.

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

#322
post #301

Earlier quoted context omitted.

> _may_ be less drying than detergent (Emphasis mine) Did you miss the part where GP asked people to stop spreading pseudo scientific falsehoods?

"harsh soaps, detergents, and perfumes, [...] tend to dry the skin" https://www.urmc.rochester.edu/encyclopedia/content.aspx?con...

The word "vinegar" is notably absent from that link. That solely shows that harsh soaps are harsh (which as you may have noticed is axiomatic), not that vinegar isn't.

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

#323
post #301

Earlier quoted context omitted.

"harsh soaps, detergents, and perfumes, [...] tend to dry the skin" https://www.urmc.rochester.edu/encyclopedia/content.aspx?con...

The word "vinegar" is notably absent from that link. That solely shows that harsh soaps are harsh (which as you may have noticed is axiomatic), not that vinegar isn't.

>notably absent

Maybe that's because vinegar isn't a staple in the hair care aisle at Walgreen's.

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

#325
post #298

Earlier quoted context omitted.

It's the smart thing to do - 4.3 billion is not that much. I had some students that asked me if even a long would be enough to handle exponential growth, after all it's only twice as big. As a thought experiement I asked them to come up with a time to fill a 32 bit int completely. They came up with roughly a year. Then as a margin of error I said, let's assume you have 4.3 billion transactions every second instead. T…

Uh it's not twice as big. 2^32 ~ 4,294,967,000 2^64 ~ 18,446,700,000,000,000,000

One is 32 bits, the other is 64 bits. It occupies exactly twice as much space. It can contain far more information, but it is only twice as big on the harddrive.

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

#326

Earlier quoted context omitted.

It's the smart thing to do - 4.3 billion is not that much. I had some students that asked me if even a long would be enough to handle exponential growth, after all it's only twice as big. As a thought experiement I asked them to come up with a time to fill a 32 bit int completely. They came up with roughly a year. Then as a margin of error I said, let's assume you have 4.3 billion transactions every second instead. T…

2^64-1 is a lot more than 2 times 2^32-1

2 times 32 bits equals 64 bits...

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

#327
post #236

Earlier quoted context omitted.

As someone who just wrote a quick hack for a temporary problem, I agree. It's not just the shitty programmers who do this. Sometimes we have shitty product managers who won't push back against this kind of thing. And you're forced into a creating something evil because most of the job is very good but this one time, you have to suck it up. My response to that, though I agree with you, is that when a supervisor or PM…

Shitty solutions are usually the right answer. At least in the areas I work in (mostly startups). I would estimate 99% of the code I write gets thrown away. Most of it is trying something out. Even for code that was intended to hit production, the company/project often gets cancelled before it ever hits production. I'm not saying this is true in your case. But there are so many different classes and types of programm…

Nothing about this comment is okay.

99% of your shit code isn't getting thrown away. It's sticking around making life hell for people like me.

Stop writing shit code because it's going to get thrown away. If you work for startups, you are always operating in protoduction mode. Everything you write ends up in prod.

Write code that doesn't suck. It doesn't have to be perfect or optimal, but make it not suck before you push.

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

#328
post #301

Earlier quoted context omitted.

"harsh soaps, detergents, and perfumes, [...] tend to dry the skin" https://www.urmc.rochester.edu/encyclopedia/content.aspx?con...

The word "vinegar" is notably absent from that link. That solely shows that harsh soaps are harsh (which as you may have noticed is axiomatic), not that vinegar isn't.

When I typed the word "may" I meant it. If it's medically established that properly diluted vinegar dries the skin I'd be interested in knowing that. Otherwise, it seems like reasonable speculation to me rather than pseudo-scientific BS.

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

#329
post #301

Earlier quoted context omitted.

"harsh soaps, detergents, and perfumes, [...] tend to dry the skin" https://www.urmc.rochester.edu/encyclopedia/content.aspx?con...

The word "vinegar" is notably absent from that link. That solely shows that harsh soaps are harsh (which as you may have noticed is axiomatic), not that vinegar isn't.

[deleted]

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

#330
post #245

Earlier quoted context omitted.

Last time this came up, I ran the numbers and the cost of the RAM saved per date stored was hundreds of dollars. Not per computer, or per program, but per date . Comparing total memory sizes doesn't tell the whole story, because RAM for a whole machine is so much cheaper now. Spending that much money on storing "19" just so your code keeps working in the unlikely event that it's still in use 3+ decades into the futur…

You're calculating what it would cost to store a string representation of a date. Which is silly. You should always convert to a timestamp for storage. You can cram way more info into a single integer than you can with a base 10 string. And the bonus is you verify the date's correctness before storing. Even a 32-bit int could hold 11 million years worth of dates. And if your software is used for longer than that, you…

They were stored in BCD at the time:

https://en.wikipedia.org/wiki/Binary-coded_decimal

That was the right choice for the era. As mikeash points out, your approach takes more bits and more CPU cycles. But it also takes a computer to decode. Any programmer can look at a punch card, a hex dump, or even blinkenlights and read BCD. Decoding a 32-bit int for the date takes special code. Which you have to make sure to manually include in your program, the size of which you are already struggling to keep under machine limits.

We've come a long way.

Post reply on HN